aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRafael Ávila de Espíndola <espindola@google.com>2009-03-31 11:07:32 +0000
committerRafael Ávila de Espíndola <espindola@google.com>2009-03-31 11:07:32 +0000
commit5104a588b1d1c39de0e4714433dbd600ebf9bea2 (patch)
tree49bb89448ed190145362745aa68ccd502e65719e /gcc
parent503df21f7d240fcf801fd0a49e5d5e0c7e8f913f (diff)
2009-03-31 Rafael Avila de Espindola <espindola@google.com>
Mainline merge @145100. * configure.ac (ACX_PKGVERSION): Update revision merge string. * configure: Regenerate. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/lto@145339 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog600
-rw-r--r--gcc/ChangeLog-200814
-rw-r--r--gcc/ChangeLog.lto7
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in15
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/gcc-interface/trans.c2
-rw-r--r--gcc/c-common.c27
-rw-r--r--gcc/c-omp.c21
-rw-r--r--gcc/c-parser.c16
-rw-r--r--gcc/c.opt6
-rw-r--r--gcc/cfgexpand.c3
-rw-r--r--gcc/cfgloop.h21
-rw-r--r--gcc/cgraph.h8
-rw-r--r--gcc/config.gcc5
-rw-r--r--gcc/config.host11
-rw-r--r--gcc/config/alpha/alpha.c12
-rw-r--r--gcc/config/alpha/driver-alpha.c100
-rw-r--r--gcc/config/alpha/linux.h16
-rw-r--r--gcc/config/alpha/x-alpha3
-rw-r--r--gcc/config/arm/arm.h2
-rw-r--r--gcc/config/arm/rtems-elf.h1
-rw-r--r--gcc/config/avr/avr-protos.h3
-rw-r--r--gcc/config/avr/avr.c59
-rw-r--r--gcc/config/avr/avr.h5
-rw-r--r--gcc/config/bfin/bfin.c20
-rw-r--r--gcc/config/cris/cris.h5
-rw-r--r--gcc/config/cris/libgcc.ver7
-rw-r--r--gcc/config/cris/linux.h3
-rw-r--r--gcc/config/cris/t-linux1
-rw-r--r--gcc/config/fr30/fr30.opt5
-rw-r--r--gcc/config/i386/i386.c122
-rw-r--r--gcc/config/i386/i386.h28
-rw-r--r--gcc/config/i386/i386.md70
-rw-r--r--gcc/config/i386/predicates.md28
-rw-r--r--gcc/config/i386/sse.md8
-rw-r--r--gcc/config/i386/sync.md28
-rw-r--r--gcc/config/i386/x-mingw322
-rw-r--r--gcc/config/ia64/ia64.c2
-rw-r--r--gcc/config/m68k/t-rtems1
-rw-r--r--gcc/config/mcore/mcore.h3
-rw-r--r--gcc/config/mcore/mcore.opt13
-rw-r--r--gcc/config/picochip/picochip.c28
-rw-r--r--gcc/config/picochip/picochip.h1
-rw-r--r--gcc/config/picochip/picochip.md11
-rw-r--r--gcc/config/rs6000/rs6000.c4
-rw-r--r--gcc/config/rs6000/t-rtems2
-rw-r--r--gcc/config/sh/sh.c4
-rw-r--r--gcc/config/sparc/sparc.md6
-rw-r--r--gcc/config/spu/divv2df3.c198
-rw-r--r--gcc/config/spu/spu.c9
-rw-r--r--gcc/config/spu/t-spu-elf7
-rwxr-xr-xgcc/configure17
-rw-r--r--gcc/configure.ac15
-rw-r--r--gcc/cp/ChangeLog161
-rw-r--r--gcc/cp/class.c36
-rw-r--r--gcc/cp/cp-gimplify.c5
-rw-r--r--gcc/cp/cp-objcp-common.c2
-rw-r--r--gcc/cp/cp-tree.h35
-rw-r--r--gcc/cp/decl.c56
-rw-r--r--gcc/cp/decl2.c25
-rw-r--r--gcc/cp/error.c5
-rw-r--r--gcc/cp/init.c114
-rw-r--r--gcc/cp/lex.c3
-rw-r--r--gcc/cp/mangle.c75
-rw-r--r--gcc/cp/method.c2
-rw-r--r--gcc/cp/name-lookup.c28
-rw-r--r--gcc/cp/operators.def2
-rw-r--r--gcc/cp/parser.c93
-rw-r--r--gcc/cp/pt.c141
-rw-r--r--gcc/cp/semantics.c95
-rw-r--r--gcc/cp/tree.c12
-rw-r--r--gcc/cp/typeck2.c16
-rw-r--r--gcc/cse.c9
-rw-r--r--gcc/defaults.h5
-rw-r--r--gcc/df-scan.c6
-rw-r--r--gcc/df.h24
-rw-r--r--gcc/doc/extend.texi13
-rw-r--r--gcc/doc/install.texi9
-rw-r--r--gcc/doc/invoke.texi191
-rw-r--r--gcc/doc/tm.texi12
-rw-r--r--gcc/dse.c18
-rw-r--r--gcc/dwarf2out.c173
-rw-r--r--gcc/except.c6
-rw-r--r--gcc/expr.h3
-rw-r--r--gcc/fold-const.c15
-rw-r--r--gcc/fortran/ChangeLog10
-rw-r--r--gcc/fortran/lang.opt12
-rw-r--r--gcc/fortran/simplify.c1
-rw-r--r--gcc/function.c38
-rw-r--r--gcc/function.h18
-rw-r--r--gcc/gcc.c2
-rw-r--r--gcc/genpreds.c6
-rw-r--r--gcc/gimplify.c8
-rw-r--r--gcc/graphite.c33
-rw-r--r--gcc/ipa-struct-reorg.c2
-rw-r--r--gcc/ira-conflicts.c32
-rw-r--r--gcc/ira-int.h26
-rw-r--r--gcc/ira.c10
-rw-r--r--gcc/java/ChangeLog4
-rw-r--r--gcc/java/lang.opt4
-rw-r--r--gcc/lambda-code.c3
-rw-r--r--gcc/libgcc2.c14
-rw-r--r--gcc/matrix-reorg.c10
-rw-r--r--gcc/optabs.c18
-rw-r--r--gcc/opts.c31
-rw-r--r--gcc/recog.c10
-rw-r--r--gcc/reginfo.c2
-rw-r--r--gcc/reload.h26
-rw-r--r--gcc/reload1.c34
-rw-r--r--gcc/rtl.h2
-rw-r--r--gcc/rtlanal.c9
-rw-r--r--gcc/testsuite/ChangeLog338
-rw-r--r--gcc/testsuite/g++.dg/compat/struct-layout-1.exp15
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/auto12.C23
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/auto6.C16
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist5.C4
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-1.C17
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C2
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/imported-module-3.C17
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/imported-module-4.C21
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/static-local-var-in-ctor.C37
-rw-r--r--gcc/testsuite/g++.dg/dg.exp1
-rw-r--r--gcc/testsuite/g++.dg/ext/unary_trait_incomplete.C76
-rw-r--r--gcc/testsuite/g++.dg/ext/vla6.C18
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr39495-1.C95
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr39495-2.C39
-rw-r--r--gcc/testsuite/g++.dg/graphite/graphite.exp48
-rw-r--r--gcc/testsuite/g++.dg/graphite/pr39447.C34
-rw-r--r--gcc/testsuite/g++.dg/inherit/thunk10.C60
-rw-r--r--gcc/testsuite/g++.dg/opt/new1.C71
-rw-r--r--gcc/testsuite/g++.dg/opt/nrv15.C97
-rw-r--r--gcc/testsuite/g++.dg/opt/switch2.C2
-rw-r--r--gcc/testsuite/g++.dg/other/error32.C8
-rw-r--r--gcc/testsuite/g++.dg/other/new1.C2
-rw-r--r--gcc/testsuite/g++.dg/other/pr39060.C19
-rw-r--r--gcc/testsuite/g++.dg/other/pr39496.C35
-rw-r--r--gcc/testsuite/g++.dg/other/switch3.C25
-rw-r--r--gcc/testsuite/g++.dg/parse/crash40.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/defarg12.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/defarg14.C6
-rw-r--r--gcc/testsuite/g++.dg/template/error15.C2
-rw-r--r--gcc/testsuite/g++.dg/template/koenig7.C11
-rw-r--r--gcc/testsuite/g++.dg/template/pr39425.C18
-rw-r--r--gcc/testsuite/g++.dg/template/spec33.C2
-rw-r--r--gcc/testsuite/g++.dg/warn/Wdisallowed-functions-3.C10
-rw-r--r--gcc/testsuite/g++.dg/warn/Wshadow-4.C20
-rw-r--r--gcc/testsuite/g++.dg/warn/Wswitch-1.C6
-rw-r--r--gcc/testsuite/g++.dg/warn/Wuninitialized-3.C17
-rw-r--r--gcc/testsuite/g++.dg/warn/switch1.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/thunk2.C1
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr32139.c11
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr39360.c16
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr39394.c28
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/inf-2.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/inf-3.c79
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr35456.x3
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr39339.c4
-rw-r--r--gcc/testsuite/gcc.dg/asm-b.c4
-rw-r--r--gcc/testsuite/gcc.dg/autopar/pr39500-1.c28
-rw-r--r--gcc/testsuite/gcc.dg/autopar/pr39500-2.c20
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-layout-1.exp17
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c3
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-layout-1_main.c2
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr39412.c16
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr39495-1.c95
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr39495-2.c39
-rw-r--r--gcc/testsuite/gcc.dg/inline-33.c21
-rw-r--r--gcc/testsuite/gcc.dg/pr11492.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr27898.c8
-rw-r--r--gcc/testsuite/gcc.dg/pr39443.c18
-rw-r--r--gcc/testsuite/gcc.dg/pr39455.c13
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76b.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr39529.c21
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-82.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-83.c3
-rw-r--r--gcc/testsuite/gcc.dg/wdisallowed-functions-3.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/pr39431.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/pr39445.c25
-rw-r--r--gcc/testsuite/gcc.target/i386/pr39482.c9
-rw-r--r--gcc/testsuite/gcc.target/i386/pr39496.c35
-rw-r--r--gcc/testsuite/gcc.target/i386/push-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/stackalign/longlong-1.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/stackalign/longlong-2.c33
-rw-r--r--gcc/testsuite/gcc.target/ia64/20090324-1.c21
-rw-r--r--gcc/testsuite/gcc.target/s390/20090223-1.c60
-rw-r--r--gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect.c2
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_f0_1.f9017
-rw-r--r--gcc/testsuite/gfortran.dg/pr39516.f20
-rw-r--r--gcc/testsuite/gfortran.dg/read_repeat.f9024
-rw-r--r--gcc/testsuite/gnat.dg/slice_enum.adb8
-rw-r--r--gcc/testsuite/lib/compat.exp2
-rw-r--r--gcc/testsuite/lib/gcc-defs.exp5
-rw-r--r--gcc/testsuite/lib/target-libpath.exp37
-rw-r--r--gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp16
-rw-r--r--gcc/testsuite/objc/execute/exceptions/handler-1.m38
-rw-r--r--gcc/testsuite/objc/execute/trivial.m7
-rw-r--r--gcc/tree-cfg.c18
-rw-r--r--gcc/tree-data-ref.c2
-rw-r--r--gcc/tree-data-ref.h24
-rw-r--r--gcc/tree-dfa.c12
-rw-r--r--gcc/tree-flow.h2
-rw-r--r--gcc/tree-inline.c12
-rw-r--r--gcc/tree-nrv.c27
-rw-r--r--gcc/tree-ssa-live.c6
-rw-r--r--gcc/tree-ssa-loop-ivopts.c20
-rw-r--r--gcc/tree-ssa-loop-niter.c36
-rw-r--r--gcc/tree-ssa-structalias.c2
-rw-r--r--gcc/tree-vect-transform.c9
-rw-r--r--gcc/tree-vectorizer.c8
-rw-r--r--gcc/tree-vrp.c8
-rw-r--r--gcc/tree.c12
-rw-r--r--gcc/tree.h2
-rw-r--r--gcc/varasm.c2
215 files changed, 4644 insertions, 1019 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3f66fef7068..f5b7076b8c4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,6 +1,589 @@
+2009-03-26 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * doc/invoke.texi (i386 and x86-64 Windows Options): Fix texinfo
+ markup glitch.
+
+2009-03-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/39554
+ * opts.c (warn_if_disallowed_function_p): Don't assume
+ get_callee_fndecl must return non-NULL.
+
+2009-03-26 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/39522
+ * reload1.c (reload_as_needed): Invalidate reg_last_reload_reg too
+ when reg_reloaded_valid is set.
+
+2009-03-26 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/divv2df3.c: New file.
+ * config/spu/t-spu-elf (LIB2FUNCS_STATIC_EXTRA): Add it.
+ (DPBIT_FUNCS): Filter out _div_df.
+
+2009-03-26 Bernd Schmidt <bernd.schmidt@analog.com>
+
+ * config/bfin/bfin.c (bfin_optimize_loop): If the LSETUP goes before
+ a jump insn, count that jump in the distance to the loop start.
+
+2009-03-25 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ PR target/39523
+ * config/sh/sh.c (calc_live_regs): Fix condition for global
+ registers except PIC_OFFSET_TABLE_REGNUM.
+
+2009-03-25 Kai Tietz <kai.tietz@onevision.com>
+
+ PR/39518
+ * doc/invoke.texi (-mconsole): New.
+ (-mcygwin): New.
+ (-mno-cygwin): New.
+ (-mdll): New.
+ (-mnop-fun-dllimport): New.
+ (-mthread): New.
+ (-mwin32): New.
+ (-mwindows): New.
+ (sub section "i386 and x86-64 Windows Options"): New.
+
+2009-03-25 Ralf Corsépius <ralf.corsepius@rtems.org>
+
+ * config/arm/rtems-elf.h: Remove LINK_GCC_C_SEQUENCE_SPEC.
+ * config/rs6000/t-rtems: Remove MULTILIB_EXTRA_OPTS.
+
+2009-03-25 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/39497
+ * Makefile.in (dfp.o-warn): Use -fno-strict-aliasing instead
+ of -Wno-error.
+
+2009-03-25 Andrey Belevantsev <abel@ispras.ru>
+
+ * config/ia64/ia64.c (ia64_set_sched_flags): Zero spec_info->mask when
+ neither of haifa/selective schedulers are working.
+
+2009-03-25 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * doc/invoke.texi (Debugging Options): Fix description of
+ -fno-merge-debug-strings.
+
+2009-03-24 Hans-Peter Nilsson <hp@axis.com>
+
+ * config/cris/libgcc.ver: New version-script.
+ * config/cris/t-linux (SHLIB_MAPFILES): Use it.
+
+ * configure.ac <GAS features, nop mnemonic>: Add pattern
+ crisv32-*-* for "nop".
+ <GAS features, Thread-local storage>: Add item for CRIS and
+ CRIS v32.
+ * configure: Regenerate.
+
+2009-03-24 Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/39529
+ * tree-vect-transform.c (vect_create_data_ref_ptr): Call
+ mark_sym_for_renaming for the tag copied to the new vector
+ pointer.
+
+2009-03-24 Arthur Loiret <aloiret@debian.org>
+
+ * config.host (alpha*-*-linux*): Use driver-alpha.o and
+ alpha/x-alpha.
+ * config/alpha/linux.h (host_detect_local_cpu): Declare, add to
+ EXTRA_SPEC_FUNCTIONS.
+ (MCPU_MTUNE_NATIVE_SPECS, DRIVER_SELF_SPECS): New macros.
+ * config/alpha/driver-alpha.c, config/alpha/x-alpha: New.
+ * doc/invoke.texi (DEC Alpha Options): Document 'native' value for
+ -march and -mtune options.
+
+2009-03-24 Ralf Corsépius <ralf.corsepius@rtems.org>
+
+ * config/m68k/t-rtems: Add m5329 multilib.
+
+2009-03-24 Dodji Seketeli <dodji@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/39524
+ * dwarf2out.c (gen_variable_die): Avoid adding duplicate declaration
+ nodes.
+
+2009-03-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/39495
+ * c-parser.c (c_parser_omp_for_loop): Call c_parser_binary_expression
+ instead of c_parser_expression_conv, if original_code isn't one of the
+ 4 allowed comparison codes, fail.
+
+2009-03-23 Richard Guenther <rguenther@suse.de>
+
+ * cgraph.h (struct cgraph_node): Reorder fields for 64-bit hosts.
+ * tree.h (struct tree_type): Likewise.
+ * reload.h (struct insn_chain): Likewise.
+ * dwarf2out.c (struct dw_loc_descr_struct): Likewise.
+ * function.h (struct function): Likewise.
+ * tree-ssa-structalias.c (struct equiv_class_label): Likewise.
+
+2009-03-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/39516
+ * lambda-code.c (perfect_nestify): Fix type of the uboundvar variable.
+
+2009-03-23 Bingfeng Mei <bmei@broadcom.com>
+
+ * config.gcc (need_64bit_hwint): Make clear that need_64bit_hwint
+ should be set true if BITS_PER_WORD of target is bigger than 32
+
+2009-03-22 Hans-Peter Nilsson <hp@axis.com>
+
+ * config/cris/linux.h (CRIS_LINK_SUBTARGET_SPEC):
+ Translate -B-options to -rpath-link. Correct existing
+ rpath-link and conditionalize on !nostdlib.
+
+2009-03-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * doc/extend.texi (Function Attributes, Variable Attributes):
+ Fix typos.
+ * doc/invoke.texi (Debugging Options, Optimize Options)
+ (i386 and x86-64 Options, MCore Options): Likewise.
+
+2009-03-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/37890
+ * dwarf2out.c (gen_namespace_die): Add context_die argument and use
+ it for block local namespace aliases.
+ (gen_decl_die): Pass context_die to gen_namespace_die.
+
+2009-03-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/39495
+ * c-omp.c (c_finish_omp_for): Allow NE_EXPR with TREE_TYPE (decl)'s
+ minimum or maximum value.
+
+2009-03-19 Alexandre Oliva <aoliva@redhat.com>
+
+ * reginfo.c (globalize_reg): Recompute derived reg sets.
+
+2009-03-19 Ozkan Sezer <sezeroz@gmail.com>
+
+ PR target/39063
+ * libgcc2.c (mprotect): Do not use signed arguments for
+ VirtualProtect, use DWORD arguments. Also fix the 'may
+ be used uninitialized' warning for the np variable.
+
+2009-03-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/39496
+ * config/i386/i386.c (ix86_function_regparm): Don't optimize local
+ functions using regparm calling conventions when not optimizing.
+ (ix86_function_sseregparm): Similarly for sseregparm calling
+ conventions.
+
+2009-03-19 Li Feng <nemokingdom@gmail.com>
+
+ PR middle-end/39500
+ * tree-data-ref.c (analyze_subscript_affine_affine): There is no
+ dependence if the first conflict is after niter iterations.
+
+2009-03-19 Hans-Peter Nilsson <hp@axis.com>
+
+ PR middle-end/38609
+ * config/cris/cris.h (FRAME_POINTER_REQUIRED): Force for all
+ functions with dynamic stack-pointer adjustments.
+
+2009-03-19 Ben Elliston <bje@au.ibm.com>
+
+ * doc/invoke.texi (RS/6000 and PowerPC Options): Fix -msdata-data
+ option; change to -msdata=data.
+
+2009-03-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * c.opt: Unify help texts for -Wdeprecated, -Wsystem-headers,
+ and -fopenmp.
+
+2009-03-18 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/35180
+ * config/sparc/sparc.md (do_builtin_setjmp_setup): Prettify asm output.
+
+2009-03-18 Sandra Loosemore <sandra@codesourcery.com>
+
+ * doc/invoke.texi (Code Gen Options): Expand discussion of
+ -fno-common.
+
+2009-03-18 Jakub Jelinek <jakub@redhat.com>
+
+ * dse.c (struct group_info): Reorder fields for 64-bit hosts.
+ * matrix-reorg.c (struct matrix_info): Likewise.
+ * tree-ssa-loop-ivopts.c (struct ivopts_data): Likewise.
+ * rtl.h (struct mem_attrs): Likewise.
+ * df.h (struct df): Likewise.
+ * tree-data-ref.h (struct data_dependence_relation): Likewise.
+ * ira-int.h (struct ira_allocno): Likewise.
+ * df-scan.c (struct df_collection_rec): Likewise.
+ * ira.c (struct equivalence): Likewise.
+ * function.c (struct temp_slot): Likewise.
+ * cfgloop.h (struct loop): Likewise.
+
+ PR debug/39485
+ * function.c (use_register_for_decl): When not optimizing, disregard
+ register keyword for variables with types containing methods.
+
+2009-03-18 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/39447
+ * graphite.c (exclude_component_ref): Renamed contains_component_ref_p.
+ (is_simple_operand): Call contains_component_ref_p before calling data
+ reference analysis that would fail on COMPONENT_REFs.
+
+ * tree-vrp.c (search_for_addr_array): Fix formatting.
+
+2009-03-18 Richard Guenther <rguenther@suse.de>
+
+ * tree-vect-transform.c (vect_loop_versioning): Fold the
+ generated comparisons.
+ * tree-vectorizer.c (set_prologue_iterations): Likewise.
+ (slpeel_tree_peel_loop_to_edge): Likewise.
+
+2009-03-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ PR middle-end/37805
+ * opts.c (print_specific_help): In addition to `undocumented',
+ accept `separate' and `joined' flags if passed alone. Describe
+ output by the first matched one of those.
+ (common_handle_option): Skip over empty strings.
+ * gcc.c (display_help): Fix help string for `--help='.
+ * doc/invoke.texi (Option Summary, Overall Options): With
+ `--help=', classes and qualifiers can both be repeated, but
+ only the latter can be negated. One should not pass only
+ negated qualifiers. Fix markup and examples.
+
+ Revert
+ 2008-10-14 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/37805
+ * opts.c (common_handle_option): Don't ICE on -fhelp=joined
+ and -fhelp=separate.
+
+2009-03-17 Jing Yu <jingyu@google.com>
+
+ PR middle-end/39378
+ * function.h (struct rtl_data): Move is_thunk from here...
+ (struct function): ...to here.
+ * cp/method.c (use_thunk): Change is_thunk from crtl to cfun.
+ * varasm.c (assemble_start_function): Change is_thunk from crtl to
+ cfun.
+ * config/alpha/alpha.c (alpha_sa_mask): Change is_thunk from crtl to
+ cfun.
+ (alpha_does_function_need_gp, alpha_start_function): Likewise.
+ (alpha_output_function_end_prologue): Likewise.
+ (alpha_end_function, alpha_output_mi_thunk_osf): Likewise.
+ * config/rs6000/rs6000.c (rs6000_ra_ever_killed): Likewise.
+ (rs6000_output_function_epilogue): Likewise.
+ * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Likewise.
+
+2009-03-17 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/39482
+ * config/i386/i386.md (*truncdfsf_mixed): Avoid combining registers
+ from different units in a single alternative.
+ (*truncdfsf_i387): Ditto.
+ (*truncxfsf2_mixed): Ditto.
+ (*truncxfdf2_mixed): Ditto.
+
+2009-03-17 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2out.c (dwarf2out_imported_module_or_decl_1): Allow
+ non-NAMESPACE_DECL IMPORTED_DECL_ASSOCIATED_DECL.
+
+ PR debug/39474
+ * tree-ssa-live.c (remove_unused_locals): Don't remove local
+ unused non-artificial variables when not optimizing.
+
+ PR debug/39471
+ * dwarf2out.c (dwarf2out_imported_module_or_decl_1): Emit
+ DW_TAG_imported_module even if decl is IMPORTED_DECL with
+ NAMESPACE_DECL in its DECL_INITIAL.
+
+ PR middle-end/39443
+ * optabs.c (set_user_assembler_libfunc): New function.
+ * expr.h (set_user_assembler_libfunc): New prototype.
+ * c-common.c: Include libfuncs.h.
+ (set_builtin_user_assembler_name): Call set_user_assembler_libfunc
+ for memcmp, memset, memcpy, memmove and abort.
+ * Makefile.in (c-common.o): Depend on libfuncs.h.
+
+ PR debug/39412
+ * dwarf2out.c (gen_inlined_enumeration_type_die,
+ gen_inlined_structure_type_die, gen_inlined_union_type_die,
+ gen_tagged_type_instantiation_die): Removed.
+ (gen_decl_die): For TYPE_DECL_IS_STUB with non-NULL decl_origin
+ do nothing.
+
+2009-03-17 Janis Johnson <janis187@us.ibm.com>
+
+ PR testsuite/38526
+ * Makefile.in (site.exp): Rename TEST_GCC_EXEC_PREFIX and comment
+ its use.
+ (check-%): Don't set GCC_EXEC_PREFIX when invoking runtest.
+ (check-parallel-%): Ditto.
+ (check-consistency): Ditto.
+
+2009-03-17 Kai Tietz <kai.tietz@onevision.com>
+
+ * ipa-struct-reorg.c (create_general_new_stmt): Initialize
+ local variable rhs by NULL_TREE.
+
+2009-03-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/39477
+ * doc/extend.texi: Correct register behavior for regparm on Intel 386.
+
+2009-03-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/39476
+ * config/i386/i386.c (ix86_function_regparm): Rewrite for 64bit.
+
+2009-03-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/39473
+ * config/i386/i386.c (ix86_expand_call): Check extra clobbers
+ for ms->sysv ABI calls only in 64bit mode.
+
+ * config/i386/i386.md (untyped_call): Support 32bit.
+
+2009-03-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * doc/extend.texi: Replace x86_65 with x86_64.
+
+2009-03-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/39455
+ * tree-ssa-loop-niter.c (number_of_iterations_lt_to_ne): Fix types
+ mismatches for POINTER_TYPE_P (type).
+ (number_of_iterations_le): Likewise.
+
+2009-03-16 Hariharan Sandanagobalane <hariharan@picochip.com>
+
+ * config/picochip/picochip.c: Removed profiling support.
+ * config/picochip/picochip.md: Removed profiling instruction.
+ * config/picochip/picochip.h: Removed profiling builtin.
+
+2009-03-16 Joseph Myers <joseph@codesourcery.com>
+
+ * doc/install.texi (--with-host-libstdcxx): Document.
+
+2009-03-14 Anatoly Sokolov <aesok@post.ru>
+
+ PR target/34299
+ * config/avr/avr.c (avr_handle_fndecl_attribute): Move code for
+ generate a warning if the function name does not begin with
+ "__vector" and the function has either the 'signal' or 'interrupt'
+ attribute, from here to ...
+ (avr_declare_function_name): ...here. New function.
+ * config/avr/avr.h (ASM_DECLARE_FUNCTION_NAME): Redefine.
+ * config/avr/avr-protos.h (avr_declare_function_name): Declare.
+
+2009-03-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/39454
+ * cse.c (fold_rtx): Don't modify original const_arg1 when
+ canonicalizing SHIFT_COUNT_TRUNCATED shift count, do it on a
+ separate variable instead.
+ * rtlanal.c (nonzero_bits1) <case ASHIFTRT>: Don't assume anything
+ from out of range shift counts.
+ (num_sign_bit_copies1) <case ASHIFTRT, case ASHIFT>: Similarly.
+
+2008-03-13 Catherine Moore <clm@codesourcery.com>
+
+ * gcc/config/i386/x-mingw32 (host-mingw32.o): Replace
+ diagnostic.h with $(DIAGNOSTIC_H).
+
+2008-03-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/39431
+ * config/i386/predicates.md (cmpxchg8b_pic_memory_operand): New
+ predicate.
+ * config/i386/sync.md (sync_compare_and_swap<mode>,
+ sync_compare_and_swap_cc<mode>): For DImode with -m32 -fpic check
+ if operands[1] is cmpxchg8b_pic_memory_operand, if not force address
+ into a register.
+ (sync_double_compare_and_swapdi_pic,
+ sync_double_compare_and_swap_ccdi_pic): Require operand 1 to be
+ cmpxchg8b_pic_memory_operand instead of just memory_operand.
+
+2009-03-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/39445
+ * config/i386/i386.c (ix86_expand_push): Don't set memory alignment.
+
+2009-03-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/39327
+ * config/i386/sse.md (avx_addsubv8sf3): Correct item bits.
+ (avx_addsubv4df3): Likewise.
+ (*avx_addsubv4sf3): Likewise.
+ (sse3_addsubv4sf3): Likewise.
+
+2009-03-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/38824
+ * config/i386/i386.md: Compare REGNO on the new peephole2 patterns.
+
+2009-03-12 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR debug/39432
+ * ira-int.h (struct allocno): Fix comment for calls_crossed_num.
+ * ira-conflicts.c (ira_build_conflicts): Prohibit call used
+ registers for allocnos created from user-defined variables.
+
+2009-03-11 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ PR target/39181
+ * config/spu/spu.c (spu_expand_mov): Handle invalid subregs
+ of non-integer mode as well.
+
+2009-03-11 Adam Nemet <anemet@caviumnetworks.com>
+
+ * gimplify.c (gimplify_call_expr): Don't set CALL_CANNOT_INLINE_P
+ for functions for which the parameter types are unknown.
+
+2009-03-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/39137
+ * cfgexpand.c (get_decl_align_unit): Use LOCAL_DECL_ALIGNMENT macro.
+ * defaults.h (LOCAL_DECL_ALIGNMENT): Define if not yet defined.
+ * config/i386/i386.h (LOCAL_DECL_ALIGNMENT): Define.
+ * config/i386/i386.c (ix86_local_alignment): For
+ -m32 -mpreferred-stack-boundary=2 use 32-bit alignment for
+ long long variables on the stack to avoid dynamic realignment.
+ Allow the first argument to be a decl rather than type.
+ * doc/tm.texi (LOCAL_DECL_ALIGNMENT): Document.
+
+2009-03-11 Nick Clifton <nickc@redhat.com>
+
+ PR target/5362
+ * config/mcore/mcore.opt: Remove deprecated m4align and m8align
+ options.
+ Add description to mno-lsim option.
+ * config/mcore/mcore.h: Remove comment about deprecated m4align
+ option.
+ (TARGET_DEFAULT): Remove deprecated MASK_M8ALIGN.
+ * doc/invoke.texi: Add description of mno-lsim and
+ mstack-increment options.
+
+ * config/fr30/fr30.opt: Document the -mno-lsim option.
+ * doc/invoke.texi: Add descriptions of the FR30's -msmall-model
+ and -mno-lsim options.
+
+2009-03-11 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * fold-const.c (fold_comparison): Only call fold_inf_compare
+ if the mode supports infinities.
+
+2009-03-11 Jason Merrill <jason@redhat.com>
+
+ PR debug/39086
+ * tree-nrv.c (tree_nrv): Don't do this optimization if the front
+ end already did. Notice GIMPLE_CALL modifications of the result.
+ Don't copy debug information from an ignored decl or a decl from
+ another function.
+
+2009-03-10 Richard Guenther <rguenther@suse.de>
+ Nathan Froyd <froydnj@codesourcery.com>
+
+ PR middle-end/37850
+ * libgcc2.c (__mulMODE3): Use explicit assignments to form the result.
+ (__divMODE3): Likewise.
+
+2009-03-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/39394
+ * gimplify.c (gimplify_type_sizes): Gimplify DECL_SIZE and
+ DECL_SIZE_UNIT of variable length FIELD_DECLs.
+
+2009-03-09 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * recog.c (verfiy_changes): Disallow renaming of hard regs in
+ inline asms for register asm ("") declarations.
+
+2009-03-09 Eric Botcazou <ebotcazou@adacore.com>
+
+ * fold-const.c (fold_unary): Fix comment.
+
+2009-03-07 Jan Hubicka <jh@suse.cz>
+
+ PR target/39361
+ * tree-inline.c (setup_one_parameter): Do replacement of const
+ argument by constant in SSA form.
+
+2009-03-07 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ PR middle-end/38028
+ * function.c (assign_parm_setup_stack): Use STACK_SLOT_ALIGNMENT to
+ determine alignment passed to assign_stack_local.
+ (assign_parms_unsplit_complex): Likewise.
+ * except.c (sjlj_build_landing_pads): Likewise.
+
+2009-03-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/39360
+ * tree-flow.h (add_referenced_var): Return bool instead of void.
+ * tree-dfa.c (add_referenced_var): Return result of
+ referenced_var_check_and_insert call.
+ * tree-inline.c (expand_call_inline): Call add_referenced_var instead
+ of referenced_var_check_and_insert.
+
+ PR debug/39372
+ * dwarf2out.c (add_abstract_origin_attribute): Return origin_die.
+ (gen_variable_die): Emit DW_AT_location on abstract static variable's
+ DIE, don't emit it if abstract origin already has it.
+ * tree-cfg.c (remove_useless_stmts_bind): GIMPLE_BINDs with any
+ BLOCK_NONLOCALIZED_VARS in its gimple_bind_block aren't useless.
+
+2009-03-06 Jan-Benedict Glaw <jbglaw@lug-owl.de>
+
+ * genpreds.c: (needs_variable): Fix parentheses at variable name
+ detection.
+ (write_tm_constrs_h): Indent generated code.
+
+2009-03-06 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ * doc/extend.texi (Function Attributes): Add documentation
+ for isr attributes.
+
+2009-03-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/39387
+ * dwarf2out.c (dwarf2out_imported_module_or_decl_1): For IMPORTED_DECL
+ take locus from its DECL_SOURCE_LOCATION instead of input_location.
+
+2009-03-05 Bernd Schmidt <bernd.schmidt@analog.com>
+
+ * config/bfin/bfin.c (bfin_discover_loop): When retrying fails, mark
+ the loop as bad.
+
+2009-03-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/39379
+ * tree-cfg.c (remove_useless_stmts_bind): Don't remove GIMPLE_BINDs
+ with blocks containing IMPORTED_DECLs in BLOCK_VARS.
+
+2009-03-05 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (R8_REG, R9_REG): New constants.
+ * config/i386/i386.h (CONDITIONAL_REGISTER_USAGE): Use named
+ constants instead of magic numbers.
+ (HARD_REGNO_CALLER_SAVE_MODE): Ditto.
+ (QI_REG_P): Ditto.
+ * config/i386/i386.c (x86_64_int_parameter_registers): Ditto.
+ (x86_64_ms_abi_int_parameter_registers): Ditto.
+ (x86_64_int_return_registers): Ditto.
+ (ix86_maybe_switch_abi): Ditto.
+ (ix86_expand_call): Ditto for clobbered_registers array.
+ (ix86_hard_regno_mode_ok): Ditto.
+ (x86_extended_QIreg_mentioned_p): Ditto.
+
2009-03-05 J"orn Rennecke <joern.rennecke@arc.com>
- PR tree-optimization/39349:
+ PR tree-optimization/39349
* cse.c (cse_insn): Fix loop to stop at VOIDmode.
* combine.c (gen_lowpart_for_combine): Use omode when generating
@@ -8,7 +591,7 @@
2009-03-04 J"orn Rennecke <joern.rennecke@arc.com>
- PR rtl-optimization/39235:
+ PR rtl-optimization/39235
* loop-iv.c (get_simple_loop_desc): Use XCNEW.
2009-03-04 Zdenek Dvorak <ook@ucw.cz>
@@ -110,10 +693,10 @@
* config/i386/i386.md (ST?_REG, MM?_REG): New constants.
(*call_1_rex64_ms_sysv): Use named constants instead of magic
- numbers to describe clobbbered registers.
+ numbers to describe clobbered registers.
(*call_value_0_rex64_ms_sysv): Ditto.
- * config/i386/mmx.md (emms): Ditto.
- (femms): Ditto.
+ * config/i386/mmx.md (mmx_emms): Ditto.
+ (mmx_femms): Ditto.
2009-03-02 Richard Sandiford <rdsandiford@googlemail.com>
@@ -180,8 +763,7 @@
2009-03-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* optc-gen.awk: No need to duplicate option flags twice.
- Reuse help texts for duplicate options which do not have
- any.
+ Reuse help texts for duplicate options which do not have any.
* gcc.c (display_help): Document --version.
@@ -321,7 +903,7 @@
PR tree-optimization/39259
* tree-inline.c (initialize_cfun): Remove asserts for calls_setjmp and
- alls_alloca function flags.
+ calls_alloca function flags.
(copy_bb): Set calls_setjmp and alls_alloca function flags if such
calls are detected.
@@ -714,7 +1296,7 @@
PR target/39149
* config/i386/i386.c (override_options): Correct warning
- messages for -malign-loops, -malign-jumps and -malign-functions.
+ messages for -malign-loops, -malign-jumps and -malign-functions.
2009-02-13 H.J. Lu <hongjiu.lu@intel.com>
diff --git a/gcc/ChangeLog-2008 b/gcc/ChangeLog-2008
index ec1badf2b44..54e7abd90b1 100644
--- a/gcc/ChangeLog-2008
+++ b/gcc/ChangeLog-2008
@@ -17771,12 +17771,6 @@
* config/i386/i386.c (override_options): Replace TARGET_64BIT_MS_ABI.
(X86_64_VARARGS_SIZE): Replace REGPARM_MAX and SSE_REGPARM_MAX by abi
specific defines.
- (X86_64_REGPARM_MAX): New.
- (X86_64_SSE_REGPARM_MAX): New.
- (X64_REGPARM_MAX): New.
- (X64_SSE_REGPARM_MAX): New.
- (X86_32_REGPARM_MAX): New.
- (X86_32_SSE_REGPARM_MAX): New.
(ix86_handle_cconv_attribute): Replace TARGET_64BIT_MS_ABI.
(ix86_function_regparm): Handle user calling abi.
(ix86_function_arg_regno_p): Replace TARGET_64BIT_MS_ABI
@@ -17816,6 +17810,14 @@
(OUTGOING_REG_PARM_STACK_SPACE): New.
(ix86_reg_parm_stack_space): New prototype.
(CUMULATIVE_ARGS): Add call_abi member.
+ (X86_64_REGPARM_MAX): New.
+ (X86_64_SSE_REGPARM_MAX): New.
+ (X64_REGPARM_MAX): New.
+ (X64_SSE_REGPARM_MAX): New.
+ (X86_32_REGPARM_MAX): New.
+ (X86_32_SSE_REGPARM_MAX): New.
+ (REGPARM_MAX): Updated.
+ (SSE_REGPARM_MAX): Updated.
(machine_function): Add call_abi member.
* config/i386/mingw32.h (EXTRA_OS_CPP_BUILTINS): Replace
TARGET_64BIT_MS_ABI by DEFAULT_ABI compare to MS_ABI.
diff --git a/gcc/ChangeLog.lto b/gcc/ChangeLog.lto
index b7697db67e1..e0293de5270 100644
--- a/gcc/ChangeLog.lto
+++ b/gcc/ChangeLog.lto
@@ -1,3 +1,10 @@
+2009-03-31 Rafael Avila de Espindola <espindola@google.com>
+
+ Mainline merge @145100.
+
+ * configure.ac (ACX_PKGVERSION): Update revision merge string.
+ * configure: Regenerate.
+
2009-03-26 Diego Novillo <dnovillo@google.com>
* tree-pretty-print.c (dump_generic_node): Merge handler
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 815a2bec93e..8b355c9c929 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20090305
+20090327
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index a509f5e1e32..c9c9e28f1ca 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -177,8 +177,8 @@ GCC_WARN_CFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn)
build/gengtype-lex.o-warn = -Wno-error
# SYSCALLS.c misses prototypes
SYSCALLS.c.X-warn = -Wno-strict-prototypes -Wno-error
-# dfp.c contains alias violations
-dfp.o-warn = -Wno-error
+# dfp.c contains many alias violations
+dfp.o-warn = -fno-strict-aliasing
# mips-tfile.c contains -Wcast-qual warnings.
mips-tfile.o-warn = -Wno-error
@@ -1915,7 +1915,7 @@ c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(TARGET_H) $(C_TREE_H) tree-iterator.h langhooks.h tree-mudflap.h \
intl.h opts.h $(REAL_H) $(CPPLIB_H) $(TREE_INLINE_H) $(HASHTAB_H) \
$(BUILTINS_DEF) $(CGRAPH_H) $(BASIC_BLOCK_H) $(TARGET_DEF_H) \
- $(GIMPLE_H)
+ $(GIMPLE_H) libfuncs.h
c-pretty-print.o : c-pretty-print.c $(C_PRETTY_PRINT_H) \
$(C_TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(REAL_H) \
@@ -4509,9 +4509,13 @@ site.exp: ./config.status Makefile
@echo "set CXXFLAGS \"\"" >> ./tmp0
@echo "set HOSTCC \"$(CC)\"" >> ./tmp0
@echo "set HOSTCFLAGS \"$(CFLAGS)\"" >> ./tmp0
+# When running the tests we set GCC_EXEC_PREFIX to the install tree so that
+# files that have already been installed there will be found. The -B option
+# overrides it, so use of GCC_EXEC_PREFIX will not result in using GCC files
+# from the install tree.
+ @echo "set TEST_GCC_EXEC_PREFIX \"$(libdir)/gcc/\"" >> ./tmp0
@echo "set TESTING_IN_BUILD_TREE 1" >> ./tmp0
@echo "set HAVE_LIBSTDCXX_V3 1" >> ./tmp0
- @echo "set GCC_EXEC_PREFIX \"$(libdir)/gcc/\"" >> ./tmp0
# If newlib has been configured, we need to pass -B to gcc so it can find
# newlib's crt0.o if it exists. This will cause a "path prefix not used"
# message if it doesn't, but the testsuite is supposed to ignore the message -
@@ -4596,7 +4600,6 @@ $(filter-out $(lang_checks_parallelized),$(lang_checks)): check-% : site.exp
if [ -f $${rootme}/../expect/expect ] ; then \
TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
export TCL_LIBRARY ; fi ; \
- GCC_EXEC_PREFIX="$(libdir)/gcc/" ; export GCC_EXEC_PREFIX ; \
$(RUNTEST) --tool $* $(RUNTESTFLAGS))
$(patsubst %,%-subtargets,$(filter-out $(lang_checks_parallelized),$(lang_checks))): check-%-subtargets:
@@ -4684,7 +4687,6 @@ check-parallel-% : site.exp
if [ -f $${rootme}/../expect/expect ] ; then \
TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
export TCL_LIBRARY ; fi ; \
- GCC_EXEC_PREFIX="$(libdir)/gcc/" ; export GCC_EXEC_PREFIX ; \
runtestflags= ; \
if [ -n "$(check_p_subno)" ] ; then \
runtestflags="$(check_p_subwork)"; \
@@ -4709,7 +4711,6 @@ check-consistency: testsuite/site.exp
if [ -f $${rootme}/../expect/expect ] ; then \
TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
export TCL_LIBRARY ; fi ; \
- GCC_EXEC_PREFIX="$(libdir)/gcc/" ; export GCC_EXEC_PREFIX ; \
$(RUNTEST) --tool consistency $(RUNTESTFLAGS)
# QMTest targets
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 5465899f298..8752b3b0c40 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-11 Olivier Hainque <hainque@adacore.com>
+
+ * gcc-interface/trans.c (gnat_to_gnu) <case N_Slice>: In range
+ checks processing, remove unintended TREE_TYPE walk on index type.
+
2009-03-01 Eric Botcazou <ebotcazou@adacore.com>
PR ada/39264
@@ -25,6 +30,7 @@
2009-02-25 Laurent GUERBY <laurent@guerby.net>
+ PR ada/39221
* a-teioed.adb (Expand): Fix Result overflow.
2009-02-25 Laurent GUERBY <laurent@guerby.net>
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 4f4f8a1a154..0384d370da2 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -3594,7 +3594,7 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_max_expr = protect_multiple_eval (gnu_max_expr);
/* Derive a good type to convert everything to. */
- gnu_expr_type = get_base_type (TREE_TYPE (gnu_index_type));
+ gnu_expr_type = get_base_type (gnu_index_type);
/* Test whether the minimum slice value is too small. */
gnu_expr_l = build_binary_op (LT_EXPR, integer_type_node,
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 4f00d8abbba..70c3ac0d84a 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -51,6 +51,7 @@ along with GCC; see the file COPYING3. If not see
#include "target-def.h"
#include "gimple.h"
#include "fixed-value.h"
+#include "libfuncs.h"
cpp_reader *parse_in; /* Declared in c-pragma.h. */
@@ -4376,10 +4377,28 @@ set_builtin_user_assembler_name (tree decl, const char *asmspec)
builtin = built_in_decls [DECL_FUNCTION_CODE (decl)];
set_user_assembler_name (builtin, asmspec);
- if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMCPY)
- init_block_move_fn (asmspec);
- else if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMSET)
- init_block_clear_fn (asmspec);
+ switch (DECL_FUNCTION_CODE (decl))
+ {
+ case BUILT_IN_MEMCPY:
+ init_block_move_fn (asmspec);
+ memcpy_libfunc = set_user_assembler_libfunc ("memcpy", asmspec);
+ break;
+ case BUILT_IN_MEMSET:
+ init_block_clear_fn (asmspec);
+ memset_libfunc = set_user_assembler_libfunc ("memset", asmspec);
+ break;
+ case BUILT_IN_MEMMOVE:
+ memmove_libfunc = set_user_assembler_libfunc ("memmove", asmspec);
+ break;
+ case BUILT_IN_MEMCMP:
+ memcmp_libfunc = set_user_assembler_libfunc ("memcmp", asmspec);
+ break;
+ case BUILT_IN_ABORT:
+ abort_libfunc = set_user_assembler_libfunc ("abort", asmspec);
+ break;
+ default:
+ break;
+ }
}
/* The number of named compound-literals generated thus far. */
diff --git a/gcc/c-omp.c b/gcc/c-omp.c
index 3be3729a32c..33f0a83e1a8 100644
--- a/gcc/c-omp.c
+++ b/gcc/c-omp.c
@@ -1,7 +1,7 @@
/* This file contains routines to construct GNU OpenMP constructs,
called from parsing in the C and C++ front ends.
- Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@redhat.com>,
Diego Novillo <dnovillo@redhat.com>.
@@ -280,7 +280,8 @@ c_finish_omp_for (location_t locus, tree declv, tree initv, tree condv,
if (TREE_CODE (cond) == LT_EXPR
|| TREE_CODE (cond) == LE_EXPR
|| TREE_CODE (cond) == GT_EXPR
- || TREE_CODE (cond) == GE_EXPR)
+ || TREE_CODE (cond) == GE_EXPR
+ || TREE_CODE (cond) == NE_EXPR)
{
tree op0 = TREE_OPERAND (cond, 0);
tree op1 = TREE_OPERAND (cond, 1);
@@ -324,6 +325,22 @@ c_finish_omp_for (location_t locus, tree declv, tree initv, tree condv,
TREE_OPERAND (cond, 0) = decl;
cond_ok = true;
}
+
+ if (TREE_CODE (cond) == NE_EXPR)
+ {
+ if (!INTEGRAL_TYPE_P (TREE_TYPE (decl)))
+ cond_ok = false;
+ else if (operand_equal_p (TREE_OPERAND (cond, 1),
+ TYPE_MIN_VALUE (TREE_TYPE (decl)),
+ 0))
+ TREE_SET_CODE (cond, GT_EXPR);
+ else if (operand_equal_p (TREE_OPERAND (cond, 1),
+ TYPE_MAX_VALUE (TREE_TYPE (decl)),
+ 0))
+ TREE_SET_CODE (cond, LT_EXPR);
+ else
+ cond_ok = false;
+ }
}
if (!cond_ok)
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index fdea8508616..e14354c1277 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -7652,9 +7652,23 @@ c_parser_omp_for_loop (c_parser *parser, tree clauses, tree *par_clauses)
if (c_parser_next_token_is_not (parser, CPP_SEMICOLON))
{
location_t cond_loc = c_parser_peek_token (parser)->location;
+ struct c_expr cond_expr = c_parser_binary_expression (parser, NULL);
- cond = c_parser_expression_conv (parser).value;
+ cond = cond_expr.value;
cond = c_objc_common_truthvalue_conversion (cond_loc, cond);
+ switch (cond_expr.original_code)
+ {
+ case GT_EXPR:
+ case GE_EXPR:
+ case LT_EXPR:
+ case LE_EXPR:
+ break;
+ default:
+ /* Can't be cond = error_mark_node, because we want to preserve
+ the location until c_finish_omp_for. */
+ cond = build1 (NOP_EXPR, boolean_type_node, error_mark_node);
+ break;
+ }
protected_set_expr_location (cond, cond_loc);
}
c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>");
diff --git a/gcc/c.opt b/gcc/c.opt
index 8dd934a6031..bf57981e370 100644
--- a/gcc/c.opt
+++ b/gcc/c.opt
@@ -185,7 +185,7 @@ Warn when a declaration is found after a statement
Wdeprecated
C C++ ObjC ObjC++ Var(warn_deprecated) Init(1) Warning
-Warn about deprecated compiler features
+Warn if a deprecated compiler feature, class, method, or field is used
Wdiv-by-zero
C ObjC C++ ObjC++ Var(warn_div_by_zero) Init(1) Warning
@@ -446,7 +446,7 @@ Deprecated. This switch has no effect
Wsystem-headers
C ObjC C++ ObjC++ Warning
-Do not suppress warnings from system headers
+; Documented in common.opt
Wtraditional
C ObjC Var(warn_traditional) Warning
@@ -695,7 +695,7 @@ Enable Objective-C setjmp exception handling runtime
fopenmp
C ObjC C++ ObjC++ Var(flag_openmp)
-Enable OpenMP
+Enable OpenMP (implies -frecursive in Fortran)
foperator-names
C++ ObjC++
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index c73bba7d9a9..4bfdc5fed74 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -488,8 +488,7 @@ get_decl_align_unit (tree decl)
{
unsigned int align;
- align = DECL_ALIGN (decl);
- align = LOCAL_ALIGNMENT (TREE_TYPE (decl), align);
+ align = LOCAL_DECL_ALIGNMENT (decl);
if (align > MAX_SUPPORTED_STACK_ALIGNMENT)
align = MAX_SUPPORTED_STACK_ALIGNMENT;
diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h
index 8f5ba8dce49..0af5be02d76 100644
--- a/gcc/cfgloop.h
+++ b/gcc/cfgloop.h
@@ -1,6 +1,6 @@
/* Natural loop functions
Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GCC.
@@ -105,6 +105,9 @@ struct loop GTY ((chain_next ("%h.next")))
/* Index into loops array. */
int num;
+ /* Number of loop insns. */
+ unsigned ninsns;
+
/* Basic block of loop header. */
struct basic_block_def *header;
@@ -114,9 +117,6 @@ struct loop GTY ((chain_next ("%h.next")))
/* For loop unrolling/peeling decision. */
struct lpt_decision lpt_decision;
- /* Number of loop insns. */
- unsigned ninsns;
-
/* Average number of executed insns per iteration. */
unsigned av_ninsns;
@@ -142,19 +142,20 @@ struct loop GTY ((chain_next ("%h.next")))
information in this field. */
tree nb_iterations;
- /* An integer estimation of the number of iterations. Estimate_state
- describes what is the state of the estimation. */
- enum loop_estimation estimate_state;
-
/* An integer guaranteed to bound the number of iterations of the loop
from above. */
- bool any_upper_bound;
double_int nb_iterations_upper_bound;
/* An integer giving the expected number of iterations of the loop. */
- bool any_estimate;
double_int nb_iterations_estimate;
+ bool any_upper_bound;
+ bool any_estimate;
+
+ /* An integer estimation of the number of iterations. Estimate_state
+ describes what is the state of the estimation. */
+ enum loop_estimation estimate_state;
+
/* Upper bound on number of iterations of a loop. */
struct nb_iter_bound *bounds;
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 717eb5c3f75..ed58e723d4a 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -183,6 +183,10 @@ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous")))
/* Ordering of all cgraph nodes. */
int order;
+ /* unique id for profiling. pid is not suitable because of different
+ number of cfg nodes with -fprofile-generate and -fprofile-use */
+ int pid;
+
/* Set when function must be output - it is externally visible
or its address is taken. */
unsigned needed : 1;
@@ -206,10 +210,6 @@ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous")))
into clone before compiling so the function in original form can be
inlined later. This pointer points to the clone. */
tree inline_decl;
-
- /* unique id for profiling. pid is not suitable because of different
- number of cfg nodes with -fprofile-generate and -fprofile-use */
- int pid;
};
typedef struct cgraph_node *cgraph_node_ptr;
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 99741c30d9a..2645e5ab2b3 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -146,8 +146,9 @@
# system normally uses GNU as.
#
# need_64bit_hwint Set to yes if HOST_WIDE_INT must be 64 bits wide
-# for this target. This is true iff this target
-# supports "long" or "wchar_t" wider than 32 bits.
+# for this target. This is true if this target
+# supports "long" or "wchar_t" wider than 32 bits,
+# or BITS_PER_WORD is wider than 32 bits.
# The setting made here must match the one made in
# other locations such as libcpp/configure.ac
#
diff --git a/gcc/config.host b/gcc/config.host
index 0cd57ed87f9..b06d1648c73 100644
--- a/gcc/config.host
+++ b/gcc/config.host
@@ -94,6 +94,14 @@ case ${host} in
esac
case ${host} in
+ alpha*-*-linux*)
+ case ${target} in
+ alpha*-*-linux*)
+ host_extra_gcc_objs="driver-alpha.o"
+ host_xmake_file="${host_xmake_file} alpha/x-alpha"
+ ;;
+ esac
+ ;;
i[34567]86-*-* \
| x86_64-*-* )
case ${target} in
@@ -112,9 +120,6 @@ case ${host} in
;;
esac
;;
-esac
-
-case ${host} in
rs6000-*-* \
| powerpc*-*-* )
case ${target} in
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 0675916a230..5ffb8f967ff 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -7135,7 +7135,7 @@ alpha_sa_mask (unsigned long *imaskP, unsigned long *fmaskP)
/* When outputting a thunk, we don't have valid register life info,
but assemble_start_function wants to output .frame and .mask
directives. */
- if (crtl->is_thunk)
+ if (cfun->is_thunk)
{
*imaskP = 0;
*fmaskP = 0;
@@ -7365,7 +7365,7 @@ alpha_does_function_need_gp (void)
return 1;
/* The code emitted by alpha_output_mi_thunk_osf uses the gp. */
- if (crtl->is_thunk)
+ if (cfun->is_thunk)
return 1;
/* The nonlocal receiver pattern assumes that the gp is valid for
@@ -7888,7 +7888,7 @@ alpha_start_function (FILE *file, const char *fnname,
Otherwise, do it here. */
if (TARGET_ABI_OSF
&& ! alpha_function_needs_gp
- && ! crtl->is_thunk)
+ && ! cfun->is_thunk)
{
putc ('$', file);
assemble_name (file, fnname);
@@ -7999,7 +7999,7 @@ alpha_output_function_end_prologue (FILE *file)
fputs ("\t.prologue 0\n", file);
else if (!flag_inhibit_size_directive)
fprintf (file, "\t.prologue %d\n",
- alpha_function_needs_gp || crtl->is_thunk);
+ alpha_function_needs_gp || cfun->is_thunk);
}
/* Write function epilogue. */
@@ -8283,7 +8283,7 @@ alpha_end_function (FILE *file, const char *fnname, tree decl ATTRIBUTE_UNUSED)
output_asm_insn (get_insn_template (CODE_FOR_nop, NULL), NULL);
#if TARGET_ABI_OSF
- if (crtl->is_thunk)
+ if (cfun->is_thunk)
free_after_compilation (cfun);
#endif
@@ -8326,7 +8326,7 @@ alpha_output_mi_thunk_osf (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
HOST_WIDE_INT hi, lo;
rtx this_rtx, insn, funexp;
- gcc_assert (crtl->is_thunk);
+ gcc_assert (cfun->is_thunk);
/* We always require a valid GP. */
emit_insn (gen_prologue_ldgp ());
diff --git a/gcc/config/alpha/driver-alpha.c b/gcc/config/alpha/driver-alpha.c
new file mode 100644
index 00000000000..d787886d172
--- /dev/null
+++ b/gcc/config/alpha/driver-alpha.c
@@ -0,0 +1,100 @@
+/* Subroutines for the gcc driver.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Arthur Loiret <aloiret@debian.org>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+
+/* This will be called by the spec parser in gcc.c when it sees
+ a %:local_cpu_detect(args) construct. Currently it will be called
+ with either "cpu" or "tune" as argument depending on if -mcpu=native
+ or -mtune=native is to be substituted.
+
+ It returns a string containing new command line parameters to be
+ put at the place of the above two options, depending on what CPU
+ this is executed. E.g. "-mcpu=ev6" on an Alpha 21264 for
+ -mcpu=native. If the routine can't detect a known processor,
+ the -mcpu or -mtune option is discarded.
+
+ ARGC and ARGV are set depending on the actual arguments given
+ in the spec. */
+const char *
+host_detect_local_cpu (int argc, const char **argv)
+{
+ const char *cpu = NULL;
+ char buf[128];
+ FILE *f;
+
+ static const struct cpu_names {
+ const char *const name;
+ const char *const cpu;
+ } cpu_names[] = {
+ { "EV79", "ev67" },
+ { "EV7", "ev67" },
+ { "EV69", "ev67" },
+ { "EV68CX", "ev67" },
+ { "EV68CB", "ev67" },
+ { "EV68AL", "ev67" },
+ { "EV67", "ev67" },
+ { "EV6", "ev6" },
+ { "PCA57", "pca56" },
+ { "PCA56", "pca56" },
+ { "EV56", "ev56" },
+ { "EV5", "ev5" },
+ { "LCA45", "ev45" },
+ { "EV45", "ev45" },
+ { "LCA4", "ev4" },
+ { "EV4", "ev4" },
+/* { "EV3", "ev3" }, */
+ { 0, 0 }
+ };
+
+ int i;
+
+ if (argc < 1)
+ return NULL;
+
+ if (strcmp (argv[0], "cpu") && strcmp (argv[0], "tune"))
+ return NULL;
+
+ f = fopen ("/proc/cpuinfo", "r");
+ if (f == NULL)
+ return NULL;
+
+ while (fgets (buf, sizeof (buf), f) != NULL)
+ if (strncmp (buf, "cpu model", sizeof ("cpu model") - 1) == 0)
+ {
+ for (i = 0; cpu_names [i].name; i++)
+ if (strstr (buf, cpu_names [i].name) != NULL)
+ {
+ cpu = cpu_names [i].cpu;
+ break;
+ }
+ break;
+ }
+
+ fclose (f);
+
+ if (cpu == NULL)
+ return NULL;
+
+ return concat ("-m", argv[0], "=", cpu, NULL);
+}
diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h
index 94876f646de..0a32479d5d7 100644
--- a/gcc/config/alpha/linux.h
+++ b/gcc/config/alpha/linux.h
@@ -85,3 +85,19 @@ along with GCC; see the file COPYING3. If not see
/* Define if long doubles should be mangled as 'g'. */
#define TARGET_ALTERNATE_LONG_DOUBLE_MANGLING
+
+/* -mcpu=native handling only makes sense with compiler running on
+ an Alpha chip. */
+#if defined(__alpha__) || defined(__alpha)
+extern const char *host_detect_local_cpu (int argc, const char **argv);
+# define EXTRA_SPEC_FUNCTIONS \
+ { "local_cpu_detect", host_detect_local_cpu },
+
+# define MCPU_MTUNE_NATIVE_SPECS \
+ " %{mcpu=native:%<mcpu=native %:local_cpu_detect(cpu)}" \
+ " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}"
+#else
+# define MCPU_MTUNE_NATIVE_SPECS ""
+#endif
+
+#define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
diff --git a/gcc/config/alpha/x-alpha b/gcc/config/alpha/x-alpha
new file mode 100644
index 00000000000..27b5f466903
--- /dev/null
+++ b/gcc/config/alpha/x-alpha
@@ -0,0 +1,3 @@
+driver-alpha.o: $(srcdir)/config/alpha/driver-alpha.c \
+ $(CONFIG_H) $(SYSTEM_H)
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 7788793b300..f5ec9e7166e 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -2448,7 +2448,7 @@ extern int making_const_table;
{ \
if (is_called_in_ARM_mode (DECL) \
|| (TARGET_THUMB1 && !TARGET_THUMB1_ONLY \
- && crtl->is_thunk)) \
+ && cfun->is_thunk)) \
fprintf (STREAM, "\t.code 32\n") ; \
else if (TARGET_THUMB1) \
fprintf (STREAM, "\t.code\t16\n\t.thumb_func\n") ; \
diff --git a/gcc/config/arm/rtems-elf.h b/gcc/config/arm/rtems-elf.h
index ee8c118112a..dade74b1555 100644
--- a/gcc/config/arm/rtems-elf.h
+++ b/gcc/config/arm/rtems-elf.h
@@ -43,4 +43,3 @@
* with how this used to be defined.
*/
#undef LINK_GCC_C_SEQUENCE_SPEC
-#define LINK_GCC_C_SEQUENCE_SPEC "%G %L"
diff --git a/gcc/config/avr/avr-protos.h b/gcc/config/avr/avr-protos.h
index bcf81d9afc5..2df4a16d1cf 100644
--- a/gcc/config/avr/avr-protos.h
+++ b/gcc/config/avr/avr-protos.h
@@ -1,6 +1,6 @@
/* Prototypes for exported functions defined in avr.c
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Denis Chertykov (denisc@overta.ru)
@@ -32,6 +32,7 @@ extern enum reg_class avr_regno_reg_class (int r);
extern enum reg_class avr_reg_class_from_letter (int c);
extern int frame_pointer_required_p (void);
extern void asm_globalize_label (FILE *file, const char *name);
+extern void avr_asm_declare_function_name (FILE *, const char *, tree);
extern void order_regs_for_local_alloc (void);
extern int initial_elimination_offset (int from, int to);
extern int avr_simple_epilogue (void);
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index f8ef6d58fa2..08aace66dda 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -4595,6 +4595,39 @@ avr_assemble_integer (rtx x, unsigned int size, int aligned_p)
return default_assemble_integer (x, size, aligned_p);
}
+/* Worker function for ASM_DECLARE_FUNCTION_NAME. */
+
+void
+avr_asm_declare_function_name (FILE *file, const char *name, tree decl)
+{
+
+ /* If the function has the 'signal' or 'interrupt' attribute, test to
+ make sure that the name of the function is "__vector_NN" so as to
+ catch when the user misspells the interrupt vector name. */
+
+ if (cfun->machine->is_interrupt)
+ {
+ if (strncmp (name, "__vector", strlen ("__vector")) != 0)
+ {
+ warning_at (DECL_SOURCE_LOCATION (decl), 0,
+ "%qs appears to be a misspelled interrupt handler",
+ name);
+ }
+ }
+ else if (cfun->machine->is_signal)
+ {
+ if (strncmp (name, "__vector", strlen ("__vector")) != 0)
+ {
+ warning_at (DECL_SOURCE_LOCATION (decl), 0,
+ "%qs appears to be a misspelled signal handler",
+ name);
+ }
+ }
+
+ ASM_OUTPUT_TYPE_DIRECTIVE (file, name, "function");
+ ASM_OUTPUT_LABEL (file, name);
+}
+
/* The routine used to output NUL terminated strings. We use a special
version of this for most svr4 targets because doing so makes the
generated assembly code more compact (and thus faster to assemble)
@@ -4779,32 +4812,6 @@ avr_handle_fndecl_attribute (tree *node, tree name,
IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
- else
- {
- const char *func_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (*node));
- const char *attr = IDENTIFIER_POINTER (name);
-
- /* If the function has the 'signal' or 'interrupt' attribute, test to
- make sure that the name of the function is "__vector_NN" so as to
- catch when the user misspells the interrupt vector name. */
-
- if (strncmp (attr, "interrupt", strlen ("interrupt")) == 0)
- {
- if (strncmp (func_name, "__vector", strlen ("__vector")) != 0)
- {
- warning (0, "%qs appears to be a misspelled interrupt handler",
- func_name);
- }
- }
- else if (strncmp (attr, "signal", strlen ("signal")) == 0)
- {
- if (strncmp (func_name, "__vector", strlen ("__vector")) != 0)
- {
- warning (0, "%qs appears to be a misspelled signal handler",
- func_name);
- }
- }
- }
return NULL_TREE;
}
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index 8a4d98ab365..c41ac0b930d 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -590,10 +590,7 @@ do { \
specific tm.h file (depending upon the particulars of your assembler). */
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
-do { \
- ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
- ASM_OUTPUT_LABEL (FILE, NAME); \
-} while (0)
+avr_asm_declare_function_name ((FILE), (NAME), (DECL))
#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
do { \
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index ec5dd57dde7..d1c964d02ea 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -3854,9 +3854,17 @@ bfin_optimize_loop (loop_info loop)
/* Make sure the predecessor is before the loop start label, as required by
the LSETUP instruction. */
length = 0;
- for (insn = BB_END (loop->incoming_src);
- insn && insn != loop->start_label;
- insn = NEXT_INSN (insn))
+ insn = BB_END (loop->incoming_src);
+ /* If we have to insert the LSETUP before a jump, count that jump in the
+ length. */
+ if (VEC_length (edge, loop->incoming) > 1
+ || !(VEC_last (edge, loop->incoming)->flags & EDGE_FALLTHRU))
+ {
+ gcc_assert (JUMP_P (insn));
+ insn = PREV_INSN (insn);
+ }
+
+ for (; insn && insn != loop->start_label; insn = NEXT_INSN (insn))
length += length_for_loop (insn);
if (!insn)
@@ -4362,6 +4370,12 @@ bfin_discover_loop (loop_info loop, basic_block tail_bb, rtx tail_insn)
break;
}
}
+ if (!retry)
+ {
+ if (dump_file)
+ fprintf (dump_file, ";; No forwarder blocks found\n");
+ loop->bad = 1;
+ }
}
}
}
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index eae8b484904..49822598f45 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -851,8 +851,9 @@ enum reg_class
/* Node: Elimination */
/* Really only needed if the stack frame has variable length (alloca
- or variable sized local arguments (GNU C extension). */
-#define FRAME_POINTER_REQUIRED 0
+ or variable sized local arguments (GNU C extension). See PR39499 and
+ PR38609 for the reason this isn't just 0. */
+#define FRAME_POINTER_REQUIRED (!current_function_sp_is_unchanging)
#define ELIMINABLE_REGS \
{{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
diff --git a/gcc/config/cris/libgcc.ver b/gcc/config/cris/libgcc.ver
new file mode 100644
index 00000000000..e35de83100f
--- /dev/null
+++ b/gcc/config/cris/libgcc.ver
@@ -0,0 +1,7 @@
+GCC_4.3 {
+ __Mul
+ __Div
+ __Udiv
+ __Mod
+ __Umod
+}
diff --git a/gcc/config/cris/linux.h b/gcc/config/cris/linux.h
index 247e827d677..38f0a7ef8c9 100644
--- a/gcc/config/cris/linux.h
+++ b/gcc/config/cris/linux.h
@@ -110,7 +110,8 @@ along with GCC; see the file COPYING3. If not see
#undef CRIS_LINK_SUBTARGET_SPEC
#define CRIS_LINK_SUBTARGET_SPEC \
"-mcrislinux\
- -rpath-link include/asm/../..%s\
+ %{B*:-rpath-link %*}\
+ %{!nostdlib:-rpath-link ../sys-include/asm/../../lib%s}\
%{shared} %{static}\
%{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
%{!shared:%{!static:\
diff --git a/gcc/config/cris/t-linux b/gcc/config/cris/t-linux
index e10d083f565..96e861a4283 100644
--- a/gcc/config/cris/t-linux
+++ b/gcc/config/cris/t-linux
@@ -1,5 +1,6 @@
TARGET_LIBGCC2_CFLAGS += -fPIC
CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS)
+SHLIB_MAPFILES += $(srcdir)/config/cris/libgcc.ver
# We *know* we have a limits.h in the glibc library, with extra
# definitions needed for e.g. libgfortran.
diff --git a/gcc/config/fr30/fr30.opt b/gcc/config/fr30/fr30.opt
index ac8567da1f3..da6148a6d2b 100644
--- a/gcc/config/fr30/fr30.opt
+++ b/gcc/config/fr30/fr30.opt
@@ -1,6 +1,6 @@
; Options for the FR30 port of the compiler.
-; Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+; Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
@@ -23,4 +23,5 @@ Target Report Mask(SMALL_MODEL)
Assume small address space
mno-lsim
-Target RejectNegative Undocumented
+Target RejectNegative
+Assume that run-time support has been provided, so omit -lsim from the linker command line
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index f76fa565eab..6cb7d1dab9a 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1533,24 +1533,8 @@ int const dbx_register_map[FIRST_PSEUDO_REGISTER] =
-1, -1, -1, -1, -1, -1, -1, -1, /* extended SSE registers */
};
-static int const x86_64_int_parameter_registers[6] =
-{
- 5 /*RDI*/, 4 /*RSI*/, 1 /*RDX*/, 2 /*RCX*/,
- FIRST_REX_INT_REG /*R8 */, FIRST_REX_INT_REG + 1 /*R9 */
-};
-
-static int const x86_64_ms_abi_int_parameter_registers[4] =
-{
- 2 /*RCX*/, 1 /*RDX*/,
- FIRST_REX_INT_REG /*R8 */, FIRST_REX_INT_REG + 1 /*R9 */
-};
-
-static int const x86_64_int_return_registers[4] =
-{
- 0 /*RAX*/, 1 /*RDX*/, 5 /*RDI*/, 4 /*RSI*/
-};
-
/* The "default" register map used in 64bit mode. */
+
int const dbx64_register_map[FIRST_PSEUDO_REGISTER] =
{
0, 1, 2, 3, 4, 5, 6, 7, /* general regs */
@@ -1634,6 +1618,23 @@ rtx ix86_compare_op0 = NULL_RTX;
rtx ix86_compare_op1 = NULL_RTX;
rtx ix86_compare_emitted = NULL_RTX;
+/* Define parameter passing and return registers. */
+
+static int const x86_64_int_parameter_registers[6] =
+{
+ DI_REG, SI_REG, DX_REG, CX_REG, R8_REG, R9_REG
+};
+
+static int const x86_64_ms_abi_int_parameter_registers[4] =
+{
+ CX_REG, DX_REG, R8_REG, R9_REG
+};
+
+static int const x86_64_int_return_registers[4] =
+{
+ AX_REG, DX_REG, DI_REG, SI_REG
+};
+
/* Define the structure for the machine field in struct function. */
struct stack_local_entry GTY(())
@@ -4272,17 +4273,15 @@ static int
ix86_function_regparm (const_tree type, const_tree decl)
{
tree attr;
- int regparm = ix86_regparm;
+ int regparm;
static bool error_issued;
if (TARGET_64BIT)
- {
- if (ix86_function_type_abi (type) == DEFAULT_ABI)
- return regparm;
- return DEFAULT_ABI != SYSV_ABI ? X86_64_REGPARM_MAX : X64_REGPARM_MAX;
- }
+ return (ix86_function_type_abi (type) == SYSV_ABI
+ ? X86_64_REGPARM_MAX : X64_REGPARM_MAX);
+ regparm = ix86_regparm;
attr = lookup_attribute ("regparm", TYPE_ATTRIBUTES (type));
if (attr)
{
@@ -4310,7 +4309,9 @@ ix86_function_regparm (const_tree type, const_tree decl)
return 2;
/* Use register calling convention for local functions when possible. */
- if (decl && TREE_CODE (decl) == FUNCTION_DECL
+ if (decl
+ && TREE_CODE (decl) == FUNCTION_DECL
+ && optimize
&& !profile_flag)
{
/* FIXME: remove this CONST_CAST when cgraph.[ch] is constified. */
@@ -4395,7 +4396,7 @@ ix86_function_sseregparm (const_tree type, const_tree decl, bool warn)
/* For local functions, pass up to SSE_REGPARM_MAX SFmode
(and DFmode for SSE2) arguments in SSE registers. */
- if (decl && TARGET_SSE_MATH && !profile_flag)
+ if (decl && TARGET_SSE_MATH && optimize && !profile_flag)
{
/* FIXME: remove this CONST_CAST when cgraph.[ch] is constified. */
struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
@@ -4617,7 +4618,7 @@ static void
ix86_maybe_switch_abi (void)
{
if (TARGET_64BIT &&
- call_used_regs[4 /*RSI*/] == (cfun->machine->call_abi == MS_ABI))
+ call_used_regs[SI_REG] == (cfun->machine->call_abi == MS_ABI))
reinit_regs ();
}
@@ -12632,10 +12633,9 @@ ix86_expand_push (enum machine_mode mode, rtx x)
tmp = gen_rtx_MEM (mode, stack_pointer_rtx);
/* When we push an operand onto stack, it has to be aligned at least
- at the function argument boundary. */
- set_mem_align (tmp,
- ix86_function_arg_boundary (mode, NULL_TREE));
-
+ at the function argument boundary. However since we don't have
+ the argument type, we can't determine the actual argument
+ boundary. */
emit_move_insn (tmp, x);
}
@@ -18617,12 +18617,7 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
rtx pop, int sibcall)
{
rtx use = NULL, call;
- enum calling_abi function_call_abi;
- if (callarg2 && INTVAL (callarg2) == -2)
- function_call_abi = MS_ABI;
- else
- function_call_abi = SYSV_ABI;
if (pop == const0_rtx)
pop = NULL;
gcc_assert (!TARGET_64BIT || !pop);
@@ -18678,14 +18673,19 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
pop = gen_rtx_PLUS (Pmode, stack_pointer_rtx, pop);
pop = gen_rtx_SET (VOIDmode, stack_pointer_rtx, pop);
call = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, call, pop));
- gcc_assert (ix86_cfun_abi () != MS_ABI || function_call_abi != SYSV_ABI);
}
- /* We need to represent that SI and DI registers are clobbered
- by SYSV calls. */
- if (ix86_cfun_abi () == MS_ABI && function_call_abi == SYSV_ABI)
- {
- static int clobbered_registers[] = {27, 28, 45, 46, 47, 48, 49, 50, 51,
- 52, SI_REG, DI_REG};
+ if (TARGET_64BIT
+ && ix86_cfun_abi () == MS_ABI
+ && (!callarg2 || INTVAL (callarg2) != -2))
+ {
+ /* We need to represent that SI and DI registers are clobbered
+ by SYSV calls. */
+ static int clobbered_registers[] = {
+ XMM6_REG, XMM7_REG, XMM8_REG,
+ XMM9_REG, XMM10_REG, XMM11_REG,
+ XMM12_REG, XMM13_REG, XMM14_REG,
+ XMM15_REG, SI_REG, DI_REG
+ };
unsigned int i;
rtx vec[ARRAY_SIZE (clobbered_registers) + 2];
rtx unspec = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, const0_rtx),
@@ -19342,15 +19342,39 @@ ix86_data_alignment (tree type, int align)
return align;
}
-/* Compute the alignment for a local variable or a stack slot. TYPE is
- the data type, MODE is the widest mode available and ALIGN is the
- alignment that the object would ordinarily have. The value of this
- macro is used instead of that alignment to align the object. */
+/* Compute the alignment for a local variable or a stack slot. EXP is
+ the data type or decl itself, MODE is the widest mode available and
+ ALIGN is the alignment that the object would ordinarily have. The
+ value of this macro is used instead of that alignment to align the
+ object. */
unsigned int
-ix86_local_alignment (tree type, enum machine_mode mode,
+ix86_local_alignment (tree exp, enum machine_mode mode,
unsigned int align)
{
+ tree type, decl;
+
+ if (exp && DECL_P (exp))
+ {
+ type = TREE_TYPE (exp);
+ decl = exp;
+ }
+ else
+ {
+ type = exp;
+ decl = NULL;
+ }
+
+ /* Don't do dynamic stack realignment for long long objects with
+ -mpreferred-stack-boundary=2. */
+ if (!TARGET_64BIT
+ && align == 64
+ && ix86_preferred_stack_boundary < 64
+ && (mode == DImode || (type && TYPE_MODE (type) == DImode))
+ && (!type || !TYPE_USER_ALIGN (type))
+ && (!decl || !DECL_USER_ALIGN (decl)))
+ align = 32;
+
/* If TYPE is NULL, we are allocating a stack slot for caller-save
register in MODE. We will return the largest alignment of XF
and DF. */
@@ -25757,7 +25781,7 @@ ix86_hard_regno_mode_ok (int regno, enum machine_mode mode)
{
/* Take care for QImode values - they can be in non-QI regs,
but then they do cause partial register stalls. */
- if (regno < 4 || TARGET_64BIT)
+ if (regno <= BX_REG || TARGET_64BIT)
return 1;
if (!TARGET_PARTIAL_REG_STALL)
return 1;
@@ -26869,7 +26893,7 @@ x86_extended_QIreg_mentioned_p (rtx insn)
extract_insn_cached (insn);
for (i = 0; i < recog_data.n_operands; i++)
if (REG_P (recog_data.operand[i])
- && REGNO (recog_data.operand[i]) >= 4)
+ && REGNO (recog_data.operand[i]) > BX_REG)
return true;
return false;
}
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 5bdf379bca0..8035e84a2f8 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -791,6 +791,19 @@ enum target_cpu_default
#define STACK_SLOT_ALIGNMENT(TYPE, MODE, ALIGN) \
ix86_local_alignment ((TYPE), (MODE), (ALIGN))
+/* If defined, a C expression to compute the alignment for a local
+ variable DECL.
+
+ If this macro is not defined, then
+ LOCAL_ALIGNMENT (TREE_TYPE (DECL), DECL_ALIGN (DECL)) will be used.
+
+ One use of this macro is to increase alignment of medium-size
+ data to make it all fit in fewer cache lines. */
+
+#define LOCAL_DECL_ALIGNMENT(DECL) \
+ ix86_local_alignment ((DECL), VOIDmode, DECL_ALIGN (DECL))
+
+
/* If defined, a C expression that gives the alignment boundary, in
bits, of an argument with the specified mode and type. If it is
not defined, `PARM_BOUNDARY' is used for all arguments. */
@@ -938,10 +951,10 @@ do { \
&& ((cfun && cfun->machine->call_abi == MS_ABI) \
|| (!cfun && DEFAULT_ABI == MS_ABI))) \
{ \
- call_used_regs[4 /*RSI*/] = 0; \
- call_used_regs[5 /*RDI*/] = 0; \
- call_used_regs[27 /*XMM6*/] = 0; \
- call_used_regs[28 /*XMM7*/] = 0; \
+ call_used_regs[SI_REG] = 0; \
+ call_used_regs[DI_REG] = 0; \
+ call_used_regs[XMM6_REG] = 0; \
+ call_used_regs[XMM7_REG] = 0; \
for (i = FIRST_REX_SSE_REG; i <= LAST_REX_SSE_REG; i++) \
call_used_regs[i] = 0; \
} \
@@ -1073,7 +1086,7 @@ do { \
: (MODE) == VOIDmode && (NREGS) != 1 ? VOIDmode \
: (MODE) == VOIDmode ? choose_hard_reg_mode ((REGNO), (NREGS), false) \
: (MODE) == HImode && !TARGET_PARTIAL_REG_STALL ? SImode \
- : (MODE) == QImode && (REGNO) >= 4 && !TARGET_64BIT ? SImode \
+ : (MODE) == QImode && (REGNO) > BX_REG && !TARGET_64BIT ? SImode \
: (MODE))
/* Specify the registers used for certain standard purposes.
@@ -1310,7 +1323,7 @@ enum reg_class
#define SMALL_REGISTER_CLASSES 1
-#define QI_REG_P(X) (REG_P (X) && REGNO (X) < 4)
+#define QI_REG_P(X) (REG_P (X) && REGNO (X) <= BX_REG)
#define GENERAL_REGNO_P(N) \
((N) <= STACK_POINTER_REGNUM || REX_INT_REGNO_P (N))
@@ -1508,7 +1521,8 @@ enum reg_class
prologue and apilogue. This is not possible without
ACCUMULATE_OUTGOING_ARGS. */
-#define ACCUMULATE_OUTGOING_ARGS (TARGET_ACCUMULATE_OUTGOING_ARGS || ix86_cfun_abi () == MS_ABI)
+#define ACCUMULATE_OUTGOING_ARGS \
+ (TARGET_ACCUMULATE_OUTGOING_ARGS || ix86_cfun_abi () == MS_ABI)
/* If defined, a C expression whose value is nonzero when we want to use PUSH
instructions to pass outgoing arguments. */
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 9c6ae1c12a6..39e62fbe6bd 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -291,6 +291,8 @@
(MM5_REG 34)
(MM6_REG 35)
(MM7_REG 36)
+ (R8_REG 37)
+ (R9_REG 38)
(R10_REG 39)
(R11_REG 40)
(R13_REG 42)
@@ -4456,35 +4458,33 @@
(set_attr "mode" "SF")])
(define_insn "*truncdfsf_mixed"
- [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?fx*r,Y2")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=m,Y2 ,?f,?x,?*r")
(float_truncate:SF
- (match_operand:DF 1 "nonimmediate_operand" "f ,f ,Y2m")))
- (clobber (match_operand:SF 2 "memory_operand" "=X,m ,X"))]
+ (match_operand:DF 1 "nonimmediate_operand" "f ,Y2m,f ,f ,f")))
+ (clobber (match_operand:SF 2 "memory_operand" "=X,X ,m ,m ,m"))]
"TARGET_MIX_SSE_I387"
{
switch (which_alternative)
{
case 0:
return output_387_reg_move (insn, operands);
-
case 1:
- return "#";
- case 2:
return "%vcvtsd2ss\t{%1, %d0|%d0, %1}";
+
default:
- gcc_unreachable ();
+ return "#";
}
}
- [(set_attr "type" "fmov,multi,ssecvt")
- (set_attr "unit" "*,i387,*")
- (set_attr "prefix" "orig,orig,maybe_vex")
+ [(set_attr "type" "fmov,ssecvt,multi,multi,multi")
+ (set_attr "unit" "*,*,i387,i387,i387")
+ (set_attr "prefix" "orig,maybe_vex,orig,orig,orig")
(set_attr "mode" "SF")])
(define_insn "*truncdfsf_i387"
- [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?fx*r")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?f,?x,?*r")
(float_truncate:SF
- (match_operand:DF 1 "nonimmediate_operand" "f,f")))
- (clobber (match_operand:SF 2 "memory_operand" "=X,m"))]
+ (match_operand:DF 1 "nonimmediate_operand" "f ,f ,f ,f")))
+ (clobber (match_operand:SF 2 "memory_operand" "=X,m ,m ,m"))]
"TARGET_80387"
{
switch (which_alternative)
@@ -4492,14 +4492,12 @@
case 0:
return output_387_reg_move (insn, operands);
- case 1:
- return "#";
default:
- gcc_unreachable ();
+ return "#";
}
}
- [(set_attr "type" "fmov,multi")
- (set_attr "unit" "*,i387")
+ [(set_attr "type" "fmov,multi,multi,multi")
+ (set_attr "unit" "*,i387,i387,i387")
(set_attr "mode" "SF")])
(define_insn "*truncdfsf2_i387_1"
@@ -4550,31 +4548,31 @@
})
(define_insn "*truncxfsf2_mixed"
- [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?fx*r")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?f,?x,?*r")
(float_truncate:SF
- (match_operand:XF 1 "register_operand" "f,f")))
- (clobber (match_operand:SF 2 "memory_operand" "=X,m"))]
+ (match_operand:XF 1 "register_operand" "f ,f ,f ,f")))
+ (clobber (match_operand:SF 2 "memory_operand" "=X,m ,m ,m"))]
"TARGET_80387"
{
gcc_assert (!which_alternative);
return output_387_reg_move (insn, operands);
}
- [(set_attr "type" "fmov,multi")
- (set_attr "unit" "*,i387")
+ [(set_attr "type" "fmov,multi,multi,multi")
+ (set_attr "unit" "*,i387,i387,i387")
(set_attr "mode" "SF")])
(define_insn "*truncxfdf2_mixed"
- [(set (match_operand:DF 0 "nonimmediate_operand" "=m,?fY2*r")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=m,?f,?Y2,?*r")
(float_truncate:DF
- (match_operand:XF 1 "register_operand" "f,f")))
- (clobber (match_operand:DF 2 "memory_operand" "=X,m"))]
+ (match_operand:XF 1 "register_operand" "f ,f ,f ,f")))
+ (clobber (match_operand:DF 2 "memory_operand" "=X,m ,m ,m"))]
"TARGET_80387"
{
gcc_assert (!which_alternative);
return output_387_reg_move (insn, operands);
}
- [(set_attr "type" "fmov,multi")
- (set_attr "unit" "*,i387")
+ [(set_attr "type" "fmov,multi,multi,multi")
+ (set_attr "unit" "*,i387,i387,i387")
(set_attr "mode" "DF")])
(define_insn "truncxf<mode>2_i387_noop"
@@ -15157,13 +15155,19 @@
/* In order to give reg-stack an easier job in validating two
coprocessor registers as containing a possible return value,
simply pretend the untyped call returns a complex long double
- value. */
+ value.
+
+ We can't use SSE_REGPARM_MAX here since callee is unprototyped
+ and should have the default ABI. */
ix86_expand_call ((TARGET_FLOAT_RETURNS_IN_80387
? gen_rtx_REG (XCmode, FIRST_FLOAT_REG) : NULL),
operands[0], const0_rtx,
- GEN_INT ((DEFAULT_ABI == SYSV_ABI ? X86_64_SSE_REGPARM_MAX
- : X64_SSE_REGPARM_MAX)
+ GEN_INT ((TARGET_64BIT
+ ? (DEFAULT_ABI == SYSV_ABI
+ ? X86_64_SSE_REGPARM_MAX
+ : X64_SSE_REGPARM_MAX)
+ : X86_32_SSE_REGPARM_MAX)
- 1),
NULL, 0);
@@ -20811,7 +20815,7 @@
[(match_dup 0)
(match_operand:SI 2 "memory_operand" "")]))
(clobber (reg:CC FLAGS_REG))])]
- "operands[0] != operands[1]
+ "REGNO (operands[0]) != REGNO (operands[1])
&& GENERAL_REGNO_P (REGNO (operands[0]))
&& GENERAL_REGNO_P (REGNO (operands[1]))"
[(set (match_dup 0) (match_dup 4))
@@ -20827,7 +20831,7 @@
(match_operator 3 "commutative_operator"
[(match_dup 0)
(match_operand 2 "memory_operand" "")]))]
- "operands[0] != operands[1]
+ "REGNO (operands[0]) != REGNO (operands[1])
&& ((MMX_REG_P (operands[0]) && MMX_REG_P (operands[1]))
|| (SSE_REG_P (operands[0]) && SSE_REG_P (operands[1])))"
[(set (match_dup 0) (match_dup 2))
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index b2bef6470be..f1c71033333 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -887,6 +887,34 @@
return parts.disp != NULL_RTX;
})
+;; Returns 1 if OP is memory operand which will need zero or
+;; one register at most, not counting stack pointer or frame pointer.
+(define_predicate "cmpxchg8b_pic_memory_operand"
+ (match_operand 0 "memory_operand")
+{
+ struct ix86_address parts;
+ int ok;
+
+ ok = ix86_decompose_address (XEXP (op, 0), &parts);
+ gcc_assert (ok);
+ if (parts.base == NULL_RTX
+ || parts.base == arg_pointer_rtx
+ || parts.base == frame_pointer_rtx
+ || parts.base == hard_frame_pointer_rtx
+ || parts.base == stack_pointer_rtx)
+ return 1;
+
+ if (parts.index == NULL_RTX
+ || parts.index == arg_pointer_rtx
+ || parts.index == frame_pointer_rtx
+ || parts.index == hard_frame_pointer_rtx
+ || parts.index == stack_pointer_rtx)
+ return 1;
+
+ return 0;
+})
+
+
;; Returns 1 if OP is memory operand that cannot be represented
;; by the modRM array.
(define_predicate "long_memory_operand"
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index db5b64fc3a8..e6d1fd14b2d 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -1101,7 +1101,7 @@
(match_operand:V8SF 1 "register_operand" "x")
(match_operand:V8SF 2 "nonimmediate_operand" "xm"))
(minus:V8SF (match_dup 1) (match_dup 2))
- (const_int 66)))]
+ (const_int 170)))]
"TARGET_AVX"
"vaddsubps\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sseadd")
@@ -1115,7 +1115,7 @@
(match_operand:V4DF 1 "register_operand" "x")
(match_operand:V4DF 2 "nonimmediate_operand" "xm"))
(minus:V4DF (match_dup 1) (match_dup 2))
- (const_int 6)))]
+ (const_int 10)))]
"TARGET_AVX"
"vaddsubpd\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sseadd")
@@ -1129,7 +1129,7 @@
(match_operand:V4SF 1 "register_operand" "x")
(match_operand:V4SF 2 "nonimmediate_operand" "xm"))
(minus:V4SF (match_dup 1) (match_dup 2))
- (const_int 6)))]
+ (const_int 10)))]
"TARGET_AVX"
"vaddsubps\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sseadd")
@@ -1143,7 +1143,7 @@
(match_operand:V4SF 1 "register_operand" "0")
(match_operand:V4SF 2 "nonimmediate_operand" "xm"))
(minus:V4SF (match_dup 1) (match_dup 2))
- (const_int 6)))]
+ (const_int 10)))]
"TARGET_SSE3"
"addsubps\t{%2, %0|%0, %2}"
[(set_attr "type" "sseadd")
diff --git a/gcc/config/i386/sync.md b/gcc/config/i386/sync.md
index e2675744b01..05aad00ba94 100644
--- a/gcc/config/i386/sync.md
+++ b/gcc/config/i386/sync.md
@@ -1,5 +1,5 @@
;; GCC machine description for i386 synchronization instructions.
-;; Copyright (C) 2005, 2006, 2007, 2008
+;; Copyright (C) 2005, 2006, 2007, 2008, 2009
;; Free Software Foundation, Inc.
;;
;; This file is part of GCC.
@@ -82,8 +82,15 @@
low = force_reg (hmode, low);
high = force_reg (hmode, high);
if (<MODE>mode == DImode)
- emit_insn (gen_sync_double_compare_and_swapdi
- (operands[0], operands[1], operands[2], low, high));
+ {
+ if (flag_pic && !cmpxchg8b_pic_memory_operand (operands[1], DImode))
+ operands[1] = replace_equiv_address (operands[1],
+ force_reg (Pmode,
+ XEXP (operands[1],
+ 0)));
+ emit_insn (gen_sync_double_compare_and_swapdi
+ (operands[0], operands[1], operands[2], low, high));
+ }
else if (<MODE>mode == TImode)
emit_insn (gen_sync_double_compare_and_swapti
(operands[0], operands[1], operands[2], low, high));
@@ -131,7 +138,7 @@
;; are just esi and edi.
(define_insn "*sync_double_compare_and_swapdi_pic"
[(set (match_operand:DI 0 "register_operand" "=A")
- (match_operand:DI 1 "memory_operand" "+m"))
+ (match_operand:DI 1 "cmpxchg8b_pic_memory_operand" "+m"))
(set (match_dup 1)
(unspec_volatile:DI
[(match_dup 1)
@@ -173,8 +180,15 @@
low = force_reg (hmode, low);
high = force_reg (hmode, high);
if (<MODE>mode == DImode)
- emit_insn (gen_sync_double_compare_and_swap_ccdi
- (operands[0], operands[1], operands[2], low, high));
+ {
+ if (flag_pic && !cmpxchg8b_pic_memory_operand (operands[1], DImode))
+ operands[1] = replace_equiv_address (operands[1],
+ force_reg (Pmode,
+ XEXP (operands[1],
+ 0)));
+ emit_insn (gen_sync_double_compare_and_swap_ccdi
+ (operands[0], operands[1], operands[2], low, high));
+ }
else if (<MODE>mode == TImode)
emit_insn (gen_sync_double_compare_and_swap_ccti
(operands[0], operands[1], operands[2], low, high));
@@ -224,7 +238,7 @@
;; operand 3.
(define_insn "*sync_double_compare_and_swap_ccdi_pic"
[(set (match_operand:DI 0 "register_operand" "=A")
- (match_operand:DI 1 "memory_operand" "+m"))
+ (match_operand:DI 1 "cmpxchg8b_pic_memory_operand" "+m"))
(set (match_dup 1)
(unspec_volatile:DI
[(match_dup 1)
diff --git a/gcc/config/i386/x-mingw32 b/gcc/config/i386/x-mingw32
index 7ae61522a56..0af4f5c3f41 100644
--- a/gcc/config/i386/x-mingw32
+++ b/gcc/config/i386/x-mingw32
@@ -8,6 +8,6 @@ local_includedir=$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e 's|
WERROR_FLAGS += -Wno-format
host-mingw32.o : $(srcdir)/config/i386/host-mingw32.c $(CONFIG_H) $(SYSTEM_H) \
- coretypes.h hosthooks.h hosthooks-def.h toplev.h diagnostic.h $(HOOKS_H)
+ coretypes.h hosthooks.h hosthooks-def.h toplev.h $(DIAGNOSTIC_H) $(HOOKS_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(srcdir)/config/i386/host-mingw32.c
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 420a8e46327..da96fce6d4f 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -7274,6 +7274,8 @@ ia64_set_sched_flags (spec_info_t spec_info)
spec_info->flags |= COUNT_SPEC_IN_CRITICAL_PATH;
}
}
+ else
+ spec_info->mask = 0;
}
/* If INSN is an appropriate load return its mode.
diff --git a/gcc/config/m68k/t-rtems b/gcc/config/m68k/t-rtems
index 2b0750f0f05..0997afebc94 100644
--- a/gcc/config/m68k/t-rtems
+++ b/gcc/config/m68k/t-rtems
@@ -4,5 +4,6 @@ M68K_MLIB_CPU += && (match(MLIB, "^68") \
|| MLIB == "5206" \
|| MLIB == "5208" \
|| MLIB == "5307" \
+ || MLIB == "5329" \
|| MLIB == "5407" \
|| MLIB == "5475")
diff --git a/gcc/config/mcore/mcore.h b/gcc/config/mcore/mcore.h
index 6e26d5e7b35..278c1b248ee 100644
--- a/gcc/config/mcore/mcore.h
+++ b/gcc/config/mcore/mcore.h
@@ -50,8 +50,6 @@
} \
while (0)
-/* If -m4align is ever re-enabled then add this line to the definition of CPP_SPEC
- %{!m4align:-D__MCORE_ALIGN_8__} %{m4align:-D__MCORE__ALIGN_4__}. */
#undef CPP_SPEC
#define CPP_SPEC "%{m210:%{mlittle-endian:%ethe m210 does not have little endian support}}"
@@ -67,7 +65,6 @@
#define TARGET_DEFAULT \
(MASK_HARDLIT \
- | MASK_8ALIGN \
| MASK_DIV \
| MASK_RELAX_IMM \
| MASK_M340 \
diff --git a/gcc/config/mcore/mcore.opt b/gcc/config/mcore/mcore.opt
index 1eae8901e6e..c445237301a 100644
--- a/gcc/config/mcore/mcore.opt
+++ b/gcc/config/mcore/mcore.opt
@@ -1,6 +1,6 @@
; Options for the Motorola MCore port of the compiler.
-; Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+; Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
@@ -26,18 +26,10 @@ m340
Target RejectNegative Report Mask(M340)
Generate code for the M*Core M340
-m4align
-Target RejectNegative Report InverseMask(8ALIGN)
-Set maximum alignment to 4
-
m4byte-functions
Target Report Mask(OVERALIGN_FUNC)
Force functions to be aligned to a 4 byte boundary
-m8align
-Target RejectNegative Report Mask(8ALIGN)
-Set maximum alignment to 8
-
mbig-endian
Target RejectNegative Report InverseMask(LITTLE_END)
Generate big-endian code
@@ -60,7 +52,8 @@ Generate little-endian code
; Not used by the compiler proper.
mno-lsim
-Target RejectNegative Undocumented
+Target RejectNegative
+Assume that run-time support has been provided, so omit -lsim from the linker command line
mrelax-immediates
Target Report Mask(RELAX_IMM)
diff --git a/gcc/config/picochip/picochip.c b/gcc/config/picochip/picochip.c
index b77b30186fc..e9b61563153 100644
--- a/gcc/config/picochip/picochip.c
+++ b/gcc/config/picochip/picochip.c
@@ -3898,23 +3898,6 @@ picochip_generate_halt (void)
return const0_rtx;
}
-static rtx
-picochip_generate_profile (tree arglist)
-{
- tree arg0 = TREE_VALUE (arglist);
- rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
-
- start_sequence();
- emit_insn (gen_profile (op0));
-
- rtx insns = get_insns();
- end_sequence();
- emit_insn (insns);
-
- return const0_rtx;
-}
-
-
/* Initialise the builtin functions. Start by initialising
descriptions of different types of functions (e.g., void fn(int),
int fn(void)), and then use these to define the builtins. */
@@ -3996,14 +3979,6 @@ picochip_init_builtins (void)
BUILT_IN_MD, NULL, NULL_TREE);
/* Initialise the bit reverse function. */
- add_builtin_function ("__builtin_profile", void_ftype_int,
- PICOCHIP_BUILTIN_PROFILE, BUILT_IN_MD, NULL,
- NULL_TREE);
- add_builtin_function ("picoProfile", void_ftype_int,
- PICOCHIP_BUILTIN_PROFILE, BUILT_IN_MD, NULL,
- NULL_TREE);
-
- /* Initialise the bit reverse function. */
add_builtin_function ("__builtin_brev", unsigned_ftype_unsigned,
PICOCHIP_BUILTIN_BREV, BUILT_IN_MD, NULL,
NULL_TREE);
@@ -4135,9 +4110,6 @@ picochip_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
case PICOCHIP_BUILTIN_HALT:
return picochip_generate_halt ();
- case PICOCHIP_BUILTIN_PROFILE:
- return picochip_generate_profile (arglist);
-
default:
gcc_unreachable();
diff --git a/gcc/config/picochip/picochip.h b/gcc/config/picochip/picochip.h
index 6c92fb48a69..dc57364f2b7 100644
--- a/gcc/config/picochip/picochip.h
+++ b/gcc/config/picochip/picochip.h
@@ -736,7 +736,6 @@ enum picochip_builtins
PICOCHIP_BUILTIN_PUT_ARRAY,
PICOCHIP_BUILTIN_TESTPORT_ARRAY,
PICOCHIP_BUILTIN_ASRI,
- PICOCHIP_BUILTIN_PROFILE,
PICOCHIP_BUILTIN_HALT
};
diff --git a/gcc/config/picochip/picochip.md b/gcc/config/picochip/picochip.md
index e1f3b388f68..657629c96fa 100644
--- a/gcc/config/picochip/picochip.md
+++ b/gcc/config/picochip/picochip.md
@@ -111,9 +111,6 @@
; Internal TSTPORT instruction, used to generate a single TSTPORT
; instruction for use in the testport branch split.
(UNSPEC_INTERNAL_TESTPORT 19)
-
- ; instruction for use in the profile based optimizations.
- (UNSPEC_INTERNAL_PROFILE 20)
]
)
@@ -2228,14 +2225,6 @@
[(set_attr "length" "1")
(set_attr "type" "unknown")])
-(define_insn "profile"
- [(unspec_volatile [(match_operand:HI 0 "const_int_operand" "i")]
- UNSPEC_INTERNAL_PROFILE)]
- ""
- "PROFILE_DUMMY %0 \t// (profile instruction %0)"
- [(set_attr "length" "1")
- (set_attr "type" "unknown")])
-
(define_insn "internal_testport"
[(set (reg:CC CC_REGNUM)
(unspec_volatile:CC [(match_operand:HI 0 "const_int_operand" "i")]
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 3073561c9f0..17622c26f00 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -15254,7 +15254,7 @@ rs6000_ra_ever_killed (void)
rtx reg;
rtx insn;
- if (crtl->is_thunk)
+ if (cfun->is_thunk)
return 0;
/* regs_ever_live has LR marked as used if any sibcalls are present,
@@ -17556,7 +17556,7 @@ rs6000_output_function_epilogue (FILE *file,
System V.4 Powerpc's (and the embedded ABI derived from it) use a
different traceback table. */
if (DEFAULT_ABI == ABI_AIX && ! flag_inhibit_size_directive
- && rs6000_traceback != traceback_none && !crtl->is_thunk)
+ && rs6000_traceback != traceback_none && !cfun->is_thunk)
{
const char *fname = NULL;
const char *language_string = lang_hooks.name;
diff --git a/gcc/config/rs6000/t-rtems b/gcc/config/rs6000/t-rtems
index b3db9498a23..c0fd8bf3b07 100644
--- a/gcc/config/rs6000/t-rtems
+++ b/gcc/config/rs6000/t-rtems
@@ -10,8 +10,6 @@ m403 m505 m601 m603e m604 m860 m7400 \
mpc8260 \
nof
-MULTILIB_EXTRA_OPTS = mrelocatable-lib mno-eabi mstrict-align
-
# MULTILIB_MATCHES = ${MULTILIB_MATCHES_FLOAT}
MULTILIB_MATCHES =
MULTILIB_MATCHES += ${MULTILIB_MATCHES_ENDIAN}
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 3c57730b83e..c8f4c85ee75 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -5966,7 +5966,9 @@ calc_live_regs (HARD_REG_SET *live_regs_mask)
&& crtl->args.info.call_cookie
&& reg == PIC_OFFSET_TABLE_REGNUM)
|| (df_regs_ever_live_p (reg)
- && (!call_really_used_regs[reg]
+ && ((!call_really_used_regs[reg]
+ && !(reg != PIC_OFFSET_TABLE_REGNUM
+ && fixed_regs[reg] && call_used_regs[reg]))
|| (trapa_handler && reg == FPSCR_REG && TARGET_FPU_ANY)))
|| (crtl->calls_eh_return
&& (reg == EH_RETURN_DATA_REGNO (0)
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index d78d6e93b43..e5098a5592d 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -7082,10 +7082,10 @@
[(unspec_volatile [(const_int 0)] UNSPECV_SETJMP)]
""
{
- if (! cfun->calls_alloca)
+ if (!cfun->calls_alloca)
return "";
- if (! TARGET_V9)
- return "\tta\t3\n";
+ if (!TARGET_V9)
+ return "ta\t3";
fputs ("\tflushw\n", asm_out_file);
if (flag_pic)
fprintf (asm_out_file, "\tst%c\t%%l7, [%%sp+%d]\n",
diff --git a/gcc/config/spu/divv2df3.c b/gcc/config/spu/divv2df3.c
new file mode 100644
index 00000000000..cd7126bb733
--- /dev/null
+++ b/gcc/config/spu/divv2df3.c
@@ -0,0 +1,198 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This file is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this file; see the file COPYING. If not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. The exception does not
+ however invalidate any other reasons why the executable file might be covered
+ by the GNU General Public License. */
+
+
+#include <spu_intrinsics.h>
+
+vector double __divv2df3 (vector double a_in, vector double b_in);
+
+/* __divv2df3 divides the vector dividend a by the vector divisor b and
+ returns the resulting vector quotient. Maximum error about 0.5 ulp
+ over entire double range including denorms, compared to true result
+ in round-to-nearest rounding mode. Handles Inf or NaN operands and
+ results correctly. */
+
+vector double
+__divv2df3 (vector double a_in, vector double b_in)
+{
+ /* Variables */
+ vec_int4 exp, exp_bias;
+ vec_uint4 no_underflow, overflow;
+ vec_float4 mant_bf, inv_bf;
+ vec_ullong2 exp_a, exp_b;
+ vec_ullong2 a_nan, a_zero, a_inf, a_denorm, a_denorm0;
+ vec_ullong2 b_nan, b_zero, b_inf, b_denorm, b_denorm0;
+ vec_ullong2 nan;
+ vec_uint4 a_exp, b_exp;
+ vec_ullong2 a_mant_0, b_mant_0;
+ vec_ullong2 a_exp_1s, b_exp_1s;
+ vec_ullong2 sign_exp_mask;
+
+ vec_double2 a, b;
+ vec_double2 mant_a, mant_b, inv_b, q0, q1, q2, mult;
+
+ /* Constants */
+ vec_uint4 exp_mask_u32 = spu_splats((unsigned int)0x7FF00000);
+ vec_uchar16 splat_hi = (vec_uchar16){0,1,2,3, 0,1,2,3, 8, 9,10,11, 8,9,10,11};
+ vec_uchar16 swap_32 = (vec_uchar16){4,5,6,7, 0,1,2,3, 12,13,14,15, 8,9,10,11};
+ vec_ullong2 exp_mask = spu_splats(0x7FF0000000000000ULL);
+ vec_ullong2 sign_mask = spu_splats(0x8000000000000000ULL);
+ vec_float4 onef = spu_splats(1.0f);
+ vec_double2 one = spu_splats(1.0);
+ vec_double2 exp_53 = (vec_double2)spu_splats(0x0350000000000000ULL);
+
+ sign_exp_mask = spu_or(sign_mask, exp_mask);
+
+ /* Extract the floating point components from each of the operands including
+ * exponent and mantissa.
+ */
+ a_exp = (vec_uint4)spu_and((vec_uint4)a_in, exp_mask_u32);
+ a_exp = spu_shuffle(a_exp, a_exp, splat_hi);
+ b_exp = (vec_uint4)spu_and((vec_uint4)b_in, exp_mask_u32);
+ b_exp = spu_shuffle(b_exp, b_exp, splat_hi);
+
+ a_mant_0 = (vec_ullong2)spu_cmpeq((vec_uint4)spu_andc((vec_ullong2)a_in, sign_exp_mask), 0);
+ a_mant_0 = spu_and(a_mant_0, spu_shuffle(a_mant_0, a_mant_0, swap_32));
+
+ b_mant_0 = (vec_ullong2)spu_cmpeq((vec_uint4)spu_andc((vec_ullong2)b_in, sign_exp_mask), 0);
+ b_mant_0 = spu_and(b_mant_0, spu_shuffle(b_mant_0, b_mant_0, swap_32));
+
+ a_exp_1s = (vec_ullong2)spu_cmpeq(a_exp, exp_mask_u32);
+ b_exp_1s = (vec_ullong2)spu_cmpeq(b_exp, exp_mask_u32);
+
+ /* Identify all possible special values that must be accomodated including:
+ * +-denorm, +-0, +-infinity, and NaNs.
+ */
+ a_denorm0= (vec_ullong2)spu_cmpeq(a_exp, 0);
+ a_nan = spu_andc(a_exp_1s, a_mant_0);
+ a_zero = spu_and (a_denorm0, a_mant_0);
+ a_inf = spu_and (a_exp_1s, a_mant_0);
+ a_denorm = spu_andc(a_denorm0, a_zero);
+
+ b_denorm0= (vec_ullong2)spu_cmpeq(b_exp, 0);
+ b_nan = spu_andc(b_exp_1s, b_mant_0);
+ b_zero = spu_and (b_denorm0, b_mant_0);
+ b_inf = spu_and (b_exp_1s, b_mant_0);
+ b_denorm = spu_andc(b_denorm0, b_zero);
+
+ /* Scale denorm inputs to into normalized numbers by conditionally scaling the
+ * input parameters.
+ */
+ a = spu_sub(spu_or(a_in, exp_53), spu_sel(exp_53, a_in, sign_mask));
+ a = spu_sel(a_in, a, a_denorm);
+
+ b = spu_sub(spu_or(b_in, exp_53), spu_sel(exp_53, b_in, sign_mask));
+ b = spu_sel(b_in, b, b_denorm);
+
+ /* Extract the divisor and dividend exponent and force parameters into the signed
+ * range [1.0,2.0) or [-1.0,2.0).
+ */
+ exp_a = spu_and((vec_ullong2)a, exp_mask);
+ exp_b = spu_and((vec_ullong2)b, exp_mask);
+
+ mant_a = spu_sel(a, one, (vec_ullong2)exp_mask);
+ mant_b = spu_sel(b, one, (vec_ullong2)exp_mask);
+
+ /* Approximate the single reciprocal of b by using
+ * the single precision reciprocal estimate followed by one
+ * single precision iteration of Newton-Raphson.
+ */
+ mant_bf = spu_roundtf(mant_b);
+ inv_bf = spu_re(mant_bf);
+ inv_bf = spu_madd(spu_nmsub(mant_bf, inv_bf, onef), inv_bf, inv_bf);
+
+ /* Perform 2 more Newton-Raphson iterations in double precision. The
+ * result (q1) is in the range (0.5, 2.0).
+ */
+ inv_b = spu_extend(inv_bf);
+ inv_b = spu_madd(spu_nmsub(mant_b, inv_b, one), inv_b, inv_b);
+ q0 = spu_mul(mant_a, inv_b);
+ q1 = spu_madd(spu_nmsub(mant_b, q0, mant_a), inv_b, q0);
+
+ /* Determine the exponent correction factor that must be applied
+ * to q1 by taking into account the exponent of the normalized inputs
+ * and the scale factors that were applied to normalize them.
+ */
+ exp = spu_rlmaska(spu_sub((vec_int4)exp_a, (vec_int4)exp_b), -20);
+ exp = spu_add(exp, (vec_int4)spu_add(spu_and((vec_int4)a_denorm, -0x34), spu_and((vec_int4)b_denorm, 0x34)));
+
+ /* Bias the quotient exponent depending on the sign of the exponent correction
+ * factor so that a single multiplier will ensure the entire double precision
+ * domain (including denorms) can be achieved.
+ *
+ * exp bias q1 adjust exp
+ * ===== ======== ==========
+ * positive 2^+65 -65
+ * negative 2^-64 +64
+ */
+ exp_bias = spu_xor(spu_rlmaska(exp, -31), 64);
+ exp = spu_sub(exp, exp_bias);
+
+ q1 = spu_sel(q1, (vec_double2)spu_add((vec_int4)q1, spu_sl(exp_bias, 20)), exp_mask);
+
+ /* Compute a multiplier (mult) to applied to the quotient (q1) to produce the
+ * expected result. On overflow, clamp the multiplier to the maximum non-infinite
+ * number in case the rounding mode is not round-to-nearest.
+ */
+ exp = spu_add(exp, 0x3FF);
+ no_underflow = spu_cmpgt(exp, 0);
+ overflow = spu_cmpgt(exp, 0x7FE);
+ exp = spu_and(spu_sl(exp, 20), (vec_int4)no_underflow);
+ exp = spu_and(exp, (vec_int4)exp_mask);
+
+ mult = spu_sel((vec_double2)exp, (vec_double2)(spu_add((vec_uint4)exp_mask, -1)), (vec_ullong2)overflow);
+
+ /* Handle special value conditions. These include:
+ *
+ * 1) IF either operand is a NaN OR both operands are 0 or INFINITY THEN a NaN
+ * results.
+ * 2) ELSE IF the dividend is an INFINITY OR the divisor is 0 THEN a INFINITY results.
+ * 3) ELSE IF the dividend is 0 OR the divisor is INFINITY THEN a 0 results.
+ */
+ mult = spu_andc(mult, (vec_double2)spu_or(a_zero, b_inf));
+ mult = spu_sel(mult, (vec_double2)exp_mask, spu_or(a_inf, b_zero));
+
+ nan = spu_or(a_nan, b_nan);
+ nan = spu_or(nan, spu_and(a_zero, b_zero));
+ nan = spu_or(nan, spu_and(a_inf, b_inf));
+
+ mult = spu_or(mult, (vec_double2)nan);
+
+ /* Scale the final quotient */
+
+ q2 = spu_mul(q1, mult);
+
+ return (q2);
+}
+
+
+/* We use the same function for vector and scalar division. Provide the
+ scalar entry point as an alias. */
+double __divdf3 (double a, double b)
+ __attribute__ ((__alias__ ("__divv2df3")));
+
+/* Some toolchain builds used the __fast_divdf3 name for this helper function.
+ Provide this as another alternate entry point for compatibility. */
+double __fast_divdf3 (double a, double b)
+ __attribute__ ((__alias__ ("__divv2df3")));
+
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index c2fbb331b0a..6e0001b0a05 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -4114,17 +4114,16 @@ spu_expand_mov (rtx * ops, enum machine_mode mode)
if (GET_CODE (ops[1]) == SUBREG && !valid_subreg (ops[1]))
{
rtx from = SUBREG_REG (ops[1]);
- enum machine_mode imode = GET_MODE (from);
+ enum machine_mode imode = int_mode_for_mode (GET_MODE (from));
gcc_assert (GET_MODE_CLASS (mode) == MODE_INT
&& GET_MODE_CLASS (imode) == MODE_INT
&& subreg_lowpart_p (ops[1]));
if (GET_MODE_SIZE (imode) < 4)
- {
- from = gen_rtx_SUBREG (SImode, from, 0);
- imode = SImode;
- }
+ imode = SImode;
+ if (imode != GET_MODE (from))
+ from = gen_rtx_SUBREG (imode, from, 0);
if (GET_MODE_SIZE (mode) < GET_MODE_SIZE (imode))
{
diff --git a/gcc/config/spu/t-spu-elf b/gcc/config/spu/t-spu-elf
index 2e1928707df..f8c5ba5b01d 100644
--- a/gcc/config/spu/t-spu-elf
+++ b/gcc/config/spu/t-spu-elf
@@ -29,6 +29,10 @@ TARGET_LIBGCC2_CFLAGS = -fPIC -mwarn-reloc -D__IN_LIBGCC2
# own versions below.
LIB2FUNCS_EXCLUDE = _floatdisf _floatundisf
+# We provide our own version of __divdf3 that performs better and has
+# better support for non-default rounding modes.
+DPBIT_FUNCS := $(filter-out _div_df, $(DPBIT_FUNCS))
+
LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/spu/float_unssidf.c \
$(srcdir)/config/spu/float_unsdidf.c \
$(srcdir)/config/spu/float_unsdisf.c \
@@ -39,7 +43,8 @@ LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/spu/float_unssidf.c \
$(srcdir)/config/spu/mfc_multi_tag_reserve.c \
$(srcdir)/config/spu/mfc_multi_tag_release.c \
$(srcdir)/config/spu/multi3.c \
- $(srcdir)/config/spu/divmodti4.c
+ $(srcdir)/config/spu/divmodti4.c \
+ $(srcdir)/config/spu/divv2df3.c
LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
$(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/gcc/configure b/gcc/configure
index c144f810247..8bc67a074c9 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1106,7 +1106,7 @@ Optional Packages:
use sysroot as the system root during the build
--with-sysroot=DIR Search for usr/lib, usr/include, et al, within DIR.
--with-pkgversion=PKG Use PKG in the version string in place of "lto
- merged with rev 144635"
+ merged with rev 145100"
--with-bugurl=URL Direct users to URL to report a bug
--with-gnu-ld assume the C compiler uses GNU ld default=no
--with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
@@ -8135,7 +8135,7 @@ echo "$as_me: error: package version not specified" >&2;}
*) PKGVERSION="($withval) " ;;
esac
else
- PKGVERSION="(lto merged with rev 144635) "
+ PKGVERSION="(lto merged with rev 145100) "
fi;
@@ -22158,6 +22158,17 @@ foo: .long 25
tls_first_minor=13
tls_as_opt=--fatal-warnings
;;
+ cris-*-*|crisv32-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+x: .long 25
+ .text
+ move.d x:IE,$r10
+ nop'
+ tls_first_major=2
+ tls_first_minor=20
+ tls_as_opt=--fatal-warnings
+ ;;
frv*-*-*)
conftest_s='
.section ".tdata","awT",@progbits
@@ -23842,7 +23853,7 @@ esac
case "$target" in
i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
| x86_64*-*-* | hppa*-*-* | arm*-*-* \
- | xstormy16*-*-* | cris-*-* | xtensa*-*-* | bfin-*-* | score*-*-* \
+ | xstormy16*-*-* | cris-*-* | crisv32-*-* | xtensa*-*-* | bfin-*-* | score*-*-* \
| spu-*-* | fido*-*-* | m32c-*-*)
insn="nop"
;;
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 077075447c2..750e5496b11 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -781,7 +781,7 @@ esac],
[onestep=""])
AC_SUBST(onestep)
-ACX_PKGVERSION([lto merged with rev 144635])
+ACX_PKGVERSION([lto merged with rev 145100])
ACX_BUGURL([http://gcc.gnu.org/bugs.html])
# Sanity check enable_languages in case someone does not run the toplevel
@@ -2448,6 +2448,17 @@ foo: .long 25
tls_first_minor=13
tls_as_opt=--fatal-warnings
;;
+ cris-*-*|crisv32-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+x: .long 25
+ .text
+ move.d x:IE,$r10
+ nop'
+ tls_first_major=2
+ tls_first_minor=20
+ tls_as_opt=--fatal-warnings
+ ;;
frv*-*-*)
conftest_s='
.section ".tdata","awT",@progbits
@@ -3217,7 +3228,7 @@ esac
case "$target" in
i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
| x86_64*-*-* | hppa*-*-* | arm*-*-* \
- | xstormy16*-*-* | cris-*-* | xtensa*-*-* | bfin-*-* | score*-*-* \
+ | xstormy16*-*-* | cris-*-* | crisv32-*-* | xtensa*-*-* | bfin-*-* | score*-*-* \
| spu-*-* | fido*-*-* | m32c-*-*)
insn="nop"
;;
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5d9f32897a2..bac3d7a7a8d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,166 @@
+2009-03-26 Andrew Haley <aph@redhat.com>
+
+ PR C++/39380
+ * decl2.c (possibly_inlined_p): If java exceptions are in use
+ don't inline a decl unless it is explicitly marked inline.
+ * lex.c: (pragma_java_exceptions): New variable.
+ (handle_pragma_java_exceptions): Set pragma_java_exceptions.
+ * cp-tree.h (pragma_java_exceptions): Declare new variable.
+
+2009-03-24 Jason Merrill <jason@redhat.com>
+
+ PR c++/28274
+ * name-lookup.c (pushdecl_maybe_friend): Check default args later.
+
+2009-03-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/39495
+ * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
+ code if iter is the second operand.
+ * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
+ argument. If it is set, don't build the toplevel expression with
+ build_x_binary_op, but build2.
+ (cp_parser_assignment_expression, cp_parser_omp_for_incr): Adjust
+ callers.
+ (cp_parser_omp_for_cond): Don't assume the first operand of the
+ comparison must be decl.
+
+2009-03-23 Jason Merrill <jason@redhat.com>
+
+ PR c++/37729
+ * pt.c (make_fnparm_pack): Split out from...
+ (instantiate_decl): ...here.
+ (tsubst_pack_expansion): Handle being called in a late-specified
+ return type.
+
+ PR c++/39526
+ * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
+ a parm with a parm.
+
+2009-03-20 Jason Merrill <jason@redhat.com>
+
+ PR c++/28879
+ * parser.c (cp_parser_direct_declarator): In a template, wrap
+ non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
+ * pt.c (tsubst): Preserve it in a partial instantiation.
+ (dependent_type_p_r): Don't check value_dependent_expression_p.
+ * decl.c (compute_array_index_type): Don't check
+ value_dependent_expression_p if TREE_SIDE_EFFECTS.
+
+ C++ core issue 703
+ * typeck2.c (check_narrowing): Don't complain about loss of
+ precision when converting a floating-point constant.
+
+2009-03-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/39495
+ * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
+ (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
+
+2009-03-18 Jakub Jelinek <jakub@redhat.com>
+
+ * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
+ (eof_token): Adjust.
+
+2009-03-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR c++/39425
+ * parser.c (cp_parser_explicit_specialization): Don't skip the
+ rest of the specialization when begin_specialization returns
+ false.
+
+2009-03-17 Jason Merrill <jason@redhat.com>
+
+ * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
+ (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
+ * pt.c (check_explicit_specialization): Likewise.
+ (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
+ local specialization.
+ * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
+ * decl2.c (parm_index): New fn.
+ * semantics.c (finish_decltype_type): Don't use describable_type.
+ * mangle.c (write_expression): Likewise. Mangle ALIGNOF_EXPR.
+ Give a sorry for unsupported codes rather than crash. Mangle
+ conversions with other than 1 operand. New mangling for PARM_DECL.
+ * operators.def (ALIGNOF_EXPR): Mangle as "az".
+
+2009-03-17 Jing Yu <jingyu@google.com>
+
+ PR middle-end/39378
+ * method.c (use_thunk): Change is_thunk from crtl to cfun.
+
+2009-03-17 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/39475
+ * semantics.c (check_trait_type): New.
+ (finish_trait_expr): Use it.
+
+2009-03-17 Jakub Jelinek <jakub@redhat.com>
+
+ * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
+ instead of calling imported_module_or_decl debug hook if
+ building_stmt_tree ().
+ * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
+ is a NAMESPACE_DECL.
+
+ PR debug/37890
+ * name-lookup.c (do_namespace_alias): Don't call global_decl debug
+ hook at function scope.
+
+ PR debug/39471
+ * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
+ on IMPORTED_DECL.
+
+2009-03-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/39371
+ * semantics.c (finish_switch_cond): Don't call get_unwidened.
+ * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
+ instead of TREE_TYPE (cond).
+
+2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR c++/39060
+ * parser.c (cp_parser_late_parsing_default_args): Continue
+ the loop when cp_parser_assignment_expression returns
+ error_mark_node.
+
+2009-03-07 Jason Merrill <jason@redhat.com>
+
+ PR c++/39367
+ * init.c (build_new_1): Don't use a VLA type.
+ (build_vec_init): Handle getting a pointer for BASE.
+
+2009-03-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR c++/37520
+ * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
+ when mangling symbols.
+
+2009-03-06 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/33492
+ * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
+
+2009-03-06 Alexandre Oliva <aoliva@redhat.com>
+
+ * decl.c (record_builtin_java_type): Use canonicalized integer
+ types.
+
2009-03-04 Jason Merrill <jason@redhat.com>
+ PR c++/38908
+ * class.c (is_really_empty_class): New fn.
+ * cp-tree.h: Declare it.
+ * cp-objcp-common.c (cp_expr_size): Use it.
+
+ PR c++/13549
+ * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
+ * parser.c (cp_parser_postfix_expression): Call it for
+ TEMPLATE_ID_EXPR.
+ * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
+ (get_first_fn): Likewise.
+
PR c++/9634
PR c++/29469
PR c++/29607
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 65903bcc6ae..620814bb229 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -6459,7 +6459,7 @@ is_empty_class (tree type)
if (type == error_mark_node)
return 0;
- if (! MAYBE_CLASS_TYPE_P (type))
+ if (! CLASS_TYPE_P (type))
return 0;
/* In G++ 3.2, whether or not a class was empty was determined by
@@ -6499,6 +6499,40 @@ contains_empty_class_p (tree type)
return false;
}
+/* Returns true if TYPE contains no actual data, just various
+ possible combinations of empty classes. */
+
+bool
+is_really_empty_class (tree type)
+{
+ if (is_empty_class (type))
+ return true;
+ if (CLASS_TYPE_P (type))
+ {
+ tree field;
+ tree binfo = TYPE_BINFO (type);
+ tree base_binfo;
+ int i;
+
+ if (!binfo)
+ return false;
+
+ for (i = 0;
+ BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i)
+ if (!is_really_empty_class (BINFO_TYPE (base_binfo)))
+ return false;
+ for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ if (TREE_CODE (field) == FIELD_DECL
+ && !DECL_ARTIFICIAL (field)
+ && !is_really_empty_class (TREE_TYPE (field)))
+ return false;
+ return true;
+ }
+ else if (TREE_CODE (type) == ARRAY_TYPE)
+ return is_really_empty_class (TREE_TYPE (type));
+ return false;
+}
+
/* Note that NAME was looked up while the current class was being
defined and that the result of that lookup was DECL. */
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index 838a9d6fa42..bb12988d1fa 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -585,16 +585,13 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
if (block)
{
tree using_directive;
- gcc_assert (TREE_OPERAND (*expr_p,0)
- && NAMESPACE_DECL_CHECK (TREE_OPERAND (*expr_p, 0)));
+ gcc_assert (TREE_OPERAND (*expr_p, 0));
using_directive = make_node (IMPORTED_DECL);
TREE_TYPE (using_directive) = void_type_node;
IMPORTED_DECL_ASSOCIATED_DECL (using_directive)
= TREE_OPERAND (*expr_p, 0);
- DECL_NAME (using_directive)
- = DECL_NAME (TREE_OPERAND (*expr_p, 0));
TREE_CHAIN (using_directive) = BLOCK_VARS (block);
BLOCK_VARS (block) = using_directive;
}
diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c
index 7d2e870bc80..fefafb1ac7e 100644
--- a/gcc/cp/cp-objcp-common.c
+++ b/gcc/cp/cp-objcp-common.c
@@ -101,7 +101,7 @@ cp_expr_size (const_tree exp)
constructed, this is a valid transformation. */
|| CP_AGGREGATE_TYPE_P (type))
/* This would be wrong for a type with virtual bases. */
- return (is_empty_class (type)
+ return (is_really_empty_class (type)
? size_zero_node
: CLASSTYPE_SIZE_UNIT (type));
else
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 772d815a4f2..4648351df7d 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -3665,20 +3665,8 @@ extern GTY(()) VEC(tree,gc) *local_classes;
at a particular location, we can index into the string at
any other location that provides distinguishing characters). */
-/* Define NO_DOLLAR_IN_LABEL in your favorite tm file if your assembler
- doesn't allow '$' in symbol names. */
-#ifndef NO_DOLLAR_IN_LABEL
-
-#define JOINER '$'
-
-#define AUTO_TEMP_NAME "_$tmp_"
-#define VFIELD_BASE "$vf"
-#define VFIELD_NAME "_vptr$"
-#define VFIELD_NAME_FORMAT "_vptr$%s"
-#define ANON_AGGRNAME_FORMAT "$_%d"
-
-#else /* NO_DOLLAR_IN_LABEL */
-
+/* Define NO_DOT_IN_LABEL in your favorite tm file if your assembler
+ doesn't allow '.' in symbol names. */
#ifndef NO_DOT_IN_LABEL
#define JOINER '.'
@@ -3692,6 +3680,18 @@ extern GTY(()) VEC(tree,gc) *local_classes;
#else /* NO_DOT_IN_LABEL */
+#ifndef NO_DOLLAR_IN_LABEL
+
+#define JOINER '$'
+
+#define AUTO_TEMP_NAME "_$tmp_"
+#define VFIELD_BASE "$vf"
+#define VFIELD_NAME "_vptr$"
+#define VFIELD_NAME_FORMAT "_vptr$%s"
+#define ANON_AGGRNAME_FORMAT "$_%d"
+
+#else /* NO_DOLLAR_IN_LABEL */
+
#define IN_CHARGE_NAME "__in_chrg"
#define AUTO_TEMP_NAME "__tmp_"
#define TEMP_NAME_P(ID_NODE) \
@@ -3714,8 +3714,8 @@ extern GTY(()) VEC(tree,gc) *local_classes;
sizeof (ANON_AGGRNAME_PREFIX) - 1))
#define ANON_AGGRNAME_FORMAT "__anon_%d"
-#endif /* NO_DOT_IN_LABEL */
#endif /* NO_DOLLAR_IN_LABEL */
+#endif /* NO_DOT_IN_LABEL */
#define THIS_NAME "this"
@@ -4176,6 +4176,9 @@ struct tinst_level GTY(())
e.g "int f(void)". */
extern cp_parameter_declarator *no_parameters;
+/* True if we saw "#pragma GCC java_exceptions". */
+extern bool pragma_java_exceptions;
+
/* in call.c */
extern bool check_dtor_name (tree, tree);
@@ -4245,6 +4248,7 @@ extern void finish_struct_1 (tree);
extern int resolves_to_fixed_type_p (tree, int *);
extern void init_class_processing (void);
extern int is_empty_class (tree);
+extern bool is_really_empty_class (tree);
extern void pushclass (tree);
extern void popclass (void);
extern void push_nested_class (tree);
@@ -4440,6 +4444,7 @@ extern bool decl_needed_p (tree);
extern void note_vague_linkage_fn (tree);
extern tree build_artificial_parm (tree, tree);
extern bool possibly_inlined_p (tree);
+extern int parm_index (tree);
/* in error.c */
extern void init_error (void);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 87e055e99ec..b7e2c96b05d 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1684,8 +1684,14 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
= DECL_SOURCE_LOCATION (newdecl);
DECL_INITIAL (old_result) = DECL_INITIAL (new_result);
if (DECL_FUNCTION_TEMPLATE_P (newdecl))
- DECL_ARGUMENTS (old_result)
- = DECL_ARGUMENTS (new_result);
+ {
+ tree parm;
+ DECL_ARGUMENTS (old_result)
+ = DECL_ARGUMENTS (new_result);
+ for (parm = DECL_ARGUMENTS (old_result); parm;
+ parm = TREE_CHAIN (parm))
+ DECL_CONTEXT (parm) = old_result;
+ }
}
return olddecl;
@@ -1920,6 +1926,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
+ tree parm;
+
if (DECL_TEMPLATE_INSTANTIATION (olddecl)
&& !DECL_TEMPLATE_INSTANTIATION (newdecl))
{
@@ -1976,6 +1984,11 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
/* Preserve abstractness on cloned [cd]tors. */
DECL_ABSTRACT (newdecl) = DECL_ABSTRACT (olddecl);
+ /* Update newdecl's parms to point at olddecl. */
+ for (parm = DECL_ARGUMENTS (newdecl); parm;
+ parm = TREE_CHAIN (parm))
+ DECL_CONTEXT (parm) = olddecl;
+
if (! types_match)
{
SET_DECL_LANGUAGE (olddecl, DECL_LANGUAGE (newdecl));
@@ -2008,7 +2021,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
}
DECL_RESULT (newdecl) = DECL_RESULT (olddecl);
- /* Don't clear out the arguments if we're redefining a function. */
+ /* Don't clear out the arguments if we're just redeclaring a
+ function. */
if (DECL_ARGUMENTS (olddecl))
DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl);
}
@@ -2808,7 +2822,8 @@ finish_case_label (tree low_value, tree high_value)
if (!check_switch_goto (switch_stack->level))
return error_mark_node;
- r = c_add_case_label (switch_stack->cases, cond, TREE_TYPE (cond),
+ r = c_add_case_label (switch_stack->cases, cond,
+ SWITCH_STMT_TYPE (switch_stack->switch_stmt),
low_value, high_value);
/* After labels, make any new cleanups in the function go into their
@@ -3170,10 +3185,18 @@ record_builtin_java_type (const char* name, int size)
{
tree type, decl;
if (size > 0)
- type = make_signed_type (size);
+ type = build_nonstandard_integer_type (size, 0);
else if (size > -32)
- { /* "__java_char" or ""__java_boolean". */
- type = make_unsigned_type (-size);
+ {
+ tree stype;
+ /* "__java_char" or ""__java_boolean". */
+ type = build_nonstandard_integer_type (-size, 1);
+ /* Get the signed type cached and attached to the unsigned type,
+ so it doesn't get garbage-collected at "random" times,
+ causing potential codegen differences out of different UIDs
+ and different alias set numbers. */
+ stype = build_nonstandard_integer_type (-size, 0);
+ TREE_CHAIN (type) = stype;
/*if (size == -1) TREE_SET_CODE (type, BOOLEAN_TYPE);*/
}
else
@@ -6548,6 +6571,8 @@ grokfndecl (tree ctype,
parms = parm;
}
DECL_ARGUMENTS (decl) = parms;
+ for (t = parms; t; t = TREE_CHAIN (t))
+ DECL_CONTEXT (t) = decl;
/* Propagate volatile out from type to decl. */
if (TYPE_VOLATILE (type))
TREE_THIS_VOLATILE (decl) = 1;
@@ -7156,13 +7181,22 @@ compute_array_index_type (tree name, tree size)
type = TREE_TYPE (size);
}
- if (value_dependent_expression_p (size))
+ /* We can only call value_dependent_expression_p on integral constant
+ expressions; the parser adds a dummy NOP_EXPR with TREE_SIDE_EFFECTS
+ set if this isn't one. */
+ if (processing_template_decl
+ && (TREE_SIDE_EFFECTS (size) || value_dependent_expression_p (size)))
{
- /* We cannot do any checking for a value-dependent SIZE. Just
- build the index type and mark that it requires structural
- equality checks. */
+ /* We cannot do any checking for a SIZE that isn't known to be
+ constant. Just build the index type and mark that it requires
+ structural equality checks. */
itype = build_index_type (build_min (MINUS_EXPR, sizetype,
size, integer_one_node));
+ if (!TREE_SIDE_EFFECTS (size))
+ {
+ TYPE_DEPENDENT_P (itype) = 1;
+ TYPE_DEPENDENT_P_VALID (itype) = 1;
+ }
SET_TYPE_STRUCTURAL_EQUALITY (itype);
return itype;
}
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 4d2264195fe..8837d8752d7 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -3772,7 +3772,7 @@ possibly_inlined_p (tree decl)
gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
if (DECL_UNINLINABLE (decl))
return false;
- if (!optimize)
+ if (!optimize || pragma_java_exceptions)
return DECL_DECLARED_INLINE_P (decl);
/* When optimizing, we might inline everything when flatten
attribute or heuristics inlining for size or autoinlining
@@ -3907,4 +3907,27 @@ mark_used (tree decl)
processing_template_decl = saved_processing_template_decl;
}
+/* Given function PARM_DECL PARM, return its index in the function's list
+ of parameters, beginning with 1. */
+
+int
+parm_index (tree parm)
+{
+ int index;
+ tree arg;
+
+ for (index = 1, arg = DECL_ARGUMENTS (DECL_CONTEXT (parm));
+ arg;
+ ++index, arg = TREE_CHAIN (arg))
+ {
+ if (DECL_NAME (parm) == DECL_NAME (arg))
+ break;
+ if (DECL_ARTIFICIAL (arg))
+ --index;
+ }
+
+ gcc_assert (arg);
+ return index;
+}
+
#include "gt-cp-decl2.h"
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 5888c6f3c5d..905ae0db34d 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1521,8 +1521,9 @@ dump_expr (tree t, int flags)
break;
case THROW_EXPR:
- pp_cxx_identifier (cxx_pp, "throw");
- dump_expr (TREE_OPERAND (t, 0), flags);
+ /* While waiting for caret diagnostics, avoid printing
+ __cxa_allocate_exception, __cxa_throw, and the like. */
+ pp_cxx_identifier (cxx_pp, "<throw-expression>");
break;
case PTRMEM_CST:
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 0072496162a..812042d7f7f 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -1786,23 +1786,14 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
/* True iff this is a call to "operator new[]" instead of just
"operator new". */
bool array_p = false;
- /* True iff ARRAY_P is true and the bound of the array type is
- not necessarily a compile time constant. For example, VLA_P is
- true for "new int[f()]". */
- bool vla_p = false;
- /* The type being allocated. If ARRAY_P is true, this will be an
- ARRAY_TYPE. */
- tree full_type;
- /* If ARRAY_P is true, the element type of the array. This is an
- never ARRAY_TYPE; for something like "new int[3][4]", the
+ /* If ARRAY_P is true, the element type of the array. This is never
+ an ARRAY_TYPE; for something like "new int[3][4]", the
ELT_TYPE is "int". If ARRAY_P is false, this is the same type as
- FULL_TYPE. */
+ TYPE. */
tree elt_type;
/* The type of the new-expression. (This type is always a pointer
type.) */
tree pointer_type;
- /* A pointer type pointing to the FULL_TYPE. */
- tree full_pointer_type;
tree outer_nelts = NULL_TREE;
tree alloc_call, alloc_expr;
/* The address returned by the call to "operator new". This node is
@@ -1833,35 +1824,15 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
if (nelts)
{
- tree index;
-
outer_nelts = nelts;
array_p = true;
-
- /* ??? The middle-end will error on us for building a VLA outside a
- function context. Methinks that's not it's purvey. So we'll do
- our own VLA layout later. */
- vla_p = true;
- index = convert (sizetype, nelts);
- index = size_binop (MINUS_EXPR, index, size_one_node);
- index = build_index_type (index);
- full_type = build_cplus_array_type (type, NULL_TREE);
- /* We need a copy of the type as build_array_type will return a shared copy
- of the incomplete array type. */
- full_type = build_distinct_type_copy (full_type);
- TYPE_DOMAIN (full_type) = index;
- SET_TYPE_STRUCTURAL_EQUALITY (full_type);
}
- else
+ else if (TREE_CODE (type) == ARRAY_TYPE)
{
- full_type = type;
- if (TREE_CODE (type) == ARRAY_TYPE)
- {
- array_p = true;
- nelts = array_type_nelts_top (type);
- outer_nelts = nelts;
- type = TREE_TYPE (type);
- }
+ array_p = true;
+ nelts = array_type_nelts_top (type);
+ outer_nelts = nelts;
+ type = TREE_TYPE (type);
}
/* If our base type is an array, then make sure we know how many elements
@@ -1896,21 +1867,7 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
size = size_in_bytes (elt_type);
if (array_p)
- {
- size = size_binop (MULT_EXPR, size, convert (sizetype, nelts));
- if (vla_p)
- {
- tree n, bitsize;
-
- /* Do our own VLA layout. Setting TYPE_SIZE/_UNIT is
- necessary in order for the <INIT_EXPR <*foo> <CONSTRUCTOR
- ...>> to be valid. */
- TYPE_SIZE_UNIT (full_type) = size;
- n = convert (bitsizetype, nelts);
- bitsize = size_binop (MULT_EXPR, TYPE_SIZE (elt_type), n);
- TYPE_SIZE (full_type) = bitsize;
- }
- }
+ size = size_binop (MULT_EXPR, size, convert (sizetype, nelts));
alloc_fn = NULL_TREE;
@@ -2138,8 +2095,9 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
}
/* Now use a pointer to the type we've actually allocated. */
- full_pointer_type = build_pointer_type (full_type);
- data_addr = fold_convert (full_pointer_type, data_addr);
+ data_addr = fold_convert (pointer_type, data_addr);
+ /* Any further uses of alloc_node will want this type, too. */
+ alloc_node = fold_convert (pointer_type, alloc_node);
/* Now initialize the allocated object. Note that we preevaluate the
initialization expression, apart from the actual constructor call or
@@ -2151,8 +2109,6 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
bool stable;
bool explicit_value_init_p = false;
- init_expr = cp_build_indirect_ref (data_addr, NULL, complain);
-
if (init == void_zero_node)
{
init = NULL_TREE;
@@ -2169,7 +2125,7 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
return error_mark_node;
}
init_expr
- = build_vec_init (init_expr,
+ = build_vec_init (data_addr,
cp_build_binary_op (input_location,
MINUS_EXPR, outer_nelts,
integer_one_node,
@@ -2186,6 +2142,8 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
}
else
{
+ init_expr = cp_build_indirect_ref (data_addr, NULL, complain);
+
if (TYPE_NEEDS_CONSTRUCTING (type) && !explicit_value_init_p)
{
init_expr = build_special_member_call (init_expr,
@@ -2197,8 +2155,8 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
else if (explicit_value_init_p)
{
/* Something like `new int()'. */
- init_expr = build2 (INIT_EXPR, full_type,
- init_expr, build_value_init (full_type));
+ init_expr = build2 (INIT_EXPR, type,
+ init_expr, build_value_init (type));
}
else
{
@@ -2239,7 +2197,7 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
functions that we use for finding allocation functions. */
cleanup = (build_op_delete_call
(dcode,
- fold_convert (full_pointer_type, alloc_node),
+ alloc_node,
size,
globally_qualified_p,
placement_allocation_fn_p ? alloc_call : NULL_TREE,
@@ -2322,9 +2280,6 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
if (init_preeval_expr)
rval = build2 (COMPOUND_EXPR, TREE_TYPE (rval), init_preeval_expr, rval);
- /* Convert to the final type. */
- rval = build_nop (pointer_type, rval);
-
/* A new-expression is never an lvalue. */
gcc_assert (!lvalue_p (rval));
@@ -2664,9 +2619,10 @@ get_temp_regvar (tree type, tree init)
/* `build_vec_init' returns tree structure that performs
initialization of a vector of aggregate types.
- BASE is a reference to the vector, of ARRAY_TYPE.
+ BASE is a reference to the vector, of ARRAY_TYPE, or a pointer
+ to the first element, of POINTER_TYPE.
MAXINDEX is the maximum index of the array (one less than the
- number of elements). It is only used if
+ number of elements). It is only used if BASE is a pointer or
TYPE_DOMAIN (TREE_TYPE (BASE)) == NULL_TREE.
INIT is the (possibly NULL) initializer.
@@ -2691,7 +2647,7 @@ build_vec_init (tree base, tree maxindex, tree init,
tree size;
tree itype = NULL_TREE;
tree iterator;
- /* The type of the array. */
+ /* The type of BASE. */
tree atype = TREE_TYPE (base);
/* The type of an element in the array. */
tree type = TREE_TYPE (atype);
@@ -2707,7 +2663,7 @@ build_vec_init (tree base, tree maxindex, tree init,
int num_initialized_elts = 0;
bool is_global;
- if (TYPE_DOMAIN (atype))
+ if (TREE_CODE (atype) == ARRAY_TYPE && TYPE_DOMAIN (atype))
maxindex = array_type_nelts (atype);
if (maxindex == NULL_TREE || maxindex == error_mark_node)
@@ -2716,7 +2672,7 @@ build_vec_init (tree base, tree maxindex, tree init,
if (explicit_value_init_p)
gcc_assert (!init);
- inner_elt_type = strip_array_types (atype);
+ inner_elt_type = strip_array_types (type);
if (init
&& (from_array == 2
? (!CLASS_TYPE_P (inner_elt_type)
@@ -2733,15 +2689,20 @@ build_vec_init (tree base, tree maxindex, tree init,
brace-enclosed initializers. In this case, digest_init and
store_constructor will handle the semantics for us. */
+ gcc_assert (TREE_CODE (atype) == ARRAY_TYPE);
stmt_expr = build2 (INIT_EXPR, atype, base, init);
return stmt_expr;
}
maxindex = cp_convert (ptrdiff_type_node, maxindex);
- ptype = build_pointer_type (type);
size = size_in_bytes (type);
- if (TREE_CODE (TREE_TYPE (base)) == ARRAY_TYPE)
- base = cp_convert (ptype, decay_conversion (base));
+ if (TREE_CODE (atype) == ARRAY_TYPE)
+ {
+ ptype = build_pointer_type (type);
+ base = cp_convert (ptype, decay_conversion (base));
+ }
+ else
+ ptype = atype;
/* The code we are generating looks like:
({
@@ -2953,10 +2914,13 @@ build_vec_init (tree base, tree maxindex, tree init,
stmt_expr = finish_init_stmts (is_global, stmt_expr, compound_stmt);
- /* Now convert make the result have the correct type. */
- atype = build_pointer_type (atype);
- stmt_expr = build1 (NOP_EXPR, atype, stmt_expr);
- stmt_expr = cp_build_indirect_ref (stmt_expr, NULL, complain);
+ /* Now make the result have the correct type. */
+ if (TREE_CODE (atype) == ARRAY_TYPE)
+ {
+ atype = build_pointer_type (atype);
+ stmt_expr = build1 (NOP_EXPR, atype, stmt_expr);
+ stmt_expr = cp_build_indirect_ref (stmt_expr, NULL, complain);
+ }
current_stmt_tree ()->stmts_are_full_exprs_p = destroy_temps;
return stmt_expr;
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index d708b09658b..66377ff1564 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -81,6 +81,8 @@ struct impl_files
static struct impl_files *impl_file_chain;
+/* True if we saw "#pragma GCC java_exceptions". */
+bool pragma_java_exceptions;
void
cxx_finish (void)
@@ -430,6 +432,7 @@ handle_pragma_java_exceptions (cpp_reader* dfile ATTRIBUTE_UNUSED)
warning (0, "junk at end of #pragma GCC java_exceptions");
choose_personality_routine (lang_java);
+ pragma_java_exceptions = true;
}
/* Issue an error message indicating that the lookup of NAME (an
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index ae2959ecca7..5e59ee70d5a 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -2145,27 +2145,6 @@ write_expression (tree expr)
{
enum tree_code code = TREE_CODE (expr);
- /* Inside decltype we can simplify some expressions, since we're only
- interested in the type. */
- if (skip_evaluation)
- {
- tree type = describable_type (expr);
- if (type == NULL_TREE)
- ;
- else if (TREE_CODE (type) == REFERENCE_TYPE)
- {
- write_string ("sT");
- write_type (TREE_TYPE (type));
- return;
- }
- else
- {
- write_string ("sR");
- write_type (type);
- return;
- }
- }
-
/* Skip NOP_EXPRs. They can occur when (say) a pointer argument
is converted (via qualification conversions) to another
type. */
@@ -2212,10 +2191,12 @@ write_expression (tree expr)
write_template_arg_literal (expr);
else if (code == PARM_DECL)
{
- /* A function parameter used under decltype in a late-specified
- return type. Represented with a type placeholder. */
- write_string ("sT");
- write_type (non_reference (TREE_TYPE (expr)));
+ /* A function parameter used in a late-specified return type. */
+ int index = parm_index (expr);
+ write_string ("fp");
+ if (index > 1)
+ write_unsigned_number (index - 2);
+ write_char ('_');
}
else if (DECL_P (expr))
{
@@ -2233,6 +2214,12 @@ write_expression (tree expr)
write_string ("st");
write_type (TREE_OPERAND (expr, 0));
}
+ else if (TREE_CODE (expr) == ALIGNOF_EXPR
+ && TYPE_P (TREE_OPERAND (expr, 0)))
+ {
+ write_string ("at");
+ write_type (TREE_OPERAND (expr, 0));
+ }
else if (abi_version_at_least (2) && TREE_CODE (expr) == SCOPE_REF)
{
tree scope = TREE_OPERAND (expr, 0);
@@ -2300,9 +2287,16 @@ write_expression (tree expr)
write_template_args (template_args);
}
}
+ else if (TREE_CODE (expr) == INDIRECT_REF
+ && TREE_TYPE (TREE_OPERAND (expr, 0))
+ && TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == REFERENCE_TYPE)
+ {
+ write_expression (TREE_OPERAND (expr, 0));
+ }
else
{
int i;
+ const char *name;
/* When we bind a variable or function to a non-type template
argument with reference type, we create an ADDR_EXPR to show
@@ -2340,7 +2334,14 @@ write_expression (tree expr)
}
/* If it wasn't any of those, recursively expand the expression. */
- write_string (operator_name_info[(int) code].mangled_name);
+ name = operator_name_info[(int) code].mangled_name;
+ if (name == NULL)
+ {
+ sorry ("mangling %C", code);
+ return;
+ }
+ else
+ write_string (name);
switch (code)
{
@@ -2353,23 +2354,29 @@ write_expression (tree expr)
case CAST_EXPR:
write_type (TREE_TYPE (expr));
- /* There is no way to mangle a zero-operand cast like
- "T()". */
- if (!TREE_OPERAND (expr, 0))
- sorry ("zero-operand casts cannot be mangled due to a defect "
- "in the C++ ABI");
- else if (list_length (TREE_OPERAND (expr, 0)) > 1)
- sorry ("mangling function-style cast with more than one argument");
- else
+ if (list_length (TREE_OPERAND (expr, 0)) == 1)
write_expression (TREE_VALUE (TREE_OPERAND (expr, 0)));
+ else
+ {
+ tree args = TREE_OPERAND (expr, 0);
+ write_char ('_');
+ for (; args; args = TREE_CHAIN (args))
+ write_expression (TREE_VALUE (args));
+ write_char ('E');
+ }
break;
+ /* FIXME these should have a distinct mangling. */
case STATIC_CAST_EXPR:
case CONST_CAST_EXPR:
write_type (TREE_TYPE (expr));
write_expression (TREE_OPERAND (expr, 0));
break;
+ case NEW_EXPR:
+ sorry ("mangling new-expression");
+ break;
+
/* Handle pointers-to-members specially. */
case SCOPE_REF:
write_type (TREE_OPERAND (expr, 0));
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 9009ede94b0..145dc48b09f 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -437,7 +437,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
BLOCK_VARS (fn_block) = a;
DECL_INITIAL (thunk_fndecl) = fn_block;
init_function_start (thunk_fndecl);
- crtl->is_thunk = 1;
+ cfun->is_thunk = 1;
assemble_start_function (thunk_fndecl, fnname);
targetm.asm_out.output_mi_thunk (asm_out_file, thunk_fndecl,
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index b31742c669c..5a92dc6ed89 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -813,9 +813,6 @@ pushdecl_maybe_friend (tree x, bool is_friend)
}
}
- if (TREE_CODE (x) == FUNCTION_DECL || DECL_FUNCTION_TEMPLATE_P (x))
- check_default_args (x);
-
check_template_shadow (x);
/* If this is a function conjured up by the back end, massage it
@@ -826,11 +823,10 @@ pushdecl_maybe_friend (tree x, bool is_friend)
SET_DECL_LANGUAGE (x, lang_c);
}
+ t = x;
if (DECL_NON_THUNK_FUNCTION_P (x) && ! DECL_FUNCTION_MEMBER_P (x))
{
t = push_overloaded_decl (x, PUSH_LOCAL, is_friend);
- if (t != x)
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
if (!namespace_bindings_p ())
/* We do not need to create a binding for this name;
push_overloaded_decl will have already done so if
@@ -842,9 +838,14 @@ pushdecl_maybe_friend (tree x, bool is_friend)
t = push_overloaded_decl (x, PUSH_GLOBAL, is_friend);
if (t == x)
add_decl_to_level (x, NAMESPACE_LEVEL (CP_DECL_CONTEXT (t)));
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
}
+ if (TREE_CODE (x) == FUNCTION_DECL || DECL_FUNCTION_TEMPLATE_P (x))
+ check_default_args (x);
+
+ if (t != x || DECL_FUNCTION_TEMPLATE_P (t))
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
+
/* If declaring a type as a typedef, copy the type (unless we're
at line 0), and install this TYPE_DECL as the new type's typedef
name. See the extensive comment in ../c-decl.c (pushdecl). */
@@ -1031,7 +1032,10 @@ pushdecl_maybe_friend (tree x, bool is_friend)
}
}
- if (warn_shadow && !err)
+ if (warn_shadow && !err
+ /* Don't complain about the parms we push and then pop
+ while tentatively parsing a function declarator. */
+ && !(TREE_CODE (x) == PARM_DECL && DECL_CONTEXT (x) == NULL_TREE))
{
warning (OPT_Wshadow, "declaration of %q#D shadows a parameter", x);
warning (OPT_Wshadow, "%Jshadowed declaration is here", oldlocal);
@@ -3337,7 +3341,8 @@ do_namespace_alias (tree alias, tree name_space)
pushdecl (alias);
/* Emit debug info for namespace alias. */
- (*debug_hooks->global_decl) (alias);
+ if (!building_stmt_tree ())
+ (*debug_hooks->global_decl) (alias);
}
/* Like pushdecl, only it places X in the current namespace,
@@ -5386,7 +5391,12 @@ cp_emit_debug_info_for_using (tree t, tree context)
/* FIXME: Handle TEMPLATE_DECLs. */
for (t = OVL_CURRENT (t); t; t = OVL_NEXT (t))
if (TREE_CODE (t) != TEMPLATE_DECL)
- (*debug_hooks->imported_module_or_decl) (t, NULL_TREE, context, false);
+ {
+ if (building_stmt_tree ())
+ add_stmt (build_stmt (USING_STMT, t));
+ else
+ (*debug_hooks->imported_module_or_decl) (t, NULL_TREE, context, false);
+ }
}
#include "gt-cp-name-lookup.h"
diff --git a/gcc/cp/operators.def b/gcc/cp/operators.def
index 698f0de43f4..20d811b812b 100644
--- a/gcc/cp/operators.def
+++ b/gcc/cp/operators.def
@@ -94,7 +94,7 @@ DEF_SIMPLE_OPERATOR ("++", PREINCREMENT_EXPR, "pp", 1)
DEF_SIMPLE_OPERATOR ("--", PREDECREMENT_EXPR, "mm", 1)
DEF_SIMPLE_OPERATOR ("sizeof", SIZEOF_EXPR, "sz", 1)
/* These are extensions. */
-DEF_SIMPLE_OPERATOR ("alignof", ALIGNOF_EXPR, "v17alignof", 1)
+DEF_SIMPLE_OPERATOR ("alignof", ALIGNOF_EXPR, "az", 1)
DEF_SIMPLE_OPERATOR ("__imag__", IMAGPART_EXPR, "v18__imag__", 1)
DEF_SIMPLE_OPERATOR ("__real__", REALPART_EXPR, "v18__real__", 1)
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index f07df913447..02a96ccc4a4 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -77,6 +77,8 @@ typedef struct cp_token GTY (())
KEYWORD is RID_MAX) iff this name was looked up and found to be
ambiguous. An error has already been reported. */
BOOL_BITFIELD ambiguous_p : 1;
+ /* The location at which this token was found. */
+ location_t location;
/* The value associated with this token, if any. */
union cp_token_value {
/* Used for CPP_NESTED_NAME_SPECIFIER and CPP_TEMPLATE_ID. */
@@ -84,8 +86,6 @@ typedef struct cp_token GTY (())
/* Use for all other tokens. */
tree GTY((tag ("0"))) value;
} GTY((desc ("(%1.type == CPP_TEMPLATE_ID) || (%1.type == CPP_NESTED_NAME_SPECIFIER)"))) u;
- /* The location at which this token was found. */
- location_t location;
} cp_token;
/* We use a stack of token pointer for saving token sets. */
@@ -95,8 +95,7 @@ DEF_VEC_ALLOC_P (cp_token_position,heap);
static cp_token eof_token =
{
- CPP_EOF, RID_MAX, 0, PRAGMA_NONE, false, 0, { NULL },
- 0
+ CPP_EOF, RID_MAX, 0, PRAGMA_NONE, false, 0, 0, { NULL }
};
/* The cp_lexer structure represents the C++ lexer. It is responsible
@@ -1616,7 +1615,7 @@ static tree cp_parser_delete_expression
static tree cp_parser_cast_expression
(cp_parser *, bool, bool, cp_id_kind *);
static tree cp_parser_binary_expression
- (cp_parser *, bool, enum cp_parser_prec, cp_id_kind *);
+ (cp_parser *, bool, bool, enum cp_parser_prec, cp_id_kind *);
static tree cp_parser_question_colon_clause
(cp_parser *, tree);
static tree cp_parser_assignment_expression
@@ -4732,7 +4731,8 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
}
koenig_p = false;
- if (idk == CP_ID_KIND_UNQUALIFIED)
+ if (idk == CP_ID_KIND_UNQUALIFIED
+ || idk == CP_ID_KIND_TEMPLATE_ID)
{
if (TREE_CODE (postfix_expression) == IDENTIFIER_NODE)
{
@@ -6215,6 +6215,7 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p, bool cast_p,
static tree
cp_parser_binary_expression (cp_parser* parser, bool cast_p,
+ bool no_toplevel_fold_p,
enum cp_parser_prec prec,
cp_id_kind * pidk)
{
@@ -6297,6 +6298,7 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p,
goto get_rhs;
pop:
+ lookahead_prec = new_prec;
/* If the stack is not empty, we have parsed into LHS the right side
(`4' in the example above) of an expression we had suspended.
We can use the information on the stack to recover the LHS (`3')
@@ -6321,8 +6323,14 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p,
pass the correct tree_code unless the unary expression was
surrounded by parentheses.
*/
- lhs = build_x_binary_op (tree_type, lhs, lhs_type, rhs, rhs_type,
- &overloaded_p, tf_warning_or_error);
+ if (no_toplevel_fold_p
+ && lookahead_prec <= prec
+ && sp == stack
+ && TREE_CODE_CLASS (tree_type) == tcc_comparison)
+ lhs = build2 (tree_type, boolean_type_node, lhs, rhs);
+ else
+ lhs = build_x_binary_op (tree_type, lhs, lhs_type, rhs, rhs_type,
+ &overloaded_p, tf_warning_or_error);
lhs_type = tree_type;
/* If the binary operator required the use of an overloaded operator,
@@ -6408,7 +6416,8 @@ cp_parser_assignment_expression (cp_parser* parser, bool cast_p,
else
{
/* Parse the binary expressions (logical-or-expression). */
- expr = cp_parser_binary_expression (parser, cast_p, PREC_NOT_OPERATOR, pidk);
+ expr = cp_parser_binary_expression (parser, cast_p, false,
+ PREC_NOT_OPERATOR, pidk);
/* If the next token is a `?' then we're actually looking at a
conditional-expression. */
if (cp_lexer_next_token_is (parser->lexer, CPP_QUERY))
@@ -10882,7 +10891,6 @@ cp_parser_explicit_specialization (cp_parser* parser)
if (!begin_specialization ())
{
end_specialization ();
- cp_parser_skip_to_end_of_block_or_statement (parser);
return;
}
@@ -13268,6 +13276,13 @@ cp_parser_direct_declarator (cp_parser* parser,
&non_constant_p);
if (!non_constant_p)
bounds = fold_non_dependent_expr (bounds);
+ else if (processing_template_decl)
+ {
+ /* Remember this wasn't a constant-expression. */
+ bounds = build_nop (TREE_TYPE (bounds), bounds);
+ TREE_SIDE_EFFECTS (bounds) = 1;
+ }
+
/* Normally, the array bound must be an integral constant
expression. However, as an extension, we allow VLAs
in function scopes. */
@@ -18290,6 +18305,11 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
/* Parse the assignment-expression. */
parsed_arg = cp_parser_assignment_expression (parser, /*cast_p=*/false, NULL);
+ if (parsed_arg == error_mark_node)
+ {
+ cp_parser_pop_lexer (parser);
+ continue;
+ }
if (!processing_template_decl)
parsed_arg = check_default_argument (TREE_VALUE (parm), parsed_arg);
@@ -21004,41 +21024,39 @@ cp_parser_omp_flush (cp_parser *parser, cp_token *pragma_tok)
static tree
cp_parser_omp_for_cond (cp_parser *parser, tree decl)
{
- tree lhs = cp_parser_cast_expression (parser, false, false, NULL), rhs;
- enum tree_code op;
- cp_token *token;
+ tree cond = cp_parser_binary_expression (parser, false, true,
+ PREC_NOT_OPERATOR, NULL);
+ bool overloaded_p;
- if (lhs != decl)
+ if (cond == error_mark_node
+ || cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON))
{
cp_parser_skip_to_end_of_statement (parser);
return error_mark_node;
}
- token = cp_lexer_peek_token (parser->lexer);
- op = binops_by_token [token->type].tree_type;
- switch (op)
+ switch (TREE_CODE (cond))
{
- case LT_EXPR:
- case LE_EXPR:
case GT_EXPR:
case GE_EXPR:
+ case LT_EXPR:
+ case LE_EXPR:
break;
default:
- cp_parser_skip_to_end_of_statement (parser);
return error_mark_node;
}
- cp_lexer_consume_token (parser->lexer);
- rhs = cp_parser_binary_expression (parser, false,
- PREC_RELATIONAL_EXPRESSION, NULL);
- if (rhs == error_mark_node
- || cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON))
- {
- cp_parser_skip_to_end_of_statement (parser);
- return error_mark_node;
- }
+ /* If decl is an iterator, preserve LHS and RHS of the relational
+ expr until finish_omp_for. */
+ if (decl
+ && (type_dependent_expression_p (decl)
+ || CLASS_TYPE_P (TREE_TYPE (decl))))
+ return cond;
- return build2 (op, boolean_type_node, lhs, rhs);
+ return build_x_binary_op (TREE_CODE (cond),
+ TREE_OPERAND (cond, 0), ERROR_MARK,
+ TREE_OPERAND (cond, 1), ERROR_MARK,
+ &overloaded_p, tf_warning_or_error);
}
/* Helper function, to parse omp for increment expression. */
@@ -21087,7 +21105,7 @@ cp_parser_omp_for_incr (cp_parser *parser, tree decl)
return build2 (MODIFY_EXPR, TREE_TYPE (decl), decl, rhs);
}
- lhs = cp_parser_binary_expression (parser, false,
+ lhs = cp_parser_binary_expression (parser, false, false,
PREC_ADDITIVE_EXPRESSION, NULL);
token = cp_lexer_peek_token (parser->lexer);
decl_first = lhs == decl;
@@ -21101,7 +21119,7 @@ cp_parser_omp_for_incr (cp_parser *parser, tree decl)
{
op = token->type == CPP_PLUS ? PLUS_EXPR : MINUS_EXPR;
cp_lexer_consume_token (parser->lexer);
- rhs = cp_parser_binary_expression (parser, false,
+ rhs = cp_parser_binary_expression (parser, false, false,
PREC_ADDITIVE_EXPRESSION, NULL);
token = cp_lexer_peek_token (parser->lexer);
if (token->type == CPP_PLUS || token->type == CPP_MINUS || decl_first)
@@ -21410,16 +21428,7 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses)
cond = NULL;
if (cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON))
- {
- /* If decl is an iterator, preserve LHS and RHS of the relational
- expr until finish_omp_for. */
- if (decl
- && (type_dependent_expression_p (decl)
- || CLASS_TYPE_P (TREE_TYPE (decl))))
- cond = cp_parser_omp_for_cond (parser, decl);
- else
- cond = cp_parser_condition (parser);
- }
+ cond = cp_parser_omp_for_cond (parser, decl);
cp_parser_require (parser, CPP_SEMICOLON, "%<;%>");
incr = NULL;
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 8ae4ed511cc..5092c72b177 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -174,6 +174,7 @@ static tree tsubst (tree, tree, tsubst_flags_t, tree);
static tree tsubst_expr (tree, tree, tsubst_flags_t, tree, bool);
static tree tsubst_copy (tree, tree, tsubst_flags_t, tree);
static tree tsubst_pack_expansion (tree, tree, tsubst_flags_t, tree);
+static tree tsubst_decl (tree, tree, tsubst_flags_t);
/* Make the current scope suitable for access checking when we are
processing T. T can be FUNCTION_DECL for instantiated function
@@ -2217,17 +2218,21 @@ check_explicit_specialization (tree declarator,
the specialization of it. */
if (tsk == tsk_template)
{
+ tree result = DECL_TEMPLATE_RESULT (tmpl);
SET_DECL_TEMPLATE_SPECIALIZATION (tmpl);
- DECL_INITIAL (DECL_TEMPLATE_RESULT (tmpl)) = NULL_TREE;
+ DECL_INITIAL (result) = NULL_TREE;
if (have_def)
{
+ tree parm;
DECL_SOURCE_LOCATION (tmpl) = DECL_SOURCE_LOCATION (decl);
- DECL_SOURCE_LOCATION (DECL_TEMPLATE_RESULT (tmpl))
+ DECL_SOURCE_LOCATION (result)
= DECL_SOURCE_LOCATION (decl);
/* We want to use the argument list specified in the
definition, not in the original declaration. */
- DECL_ARGUMENTS (DECL_TEMPLATE_RESULT (tmpl))
- = DECL_ARGUMENTS (decl);
+ DECL_ARGUMENTS (result) = DECL_ARGUMENTS (decl);
+ for (parm = DECL_ARGUMENTS (result); parm;
+ parm = TREE_CHAIN (parm))
+ DECL_CONTEXT (parm) = result;
}
return tmpl;
}
@@ -7431,6 +7436,37 @@ tsubst_template_arg (tree t, tree args, tsubst_flags_t complain, tree in_decl)
return r;
}
+/* Give a chain SPEC_PARM of PARM_DECLs, pack them into a
+ NONTYPE_ARGUMENT_PACK. */
+
+static tree
+make_fnparm_pack (tree spec_parm)
+{
+ /* Collect all of the extra "packed" parameters into an
+ argument pack. */
+ tree parmvec;
+ tree parmtypevec;
+ tree argpack = make_node (NONTYPE_ARGUMENT_PACK);
+ tree argtypepack = make_node (TYPE_ARGUMENT_PACK);
+ int i, len = list_length (spec_parm);
+
+ /* Fill in PARMVEC and PARMTYPEVEC with all of the parameters. */
+ parmvec = make_tree_vec (len);
+ parmtypevec = make_tree_vec (len);
+ for (i = 0; i < len; i++, spec_parm = TREE_CHAIN (spec_parm))
+ {
+ TREE_VEC_ELT (parmvec, i) = spec_parm;
+ TREE_VEC_ELT (parmtypevec, i) = TREE_TYPE (spec_parm);
+ }
+
+ /* Build the argument packs. */
+ SET_ARGUMENT_PACK_ARGS (argpack, parmvec);
+ SET_ARGUMENT_PACK_ARGS (argtypepack, parmtypevec);
+ TREE_TYPE (argpack) = argtypepack;
+
+ return argpack;
+}
+
/* Substitute ARGS into T, which is an pack expansion
(i.e. TYPE_PACK_EXPANSION or EXPR_PACK_EXPANSION). Returns a
TREE_VEC with the substituted arguments, a PACK_EXPANSION_* node
@@ -7445,6 +7481,7 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain,
tree first_arg_pack; int i, len = -1;
tree result;
int incomplete = 0;
+ bool very_local_specializations = false;
gcc_assert (PACK_EXPANSION_P (t));
pattern = PACK_EXPANSION_PATTERN (t);
@@ -7461,7 +7498,18 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain,
tree orig_arg = NULL_TREE;
if (TREE_CODE (parm_pack) == PARM_DECL)
- arg_pack = retrieve_local_specialization (parm_pack);
+ {
+ arg_pack = retrieve_local_specialization (parm_pack);
+ if (arg_pack == NULL_TREE)
+ {
+ /* This can happen for a parameter name used later in a function
+ declaration (such as in a late-specified return type). Just
+ make a dummy decl, since it's only used for its type. */
+ gcc_assert (skip_evaluation);
+ arg_pack = tsubst_decl (parm_pack, args, complain);
+ arg_pack = make_fnparm_pack (arg_pack);
+ }
+ }
else
{
int level, idx, levels;
@@ -7555,6 +7603,17 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain,
if (len < 0)
return error_mark_node;
+ if (!local_specializations)
+ {
+ /* We're in a late-specified return type, so we don't have a local
+ specializations table. Create one for doing this expansion. */
+ very_local_specializations = true;
+ local_specializations = htab_create (37,
+ hash_local_specialization,
+ eq_local_specializations,
+ NULL);
+ }
+
/* For each argument in each argument pack, substitute into the
pattern. */
result = make_tree_vec (len + incomplete);
@@ -7616,7 +7675,7 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain,
break;
}
}
-
+
/* Update ARGS to restore the substitution from parameter packs to
their argument packs. */
for (pack = packs; pack; pack = TREE_CHAIN (pack))
@@ -7639,6 +7698,12 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain,
}
}
+ if (very_local_specializations)
+ {
+ htab_delete (local_specializations);
+ local_specializations = NULL;
+ }
+
return result;
}
@@ -9080,8 +9145,19 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
/*integral_constant_expression_p=*/false);
max = fold_decl_constant_value (max);
+ /* If we're in a partial instantiation, preserve the magic NOP_EXPR
+ with TREE_SIDE_EFFECTS that indicates this is not an integral
+ constant expression. */
+ if (processing_template_decl
+ && TREE_SIDE_EFFECTS (omax) && TREE_CODE (omax) == NOP_EXPR)
+ {
+ gcc_assert (TREE_CODE (max) == NOP_EXPR);
+ TREE_SIDE_EFFECTS (max) = 1;
+ }
+
if (TREE_CODE (max) != INTEGER_CST
&& !at_function_scope_p ()
+ && !TREE_SIDE_EFFECTS (max)
&& !value_dependent_expression_p (max))
{
if (complain & tf_error)
@@ -9898,16 +9974,14 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
if (r == NULL)
{
/* This can happen for a parameter name used later in a function
- declaration (such as in a late-specified return type).
- Replace it with an arbitrary expression with the same type
- (*(T*)0). This should only occur in an unevaluated context
- (i.e. decltype). */
- gcc_assert (skip_evaluation);
- r = non_reference (TREE_TYPE (t));
- r = tsubst (r, args, complain, in_decl);
- r = build_pointer_type (r);
- r = build_c_cast (r, null_node);
- return cp_build_indirect_ref (r, NULL, tf_warning_or_error);
+ declaration (such as in a late-specified return type). Just
+ make a dummy decl, since it's only used for its type. */
+ gcc_assert (skip_evaluation);
+ r = tsubst_decl (t, args, complain);
+ /* Give it the template pattern as its context; its true context
+ hasn't been instantiated yet and this is good enough for
+ mangling. */
+ DECL_CONTEXT (r) = DECL_CONTEXT (t);
}
if (TREE_CODE (r) == ARGUMENT_PACK_SELECT)
@@ -15464,37 +15538,12 @@ instantiate_decl (tree d, int defer_ok,
}
if (tmpl_parm && FUNCTION_PARAMETER_PACK_P (tmpl_parm))
{
- /* Collect all of the extra "packed" parameters into an
- argument pack. */
- tree parmvec;
- tree parmtypevec;
- tree argpack = make_node (NONTYPE_ARGUMENT_PACK);
- tree argtypepack = make_node (TYPE_ARGUMENT_PACK);
- int i, len = 0;
- tree t;
-
- /* Count how many parameters remain. */
- for (t = spec_parm; t; t = TREE_CHAIN (t))
- len++;
-
- /* Fill in PARMVEC and PARMTYPEVEC with all of the parameters. */
- parmvec = make_tree_vec (len);
- parmtypevec = make_tree_vec (len);
- for(i = 0; i < len; i++, spec_parm = TREE_CHAIN (spec_parm))
- {
- TREE_VEC_ELT (parmvec, i) = spec_parm;
- TREE_VEC_ELT (parmtypevec, i) = TREE_TYPE (spec_parm);
- }
-
- /* Build the argument packs. */
- SET_ARGUMENT_PACK_ARGS (argpack, parmvec);
- SET_ARGUMENT_PACK_ARGS (argtypepack, parmtypevec);
- TREE_TYPE (argpack) = argtypepack;
-
/* Register the (value) argument pack as a specialization of
TMPL_PARM, then move on. */
+ tree argpack = make_fnparm_pack (spec_parm);
register_local_specialization (argpack, tmpl_parm);
tmpl_parm = TREE_CHAIN (tmpl_parm);
+ spec_parm = NULL_TREE;
}
gcc_assert (!spec_parm);
@@ -15970,9 +16019,9 @@ dependent_type_p_r (tree type)
&& !TREE_CONSTANT (TYPE_MAX_VALUE (type)))
{
/* If this is the TYPE_DOMAIN of an array type, consider it
- dependent. */
- return (value_dependent_expression_p (TYPE_MAX_VALUE (type))
- || type_dependent_expression_p (TYPE_MAX_VALUE (type)));
+ dependent. We already checked for value-dependence in
+ compute_array_index_type. */
+ return type_dependent_expression_p (TYPE_MAX_VALUE (type));
}
/* -- a template-id in which either the template name is a template
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 40dddd6940b..33dd83cb3b4 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -945,8 +945,6 @@ finish_switch_cond (tree cond, tree switch_stmt)
tree orig_type = NULL;
if (!processing_template_decl)
{
- tree index;
-
/* Convert the condition to an integer or enumeration type. */
cond = build_expr_type_conversion (WANT_INT | WANT_ENUM, cond, true);
if (cond == NULL_TREE)
@@ -963,18 +961,6 @@ finish_switch_cond (tree cond, tree switch_stmt)
cond = perform_integral_promotions (cond);
cond = maybe_cleanup_point_expr (cond);
}
-
- if (cond != error_mark_node)
- {
- index = get_unwidened (cond, NULL_TREE);
- /* We can't strip a conversion from a signed type to an unsigned,
- because if we did, int_fits_type_p would do the wrong thing
- when checking case values for being in range,
- and it's too hard to do the right thing. */
- if (TYPE_UNSIGNED (TREE_TYPE (cond))
- == TYPE_UNSIGNED (TREE_TYPE (index)))
- cond = index;
- }
}
if (check_for_bare_parameter_packs (cond))
cond = error_mark_node;
@@ -1801,6 +1787,13 @@ perform_koenig_lookup (tree fn, tree args)
{
tree identifier = NULL_TREE;
tree functions = NULL_TREE;
+ tree tmpl_args = NULL_TREE;
+
+ if (TREE_CODE (fn) == TEMPLATE_ID_EXPR)
+ {
+ tmpl_args = TREE_OPERAND (fn, 1);
+ fn = TREE_OPERAND (fn, 0);
+ }
/* Find the name of the overloaded function. */
if (TREE_CODE (fn) == IDENTIFIER_NODE)
@@ -1820,7 +1813,8 @@ perform_koenig_lookup (tree fn, tree args)
Do Koenig lookup -- unless any of the arguments are
type-dependent. */
- if (!any_type_dependent_arguments_p (args))
+ if (!any_type_dependent_arguments_p (args)
+ && !any_dependent_template_arguments_p (tmpl_args))
{
fn = lookup_arg_dependent (identifier, functions, args);
if (!fn)
@@ -1828,6 +1822,9 @@ perform_koenig_lookup (tree fn, tree args)
fn = unqualified_fn_lookup_error (identifier);
}
+ if (fn && tmpl_args)
+ fn = build_nt (TEMPLATE_ID_EXPR, fn, tmpl_args);
+
return fn;
}
@@ -3929,6 +3926,9 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv,
case GE_EXPR:
case LT_EXPR:
case LE_EXPR:
+ if (TREE_OPERAND (cond, 1) == iter)
+ cond = build2 (swap_tree_comparison (TREE_CODE (cond)),
+ TREE_TYPE (cond), iter, TREE_OPERAND (cond, 0));
if (TREE_OPERAND (cond, 0) != iter)
cond = error_mark_node;
else
@@ -4593,8 +4593,6 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p)
break;
}
}
- else
- type = describable_type (expr);
if (type && !type_uses_auto (type))
return type;
@@ -4910,6 +4908,24 @@ trait_expr_value (cp_trait_kind kind, tree type1, tree type2)
}
}
+/* Returns true if TYPE is a complete type, an array of unknown bound,
+ or (possibly cv-qualified) void, returns false otherwise. */
+
+static bool
+check_trait_type (tree type)
+{
+ if (COMPLETE_TYPE_P (type))
+ return true;
+
+ if (TREE_CODE (type) == ARRAY_TYPE && !TYPE_DOMAIN (type))
+ return true;
+
+ if (VOID_TYPE_P (type))
+ return true;
+
+ return false;
+}
+
/* Process a trait expression. */
tree
@@ -4958,14 +4974,45 @@ finish_trait_expr (cp_trait_kind kind, tree type1, tree type2)
if (type2)
complete_type (type2);
- /* The only required diagnostic. */
- if (kind == CPTK_IS_BASE_OF
- && NON_UNION_CLASS_TYPE_P (type1) && NON_UNION_CLASS_TYPE_P (type2)
- && !same_type_ignoring_top_level_qualifiers_p (type1, type2)
- && !COMPLETE_TYPE_P (type2))
+ switch (kind)
{
- error ("incomplete type %qT not allowed", type2);
- return error_mark_node;
+ case CPTK_HAS_NOTHROW_ASSIGN:
+ case CPTK_HAS_TRIVIAL_ASSIGN:
+ case CPTK_HAS_NOTHROW_CONSTRUCTOR:
+ case CPTK_HAS_TRIVIAL_CONSTRUCTOR:
+ case CPTK_HAS_NOTHROW_COPY:
+ case CPTK_HAS_TRIVIAL_COPY:
+ case CPTK_HAS_TRIVIAL_DESTRUCTOR:
+ case CPTK_HAS_VIRTUAL_DESTRUCTOR:
+ case CPTK_IS_ABSTRACT:
+ case CPTK_IS_EMPTY:
+ case CPTK_IS_POD:
+ case CPTK_IS_POLYMORPHIC:
+ if (!check_trait_type (type1))
+ {
+ error ("incomplete type %qT not allowed", type1);
+ return error_mark_node;
+ }
+ break;
+
+ case CPTK_IS_BASE_OF:
+ if (NON_UNION_CLASS_TYPE_P (type1) && NON_UNION_CLASS_TYPE_P (type2)
+ && !same_type_ignoring_top_level_qualifiers_p (type1, type2)
+ && !COMPLETE_TYPE_P (type2))
+ {
+ error ("incomplete type %qT not allowed", type2);
+ return error_mark_node;
+ }
+ break;
+
+ case CPTK_IS_CLASS:
+ case CPTK_IS_ENUM:
+ case CPTK_IS_UNION:
+ break;
+
+ case CPTK_IS_CONVERTIBLE_TO:
+ default:
+ gcc_unreachable ();
}
return (trait_expr_value (kind, type1, type2)
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index de19148fc18..66fc4c8ba99 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1175,8 +1175,9 @@ is_overloaded_fn (tree x)
x = TREE_OPERAND (x, 1);
if (BASELINK_P (x))
x = BASELINK_FUNCTIONS (x);
- if (TREE_CODE (x) == TEMPLATE_ID_EXPR
- || DECL_FUNCTION_TEMPLATE_P (OVL_CURRENT (x))
+ if (TREE_CODE (x) == TEMPLATE_ID_EXPR)
+ x = TREE_OPERAND (x, 0);
+ if (DECL_FUNCTION_TEMPLATE_P (OVL_CURRENT (x))
|| (TREE_CODE (x) == OVERLOAD && OVL_CHAIN (x)))
return 2;
return (TREE_CODE (x) == FUNCTION_DECL
@@ -1202,6 +1203,8 @@ get_first_fn (tree from)
from = TREE_OPERAND (from, 1);
if (BASELINK_P (from))
from = BASELINK_FUNCTIONS (from);
+ if (TREE_CODE (from) == TEMPLATE_ID_EXPR)
+ from = TREE_OPERAND (from, 0);
return OVL_CURRENT (from);
}
@@ -1878,9 +1881,8 @@ cp_tree_equal (tree t1, tree t2)
case PARM_DECL:
/* For comparing uses of parameters in late-specified return types
with an out-of-class definition of the function. */
- if ((!DECL_CONTEXT (t1) || !DECL_CONTEXT (t2))
- && same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))
- && DECL_NAME (t1) == DECL_NAME (t2))
+ if (same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))
+ && parm_index (t1) == parm_index (t2))
return true;
else
return false;
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 637076554fb..747c964706c 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -677,18 +677,18 @@ check_narrowing (tree type, tree init)
{
if (TYPE_PRECISION (type) < TYPE_PRECISION (ftype))
{
- ok = false;
if (TREE_CODE (init) == REAL_CST)
{
+ /* Issue 703: Loss of precision is OK as long as the value is
+ within the representable range of the new type. */
+ REAL_VALUE_TYPE r;
d = TREE_REAL_CST (init);
- if (exact_real_truncate (TYPE_MODE (type), &d)
- /* FIXME: As a temporary workaround for PR 36963, don't
- complain about narrowing from a floating
- literal. Hopefully this will be resolved at the
- September 2008 C++ meeting. */
- || !was_decl)
- ok = true;
+ real_convert (&r, TYPE_MODE (type), &d);
+ if (real_isinf (&r))
+ ok = false;
}
+ else
+ ok = false;
}
}
else if (INTEGRAL_OR_ENUMERATION_TYPE_P (ftype)
diff --git a/gcc/cse.c b/gcc/cse.c
index bab0908c984..04f52fb7d77 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -3464,6 +3464,7 @@ fold_rtx (rtx x, rtx insn)
int is_shift
= (code == ASHIFT || code == ASHIFTRT || code == LSHIFTRT);
rtx y, inner_const, new_const;
+ rtx canon_const_arg1 = const_arg1;
enum rtx_code associate_code;
if (is_shift
@@ -3471,8 +3472,9 @@ fold_rtx (rtx x, rtx insn)
|| INTVAL (const_arg1) < 0))
{
if (SHIFT_COUNT_TRUNCATED)
- const_arg1 = GEN_INT (INTVAL (const_arg1)
- & (GET_MODE_BITSIZE (mode) - 1));
+ canon_const_arg1 = GEN_INT (INTVAL (const_arg1)
+ & (GET_MODE_BITSIZE (mode)
+ - 1));
else
break;
}
@@ -3531,7 +3533,8 @@ fold_rtx (rtx x, rtx insn)
associate_code = (is_shift || code == MINUS ? PLUS : code);
new_const = simplify_binary_operation (associate_code, mode,
- const_arg1, inner_const);
+ canon_const_arg1,
+ inner_const);
if (new_const == 0)
break;
diff --git a/gcc/defaults.h b/gcc/defaults.h
index fbb13accc08..217c0d94a56 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -944,6 +944,11 @@ along with GCC; see the file COPYING3. If not see
((TYPE) ? LOCAL_ALIGNMENT ((TYPE), (ALIGN)) : (ALIGN))
#endif
+#ifndef LOCAL_DECL_ALIGNMENT
+#define LOCAL_DECL_ALIGNMENT(DECL) \
+ LOCAL_ALIGNMENT (TREE_TYPE (DECL), DECL_ALIGN (DECL))
+#endif
+
/* Alignment value for attribute ((aligned)). */
#ifndef ATTRIBUTE_ALIGNED_VALUE
#define ATTRIBUTE_ALIGNED_VALUE BIGGEST_ALIGNMENT
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 6888fb42ee3..d8ad4a06698 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -1,6 +1,6 @@
/* Scanning of rtl for dataflow analysis.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008 Free Software Foundation, Inc.
+ 2008, 2009 Free Software Foundation, Inc.
Originally contributed by Michael P. Hayes
(m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com)
Major rewrite contributed by Danny Berlin (dberlin@dberlin.org)
@@ -85,12 +85,12 @@ static HARD_REG_SET elim_reg_set;
struct df_collection_rec
{
df_ref * def_vec;
- unsigned int next_def;
df_ref * use_vec;
+ unsigned int next_def;
unsigned int next_use;
df_ref * eq_use_vec;
- unsigned int next_eq_use;
struct df_mw_hardreg **mw_vec;
+ unsigned int next_eq_use;
unsigned int next_mw;
};
diff --git a/gcc/df.h b/gcc/df.h
index dd00d9284d1..639c52157b4 100644
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -1,6 +1,6 @@
/* Form lists of pseudo register references for autoinc optimization
for GNU compiler. This is part of flow optimization.
- Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008
+ Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Originally contributed by Michael P. Hayes
(m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com)
@@ -535,7 +535,6 @@ struct df
struct dataflow *problems_in_order[DF_LAST_PROBLEM_PLUS1];
struct dataflow *problems_by_index[DF_LAST_PROBLEM_PLUS1];
- int num_problems_defined;
/* If not NULL, this subset of blocks of the program to be
considered for analysis. At certain times, this will contain all
@@ -543,14 +542,6 @@ struct df
of if we are analyzing a subset. See analyze_subset. */
bitmap blocks_to_analyze;
- /* If this is true, then only a subset of the blocks of the program
- is considered to compute the solutions of dataflow problems. */
- bool analyze_subset;
-
- /* True if someone added or deleted something from regs_ever_live so
- that the entry and exit blocks need be reprocessed. */
- bool redo_entry_and_exit;
-
/* The following information is really the problem data for the
scanning instance but it is used too often by the other problems
to keep getting it from there. */
@@ -568,6 +559,9 @@ struct df
struct df_insn_info **insns; /* Insn table, indexed by insn UID. */
unsigned int insns_size; /* Size of insn table. */
+
+ int num_problems_defined;
+
bitmap hardware_regs_used; /* The set of hardware registers used. */
/* The set of hard regs that are in the artificial uses at the end
of a regular basic block. */
@@ -609,7 +603,15 @@ struct df
unsigned int ref_order;
/* Problem specific control information. */
- enum df_changeable_flags changeable_flags;
+ ENUM_BITFIELD (df_changeable_flags) changeable_flags : 8;
+
+ /* If this is true, then only a subset of the blocks of the program
+ is considered to compute the solutions of dataflow problems. */
+ bool analyze_subset;
+
+ /* True if someone added or deleted something from regs_ever_live so
+ that the entry and exit blocks need be reprocessed. */
+ bool redo_entry_and_exit;
};
#define DF_SCAN_BB_INFO(BB) (df_scan_get_bb_info((BB)->index))
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index f901db32fda..ad17a378d98 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2436,6 +2436,11 @@ to run as a thread. The compiler omits generate prologue/epilogue
sequences and replaces the return instruction with a @code{sleep}
instruction. This attribute is available only on fido.
+@item isr
+@cindex interrupt service routines on ARM
+Use this attribute on ARM to write Interrupt Service Routines. This is an
+alias to the @code{interrupt} attribute above.
+
@item kspisusp
@cindex User stack pointer in interrupts on the Blackfin
When used together with @code{interrupt_handler}, @code{exception_handler}
@@ -2548,7 +2553,7 @@ defined by shared libraries.
@cindex @code{ms_abi} attribute
@cindex @code{sysv_abi} attribute
-On 64-bit x86_65-*-* targets, you can use an ABI attribute to indicate
+On 64-bit x86_64-*-* targets, you can use an ABI attribute to indicate
which calling convention should be used for a function. The @code{ms_abi}
attribute tells the compiler to use the Microsoft ABI, while the
@code{sysv_abi} attribute tells the compiler to use the ABI used on
@@ -2787,7 +2792,7 @@ default). Lazy binding will send the first call via resolving code in
the loader, which might assume EAX, EDX and ECX can be clobbered, as
per the standard calling conventions. Solaris 8 is affected by this.
GNU systems with GLIBC 2.1 or higher, and FreeBSD, are believed to be
-safe since the loaders there save all registers. (Lazy binding can be
+safe since the loaders there save EAX, EDX and ECX. (Lazy binding can be
disabled with the linker or the loader if desired, to avoid the
problem.)
@@ -3064,7 +3069,7 @@ Do/do not align destination of inlined string operations.
@itemx no-recip
@cindex @code{target("recip")} attribute
Enable/disable the generation of RCPSS, RCPPS, RSQRTSS and RSQRTPS
-instructions followed an additional Newton-Rhapson step instead of
+instructions followed an additional Newton-Raphson step instead of
doing a floating point division.
@item arch=@var{ARCH}
@@ -3856,7 +3861,7 @@ struct foo
@emph{Note:} The 4.1, 4.2 and 4.3 series of GCC ignore the
@code{packed} attribute on bit-fields of type @code{char}. This has
been fixed in GCC 4.4 but the change can lead to differences in the
-structure layout. See the documention of
+structure layout. See the documentation of
@option{-Wpacked-bitfield-compat} for more information.
@item section ("@var{section-name}")
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index b0c2e849c16..6bdfbece981 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1476,6 +1476,15 @@ you can explicitly specify the directory where they are installed
shorthand assumptions are not correct, you can use the explicit
include and lib options directly.
+@item --with-host-libstdcxx=@var{linker-args}
+If you are linking with a static copy of PPL, you can use this option
+to specify how the linker should find the standard C++ library used
+internally by PPL. Typical values of @var{linker-args} might be
+@samp{-lstdc++} or @samp{-Wl,-Bstatic,-lstdc++,-Bdynamic -lm}. If you are
+linking with a shared copy of PPL, you probably do not need this
+option; shared library dependencies will cause the linker to search
+for the standard C++ library automatically.
+
@item --with-debug-prefix-map=@var{map}
Convert source directory names using @option{-fdebug-prefix-map} when
building runtime libraries. @samp{@var{map}} is a space-separated
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 6a43c02f128..7dff5247895 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -163,7 +163,7 @@ in the following sections.
@item Overall Options
@xref{Overall Options,,Options Controlling the Kind of Output}.
@gccoptlist{-c -S -E -o @var{file} -combine -pipe -pass-exit-codes @gol
--x @var{language} -v -### --help@r{[}=@var{class}@r{]} --target-help @gol
+-x @var{language} -v -### --help@r{[}=@var{class}@r{[},@dots{}@r{]]} --target-help @gol
--version -wrapper@@@var{file}}
@item C Language Options
@@ -525,6 +525,9 @@ Objective-C and Objective-C++ Dialects}.
@emph{DEC Alpha/VMS Options}
@gccoptlist{-mvms-return-codes}
+@emph{FR30 Options}
+@gccoptlist{-msmall-model -mno-lsim}
+
@emph{FRV Options}
@gccoptlist{-mgpr-32 -mgpr-64 -mfpr-32 -mfpr-64 @gol
-mhard-float -msoft-float @gol
@@ -823,6 +826,10 @@ See RS/6000 and PowerPC Options.
@emph{x86-64 Options}
See i386 and x86-64 Options.
+@emph{i386 and x86-64 Windows Options}
+@gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll
+-mnop-fun-dllimport -mthread -mwin32 -mwindows}
+
@emph{Xstormy16 Options}
@gccoptlist{-msim}
@@ -1158,11 +1165,10 @@ Print (on the standard output) a description of target-specific command
line options for each tool. For some targets extra target-specific
information may also be printed.
-@item --help=@var{class}@r{[},@var{qualifier}@r{]}
+@item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
Print (on the standard output) a description of the command line
-options understood by the compiler that fit into a specific class.
-The class can be one of @samp{optimizers}, @samp{warnings}, @samp{target},
-@samp{params}, or @var{language}:
+options understood by the compiler that fit into all specified classes
+and qualifiers. These are the supported classes:
@table @asis
@item @samp{optimizers}
@@ -1192,9 +1198,7 @@ version of GCC.
This will display the options that are common to all languages.
@end table
-It is possible to further refine the output of the @option{--help=}
-option by adding a comma separated list of qualifiers after the
-class. These can be any from the following list:
+These are the supported qualifiers:
@table @asis
@item @samp{undocumented}
@@ -1218,7 +1222,7 @@ switches supported by the compiler the following can be used:
@end smallexample
The sense of a qualifier can be inverted by prefixing it with the
-@var{^} character, so for example to display all binary warning
+@samp{^} character, so for example to display all binary warning
options (i.e., ones that are either on or off and that do not take an
argument), which have a description the following can be used:
@@ -1226,7 +1230,10 @@ argument), which have a description the following can be used:
--help=warnings,^joined,^undocumented
@end smallexample
-A class can also be used as a qualifier, although this usually
+The argument to @option{--help=} should not consist solely of inverted
+qualifiers.
+
+Combining several classes is possible, although this usually
restricts the output by so much that there is nothing to display. One
case where it does work however is when one of the classes is
@var{target}. So for example to display all the target-specific
@@ -1262,7 +1269,7 @@ options, so for example it is possible to find out which optimizations
are enabled at @option{-O2} by using:
@smallexample
--O2 --help=optimizers
+-Q -O2 --help=optimizers
@end smallexample
Alternatively you can discover which binary optimizations are enabled
@@ -4405,11 +4412,11 @@ This option works only with DWARF 2.
@item -fno-merge-debug-strings
@opindex fmerge-debug-strings
@opindex fno-merge-debug-strings
-Direct the linker to merge together strings which are identical in
-different object files. This is not supported by all assemblers or
-linker. This decreases the size of the debug information in the
-output file at the cost of increasing link processing time. This is
-on by default.
+Direct the linker to not merge together strings in the debugging
+information which are identical in different object files. Merging is
+not supported by all assemblers or linkers. Merging decreases the size
+of the debug information in the output file at the cost of increasing
+link processing time. Merging is enabled by default.
@item -fdebug-prefix-map=@var{old}=@var{new}
@opindex fdebug-prefix-map
@@ -4613,7 +4620,7 @@ Dump after the RTL instruction combination pass.
@item -fdump-rtl-compgotos
@opindex fdump-rtl-compgotos
-Dump after dumplicating the computed gotos.
+Dump after duplicating the computed gotos.
@item -fdump-rtl-ce1
@itemx -fdump-rtl-ce2
@@ -6141,7 +6148,7 @@ Matrix flattening tries to replace a m-dimensional matrix
with its equivalent n-dimensional matrix, where n < m.
This reduces the level of indirection needed for accessing the elements
of the matrix. The second optimization is matrix transposing that
-attemps to change the order of the matrix's dimensions in order to
+attempts to change the order of the matrix's dimensions in order to
improve cache locality.
Both optimizations need the @option{-fwhole-program} flag.
Transposing is enabled only if profiling information is available.
@@ -8889,11 +8896,13 @@ platform.
* Darwin Options::
* DEC Alpha Options::
* DEC Alpha/VMS Options::
+* FR30 Options::
* FRV Options::
* GNU/Linux Options::
* H8/300 Options::
* HPPA Options::
* i386 and x86-64 Options::
+* i386 and x86-64 Windows Options::
* IA-64 Options::
* M32C Options::
* M32R/D Options::
@@ -9207,10 +9216,6 @@ long_calls_off} directive. Note these switches have no effect on how
the compiler generates code to handle function calls via function
pointers.
-@item -mnop-fun-dllimport
-@opindex mnop-fun-dllimport
-Disable support for the @code{dllimport} attribute.
-
@item -msingle-pic-base
@opindex msingle-pic-base
Treat the register used for PIC addressing as read-only, rather than
@@ -10279,11 +10284,21 @@ Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
@end table
+Native Linux/GNU toolchains also support the value @samp{native},
+which selects the best architecture option for the host processor.
+@option{-mcpu=native} has no effect if GCC does not recognize
+the processor.
+
@item -mtune=@var{cpu_type}
@opindex mtune
Set only the instruction scheduling parameters for machine type
@var{cpu_type}. The instruction set is not changed.
+Native Linux/GNU toolchains also support the value @samp{native},
+which selects the best architecture option for the host processor.
+@option{-mtune=native} has no effect if GCC does not recognize
+the processor.
+
@item -mmemory-latency=@var{time}
@opindex mmemory-latency
Sets the latency the scheduler should assume for typical memory
@@ -10321,6 +10336,28 @@ Return VMS condition codes from main. The default is to return POSIX
style condition (e.g.@: error) codes.
@end table
+@node FR30 Options
+@subsection FR30 Options
+@cindex FR30 Options
+
+These options are defined specifically for the FR30 port.
+
+@table @gcctabopt
+
+@item -msmall-model
+@opindex msmall-model
+Use the small address space model. This can produce smaller code, but
+it does assume that all symbolic values and addresses will fit into a
+20-bit range.
+
+@item -mno-lsim
+@opindex mno-lsim
+Assume that run-time support has been provided and so there is no need
+to include the simulator library (@file{libsim.a}) on the linker
+command line.
+
+@end table
+
@node FRV Options
@subsection FRV Options
@cindex FRV Options
@@ -11394,7 +11431,7 @@ or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
@item -mrecip
@opindex mrecip
This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
-vectorized variants RCPPS and RSQRTPS) with an additional Newton-Rhapson step
+vectorized variants RCPPS and RSQRTPS) with an additional Newton-Raphson step
to increase precision instead of DIVSS and SQRTSS (and their vectorized
variants) for single precision floating point arguments. These instructions
are generated only when @option{-funsafe-math-optimizations} is enabled
@@ -12483,6 +12520,20 @@ Generate code for a little endian target.
@opindex m210
@opindex m340
Generate code for the 210 processor.
+
+@item -mno-lsim
+@opindex no-lsim
+Assume that run-time support has been provided and so omit the
+simulator library (@file{libsim.a)} from the linker command line.
+
+@item -mstack-increment=@var{size}
+@opindex mstack-increment
+Set the maximum amount for a single stack increment operation. Large
+values can increase the speed of programs which contain functions
+that need a large amount of stack space, but they can also trigger a
+segmentation fault if the stack is extended too much. The default
+value is 0x1000.
+
@end table
@node MIPS Options
@@ -14324,8 +14375,8 @@ On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
compile code the same as @option{-msdata=eabi}, otherwise compile code the
same as @option{-msdata=sysv}.
-@item -msdata-data
-@opindex msdata-data
+@item -msdata=data
+@opindex msdata=data
On System V.4 and embedded PowerPC systems, put small global
data in the @samp{.sdata} section. Put small uninitialized global
data in the @samp{.sbss} section. Do not use register @code{r13}
@@ -15491,6 +15542,71 @@ is defined for compatibility with Diab.
These are listed under @xref{i386 and x86-64 Options}.
+@node i386 and x86-64 Windows Options
+@subsection i386 and x86-64 Windows Options
+@cindex i386 and x86-64 Windows Options
+
+These additional options are available for Windows targets:
+
+@table @gcctabopt
+@item -mconsole
+@opindex mconsole
+This option is available for Cygwin and MinGW targets. It
+specifies that a console application is to be generated, by
+instructing the linker to set the PE header subsystem type
+required for console applications.
+This is the default behaviour for Cygwin and MinGW targets.
+
+@item -mcygwin
+@opindex mcygwin
+This option is available for Cygwin targets. It specifies that
+the Cygwin internal interface is to be used for predefined
+preprocessor macros, C runtime libraries and related linker
+paths and options. For Cygwin targets this is the default behaviour.
+This option is deprecated and will be removed in a future release.
+
+@item -mno-cygwin
+@opindex mno-cygwin
+This option is available for Cygwin targets. It specifies that
+the MinGW internal interface is to be used instead of Cygwin's, by
+setting MinGW-related predefined macros and linker paths and default
+library options.
+This option is deprecated and will be removed in a future release.
+
+@item -mdll
+@opindex mdll
+This option is available for Cygwin and MinGW targets. It
+specifies that a DLL - a dynamic link library - is to be
+generated, enabling the selection of the required runtime
+startup object and entry point.
+
+@item -mnop-fun-dllimport
+@opindex mnop-fun-dllimport
+This option is available for Cygwin and MinGW targets. It
+specifies that the dllimport attribute should be ignored.
+
+@item -mthread
+@opindex mthread
+This option is available for MinGW targets. It specifies
+that MinGW-specific thread support is to be used.
+
+@item -mwin32
+@opindex mwin32
+This option is available for Cygwin and MinGW targets. It
+specifies that the typical Windows pre-defined macros are to
+be set in the pre-processor, but does not influence the choice
+of runtime library/startup code.
+
+@item -mwindows
+@opindex mwindows
+This option is available for Cygwin and MinGW targets. It
+specifies that a GUI application is to be generated by
+instructing the linker to set the PE header subsystem type
+appropriately.
+@end table
+
+See also under @ref{i386 and x86-64 Options} for standard options.
+
@node Xstormy16 Options
@subsection Xstormy16 Options
@cindex Xstormy16 Options
@@ -15740,12 +15856,25 @@ Use it to conform to a non-default application binary interface.
@item -fno-common
@opindex fno-common
-In C, allocate even uninitialized global variables in the data section of the
-object file, rather than generating them as common blocks. This has the
-effect that if the same variable is declared (without @code{extern}) in
-two different compilations, you will get an error when you link them.
-The only reason this might be useful is if you wish to verify that the
-program will work on other systems which always work this way.
+In C code, controls the placement of uninitialized global variables.
+Unix C compilers have traditionally permitted multiple definitions of
+such variables in different compilation units by placing the variables
+in a common block.
+This is the behavior specified by @option{-fcommon}, and is the default
+for GCC on most targets.
+On the other hand, this behavior is not required by ISO C, and on some
+targets may carry a speed or code size penalty on variable references.
+The @option{-fno-common} option specifies that the compiler should place
+uninitialized global variables in the data section of the object file,
+rather than generating them as common blocks.
+This has the effect that if the same variable is declared
+(without @code{extern}) in two different compilations,
+you will get a multiple-definition error when you link them.
+In this case, you must compile with @option{-fcommon} instead.
+Compiling with @option{-fno-common} is useful on targets for which
+it provides better performance, or if you wish to verify that the
+program will work on other systems which always treat uninitialized
+variable declarations this way.
@item -fno-ident
@opindex fno-ident
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index b4fcc2de94d..f4680b69391 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -1215,6 +1215,18 @@ This macro is to set alignment of stack slot to the maximum alignment
of all possible modes which the slot may have.
@end defmac
+@defmac LOCAL_DECL_ALIGNMENT (@var{decl})
+If defined, a C expression to compute the alignment for a local
+variable @var{decl}.
+
+If this macro is not defined, then
+@code{LOCAL_ALIGNMENT (TREE_TYPE (@var{decl}), DECL_ALIGN (@var{decl}))}
+is used.
+
+One use of this macro is to increase alignment of medium-size data to
+make it all fit in fewer cache lines.
+@end defmac
+
@defmac EMPTY_FIELD_BOUNDARY
Alignment in bits to be given to a structure bit-field that follows an
empty field such as @code{int : 0;}.
diff --git a/gcc/dse.c b/gcc/dse.c
index 666a2f00164..a35f07bb113 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -1,5 +1,5 @@
/* RTL dead store elimination.
- Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
Contributed by Richard Sandiford <rsandifor@codesourcery.com>
and Kenneth Zadeck <zadeck@naturalbridge.com>
@@ -464,6 +464,14 @@ struct group_info
canonical ordering of these that is not based on addresses. */
int id;
+ /* True if there are any positions that are to be processed
+ globally. */
+ bool process_globally;
+
+ /* True if the base of this group is either the frame_pointer or
+ hard_frame_pointer. */
+ bool frame_related;
+
/* A mem wrapped around the base pointer for the group in order to
do read dependency. */
rtx base_mem;
@@ -494,14 +502,6 @@ struct group_info
the positions that are occupied by stores for this group. */
bitmap group_kill;
- /* True if there are any positions that are to be processed
- globally. */
- bool process_globally;
-
- /* True if the base of this group is either the frame_pointer or
- hard_frame_pointer. */
- bool frame_related;
-
/* The offset_map is used to map the offsets from this base into
positions in the global bitmaps. It is only created after all of
the all of stores have been scanned and we know which ones we
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 74484620856..bf254aeaaf7 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -3514,9 +3514,9 @@ typedef struct dw_loc_descr_struct GTY(())
{
dw_loc_descr_ref dw_loc_next;
enum dwarf_location_atom dw_loc_opc;
+ int dw_loc_addr;
dw_val_node dw_loc_oprnd1;
dw_val_node dw_loc_oprnd2;
- int dw_loc_addr;
}
dw_loc_descr_node;
@@ -5143,7 +5143,7 @@ static void add_byte_size_attribute (dw_die_ref, tree);
static void add_bit_offset_attribute (dw_die_ref, tree);
static void add_bit_size_attribute (dw_die_ref, tree);
static void add_prototyped_attribute (dw_die_ref, tree);
-static void add_abstract_origin_attribute (dw_die_ref, tree);
+static dw_die_ref add_abstract_origin_attribute (dw_die_ref, tree);
static void add_pure_or_virtual_attribute (dw_die_ref, tree);
static void add_src_coords_attributes (dw_die_ref, tree);
static void add_name_and_src_coords_attributes (dw_die_ref, tree);
@@ -5164,9 +5164,6 @@ static void gen_descr_array_type_die (tree, struct array_descr_info *, dw_die_re
#if 0
static void gen_entry_point_die (tree, dw_die_ref);
#endif
-static void gen_inlined_enumeration_type_die (tree, dw_die_ref);
-static void gen_inlined_structure_type_die (tree, dw_die_ref);
-static void gen_inlined_union_type_die (tree, dw_die_ref);
static dw_die_ref gen_enumeration_type_die (tree, dw_die_ref);
static dw_die_ref gen_formal_parameter_die (tree, tree, dw_die_ref);
static void gen_unspecified_parameters_die (tree, dw_die_ref);
@@ -5187,11 +5184,10 @@ static void gen_struct_or_union_type_die (tree, dw_die_ref,
static void gen_subroutine_type_die (tree, dw_die_ref);
static void gen_typedef_die (tree, dw_die_ref);
static void gen_type_die (tree, dw_die_ref);
-static void gen_tagged_type_instantiation_die (tree, dw_die_ref);
static void gen_block_die (tree, dw_die_ref, int);
static void decls_for_scope (tree, dw_die_ref, int);
static int is_redundant_typedef (const_tree);
-static void gen_namespace_die (tree);
+static void gen_namespace_die (tree, dw_die_ref);
static void gen_decl_die (tree, tree, dw_die_ref);
static dw_die_ref force_decl_die (tree);
static dw_die_ref force_type_die (tree);
@@ -12494,7 +12490,7 @@ add_prototyped_attribute (dw_die_ref die, tree func_type)
by looking in either the type declaration or object declaration
equate table. */
-static inline void
+static inline dw_die_ref
add_abstract_origin_attribute (dw_die_ref die, tree origin)
{
dw_die_ref origin_die = NULL;
@@ -12532,7 +12528,8 @@ add_abstract_origin_attribute (dw_die_ref die, tree origin)
here. */
if (origin_die)
- add_AT_die_ref (die, DW_AT_abstract_origin, origin_die);
+ add_AT_die_ref (die, DW_AT_abstract_origin, origin_die);
+ return origin_die;
}
/* We do not currently support the pure_virtual attribute. */
@@ -13163,18 +13160,6 @@ retry_incomplete_types (void)
gen_type_die (VEC_index (tree, incomplete_types, i), comp_unit_die);
}
-/* Generate a DIE to represent an inlined instance of an enumeration type. */
-
-static void
-gen_inlined_enumeration_type_die (tree type, dw_die_ref context_die)
-{
- dw_die_ref type_die = new_die (DW_TAG_enumeration_type, context_die, type);
-
- /* We do not check for TREE_ASM_WRITTEN (type) being set, as the type may
- be incomplete and such types are not marked. */
- add_abstract_origin_attribute (type_die, type);
-}
-
/* Determine what tag to use for a record type. */
static enum dwarf_tag
@@ -13199,30 +13184,6 @@ record_type_tag (tree type)
}
}
-/* Generate a DIE to represent an inlined instance of a structure type. */
-
-static void
-gen_inlined_structure_type_die (tree type, dw_die_ref context_die)
-{
- dw_die_ref type_die = new_die (record_type_tag (type), context_die, type);
-
- /* We do not check for TREE_ASM_WRITTEN (type) being set, as the type may
- be incomplete and such types are not marked. */
- add_abstract_origin_attribute (type_die, type);
-}
-
-/* Generate a DIE to represent an inlined instance of a union type. */
-
-static void
-gen_inlined_union_type_die (tree type, dw_die_ref context_die)
-{
- dw_die_ref type_die = new_die (DW_TAG_union_type, context_die, type);
-
- /* We do not check for TREE_ASM_WRITTEN (type) being set, as the type may
- be incomplete and such types are not marked. */
- add_abstract_origin_attribute (type_die, type);
-}
-
/* Generate a DIE to represent an enumeration type. Note that these DIEs
include all of the information about the enumeration values also. Each
enumerated type name/value is listed as a child of the enumerated type
@@ -13900,6 +13861,7 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die)
tree decl_or_origin = decl ? decl : origin;
dw_die_ref var_die;
dw_die_ref old_die = decl ? lookup_decl_die (decl) : NULL;
+ dw_die_ref origin_die;
int declaration = (DECL_EXTERNAL (decl_or_origin)
/* If DECL is COMDAT and has not actually been
emitted, we cannot take its address; there
@@ -14031,10 +13993,19 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die)
return;
}
+ /* If the compiler emitted a definition for the DECL declaration
+ and if we already emitted a DIE for it, don't emit a second
+ DIE for it again. */
+ if (old_die
+ && declaration
+ && old_die->die_parent == context_die)
+ return;
+
var_die = new_die (DW_TAG_variable, context_die, decl);
+ origin_die = NULL;
if (origin != NULL)
- add_abstract_origin_attribute (var_die, origin);
+ origin_die = add_abstract_origin_attribute (var_die, origin);
/* Loop unrolling can create multiple blocks that refer to the same
static variable, so we must test for the DW_AT_declaration flag.
@@ -14097,7 +14068,17 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die)
if (decl && (DECL_ABSTRACT (decl) || declaration))
equate_decl_number_to_die (decl, var_die);
- if (! declaration && ! DECL_ABSTRACT (decl_or_origin))
+ if (! declaration
+ && (! DECL_ABSTRACT (decl_or_origin)
+ /* Local static vars are shared between all clones/inlines,
+ so emit DW_AT_location on the abstract DIE if DECL_RTL is
+ already set. */
+ || (TREE_CODE (decl_or_origin) == VAR_DECL
+ && TREE_STATIC (decl_or_origin)
+ && DECL_RTL_SET_P (decl_or_origin)))
+ /* When abstract origin already has DW_AT_location attribute, no need
+ to add it again. */
+ && (origin_die == NULL || get_AT (origin_die, DW_AT_location) == NULL))
{
if (TREE_CODE (decl_or_origin) == VAR_DECL && TREE_STATIC (decl_or_origin)
&& !TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl_or_origin)))
@@ -14837,46 +14818,6 @@ gen_type_die (tree type, dw_die_ref context_die)
gen_type_die_with_usage (type, context_die, DINFO_USAGE_DIR_USE);
}
-/* Generate a DIE for a tagged type instantiation. */
-
-static void
-gen_tagged_type_instantiation_die (tree type, dw_die_ref context_die)
-{
- if (type == NULL_TREE || type == error_mark_node)
- return;
-
- /* We are going to output a DIE to represent the unqualified version of
- this type (i.e. without any const or volatile qualifiers) so make sure
- that we have the main variant (i.e. the unqualified version) of this
- type now. */
- gcc_assert (type == type_main_variant (type));
-
- /* Do not check TREE_ASM_WRITTEN (type) as it may not be set if this is
- an instance of an unresolved type. */
-
- switch (TREE_CODE (type))
- {
- case ERROR_MARK:
- break;
-
- case ENUMERAL_TYPE:
- gen_inlined_enumeration_type_die (type, context_die);
- break;
-
- case RECORD_TYPE:
- gen_inlined_structure_type_die (type, context_die);
- break;
-
- case UNION_TYPE:
- case QUAL_UNION_TYPE:
- gen_inlined_union_type_die (type, context_die);
- break;
-
- default:
- gcc_unreachable ();
- }
-}
-
/* Generate a DW_TAG_lexical_block DIE followed by DIEs to represent all of the
things which are local to the given block. */
@@ -15175,18 +15116,19 @@ declare_in_namespace (tree thing, dw_die_ref context_die)
/* Generate a DIE for a namespace or namespace alias. */
static void
-gen_namespace_die (tree decl)
+gen_namespace_die (tree decl, dw_die_ref context_die)
{
- dw_die_ref context_die = setup_namespace_context (decl, comp_unit_die);
+ dw_die_ref namespace_die;
/* Namespace aliases have a DECL_ABSTRACT_ORIGIN of the namespace
they are an alias of. */
if (DECL_ABSTRACT_ORIGIN (decl) == NULL)
{
/* Output a real namespace or module. */
- dw_die_ref namespace_die
- = new_die (is_fortran () ? DW_TAG_module : DW_TAG_namespace,
- context_die, decl);
+ context_die = setup_namespace_context (decl, comp_unit_die);
+ namespace_die = new_die (is_fortran ()
+ ? DW_TAG_module : DW_TAG_namespace,
+ context_die, decl);
/* For Fortran modules defined in different CU don't add src coords. */
if (namespace_die->die_tag == DW_TAG_module && DECL_EXTERNAL (decl))
add_name_attribute (namespace_die, dwarf2_name (decl, 0));
@@ -15204,9 +15146,11 @@ gen_namespace_die (tree decl)
dw_die_ref origin_die
= force_decl_die (DECL_ABSTRACT_ORIGIN (decl));
+ if (DECL_CONTEXT (decl) == NULL_TREE
+ || TREE_CODE (DECL_CONTEXT (decl)) == NAMESPACE_DECL)
+ context_die = setup_namespace_context (decl, comp_unit_die);
/* Now create the namespace alias DIE. */
- dw_die_ref namespace_die
- = new_die (DW_TAG_imported_declaration, context_die, decl);
+ namespace_die = new_die (DW_TAG_imported_declaration, context_die, decl);
add_name_and_src_coords_attributes (namespace_die, decl);
add_AT_die_ref (namespace_die, DW_AT_import, origin_die);
equate_decl_number_to_die (decl, namespace_die);
@@ -15317,14 +15261,14 @@ gen_decl_die (tree decl, tree origin, dw_die_ref context_die)
of some type tag, if the given TYPE_DECL is marked as having been
instantiated from some other (original) TYPE_DECL node (e.g. one which
was generated within the original definition of an inline function) we
- have to generate a special (abbreviated) DW_TAG_structure_type,
- DW_TAG_union_type, or DW_TAG_enumeration_type DIE here. */
- if (TYPE_DECL_IS_STUB (decl) && decl_ultimate_origin (decl) != NULL_TREE
- && is_tagged_type (TREE_TYPE (decl)))
- {
- gen_tagged_type_instantiation_die (TREE_TYPE (decl), context_die);
- break;
- }
+ used to generate a special (abbreviated) DW_TAG_structure_type,
+ DW_TAG_union_type, or DW_TAG_enumeration_type DIE here. But nothing
+ should be actually referencing those DIEs, as variable DIEs with that
+ type would be emitted already in the abstract origin, so it was always
+ removed during unused type prunning. Don't add anything in this
+ case. */
+ if (TYPE_DECL_IS_STUB (decl) && decl_ultimate_origin (decl) != NULL_TREE)
+ break;
if (is_redundant_typedef (decl))
gen_type_die (TREE_TYPE (decl), context_die);
@@ -15395,7 +15339,7 @@ gen_decl_die (tree decl, tree origin, dw_die_ref context_die)
case NAMESPACE_DECL:
case IMPORTED_DECL:
- gen_namespace_die (decl);
+ gen_namespace_die (decl, context_die);
break;
default:
@@ -15443,6 +15387,15 @@ dwarf2out_imported_module_or_decl_1 (tree decl,
dw_die_ref imported_die = NULL;
dw_die_ref at_import_die;
+ if (TREE_CODE (decl) == IMPORTED_DECL)
+ {
+ xloc = expand_location (DECL_SOURCE_LOCATION (decl));
+ decl = IMPORTED_DECL_ASSOCIATED_DECL (decl);
+ gcc_assert (decl);
+ }
+ else
+ xloc = expand_location (input_location);
+
if (TREE_CODE (decl) == TYPE_DECL || TREE_CODE (decl) == CONST_DECL)
{
if (is_base_type (TREE_TYPE (decl)))
@@ -15460,19 +15413,6 @@ dwarf2out_imported_module_or_decl_1 (tree decl,
gcc_assert (at_import_die);
}
}
- else if (TREE_CODE (decl) == IMPORTED_DECL)
- {
- tree imported_ns_decl;
- /* IMPORTED_DECL nodes that are not imported namespace are just not
- supported yet. */
- gcc_assert (DECL_INITIAL (decl)
- && TREE_CODE (DECL_INITIAL (decl)) == NAMESPACE_DECL);
- imported_ns_decl = DECL_INITIAL (decl);
- at_import_die = lookup_decl_die (imported_ns_decl);
- if (!at_import_die)
- at_import_die = force_decl_die (imported_ns_decl);
- gcc_assert (at_import_die);
- }
else
{
at_import_die = lookup_decl_die (decl);
@@ -15505,7 +15445,6 @@ dwarf2out_imported_module_or_decl_1 (tree decl,
lexical_block_die,
lexical_block);
- xloc = expand_location (input_location);
add_AT_file (imported_die, DW_AT_decl_file, lookup_filename (xloc.file));
add_AT_unsigned (imported_die, DW_AT_decl_line, xloc.line);
if (name)
diff --git a/gcc/except.c b/gcc/except.c
index ed06f44073b..99cac5e6be2 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -1915,11 +1915,13 @@ sjlj_build_landing_pads (void)
if (sjlj_find_directly_reachable_regions (lp_info))
{
rtx dispatch_label = gen_label_rtx ();
-
+ int align = STACK_SLOT_ALIGNMENT (sjlj_fc_type_node,
+ TYPE_MODE (sjlj_fc_type_node),
+ TYPE_ALIGN (sjlj_fc_type_node));
crtl->eh.sjlj_fc
= assign_stack_local (TYPE_MODE (sjlj_fc_type_node),
int_size_in_bytes (sjlj_fc_type_node),
- TYPE_ALIGN (sjlj_fc_type_node));
+ align);
sjlj_assign_call_site_values (dispatch_label, lp_info);
sjlj_mark_call_sites (lp_info);
diff --git a/gcc/expr.h b/gcc/expr.h
index b8dc2577237..2c8f4363fd8 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -1,6 +1,6 @@
/* Definitions for code generation pass of GNU compiler.
Copyright (C) 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of GCC.
@@ -786,6 +786,7 @@ extern void init_all_optabs (void);
/* Call this to initialize an optab function entry. */
extern rtx init_one_libfunc (const char *);
+extern rtx set_user_assembler_libfunc (const char *, const char *);
/* Build a decl for a libfunc named NAME. */
extern tree build_libfunc_function (const char *);
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index da4d50d5e94..e38850fd5df 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -8174,12 +8174,12 @@ fold_unary (enum tree_code code, tree type, tree op0)
&& inter_prec >= final_prec)
return fold_build1 (code, type, TREE_OPERAND (op0, 0));
- /* Likewise, if the intermediate and final types are either both
- float or both integer, we don't need the middle conversion if
- it is wider than the final type and doesn't change the signedness
- (for integers). Avoid this if the final type is a pointer
- since then we sometimes need the inner conversion. Likewise if
- the outer has a precision not equal to the size of its mode. */
+ /* Likewise, if the intermediate and initial types are either both
+ float or both integer, we don't need the middle conversion if the
+ former is wider than the latter and doesn't change the signedness
+ (for integers). Avoid this if the final type is a pointer since
+ then we sometimes need the middle conversion. Likewise if the
+ final type has a precision not equal to the size of its mode. */
if (((inter_int && inside_int)
|| (inter_float && inside_float)
|| (inter_vec && inside_vec))
@@ -9292,7 +9292,8 @@ fold_comparison (enum tree_code code, tree type, tree op0, tree op1)
}
/* Fold comparisons against infinity. */
- if (REAL_VALUE_ISINF (cst))
+ if (REAL_VALUE_ISINF (cst)
+ && MODE_HAS_INFINITIES (TYPE_MODE (TREE_TYPE (arg1))))
{
tem = fold_inf_compare (code, type, arg0, arg1);
if (tem != NULL_TREE)
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 6502f1a0802..9cb9c94dcd6 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,13 @@
+2009-03-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * lang.opt: Unify help texts for -I, -Wconversion, -d, -fopenmp,
+ and -fpreprocessed.
+
+2009-03-06 Alexandre Oliva <aoliva@redhat.com>
+
+ * simplify.c (gfc_simplify_transfer): Zero-initialize the
+ buffer.
+
2009-02-27 Tobias Burnus <burnus@net-b.de>
PR fortran/39309
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index e49ff76ee49..64fd486e7a2 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -1,5 +1,5 @@
; Options for the Fortran 95 front end.
-; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
+; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
; Free Software Foundation, Inc.
;
; This file is part of GCC.
@@ -50,7 +50,7 @@ Fortran
I
Fortran Joined Separate
--I<directory> Add a directory for INCLUDE and MODULE searching
+; Documented in C
J
Fortran Joined Separate
@@ -90,7 +90,7 @@ Warn about truncated character expressions
Wconversion
Fortran Warning
-Warn about implicit conversion
+; Documented in C
Wimplicit-interface
Fortran Warning
@@ -134,7 +134,7 @@ Disable preprocessing
d
Fortran Joined
--d[DIMNU] Dump details about macro names and definitions during preprocessing
+; Documented in common.opt
falign-commons
Fortran
@@ -310,7 +310,7 @@ Set default accessibility of module entities to PRIVATE.
fopenmp
Fortran
-Enable OpenMP (also sets frecursive)
+; Documented in C
fpack-derived
Fortran
@@ -318,7 +318,7 @@ Try to lay out derived types as compactly as possible
fpreprocessed
Fortran
-Treat the input file as preprocessed
+; Documented in C
frange-check
Fortran
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 6893a88c433..7be4671acfb 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -4541,6 +4541,7 @@ gfc_simplify_transfer (gfc_expr *source, gfc_expr *mold, gfc_expr *size)
/* Allocate the buffer to store the binary version of the source. */
buffer_size = MAX (source_size, result_size);
buffer = (unsigned char*)alloca (buffer_size);
+ memset (buffer, 0, buffer_size);
/* Now write source to the buffer. */
gfc_target_encode_expr (source, buffer, buffer_size);
diff --git a/gcc/function.c b/gcc/function.c
index 471b91f8eb5..e8d99015e4d 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -458,8 +458,6 @@ struct temp_slot GTY(())
struct temp_slot *prev;
/* The rtx to used to reference the slot. */
rtx slot;
- /* The alignment (in bits) of the slot. */
- unsigned int align;
/* The size, in units, of the slot. */
HOST_WIDE_INT size;
/* The type of the object in the slot, or zero if it doesn't correspond
@@ -467,6 +465,8 @@ struct temp_slot GTY(())
It can be reused if objects of the type of the new slot will always
conflict with objects of the type of the old slot. */
tree type;
+ /* The alignment (in bits) of the slot. */
+ unsigned int align;
/* Nonzero if this temporary is currently in use. */
char in_use;
/* Nonzero if this temporary has its address taken. */
@@ -1942,7 +1942,28 @@ use_register_for_decl (const_tree decl)
if (DECL_IGNORED_P (decl))
return true;
- return (optimize || DECL_REGISTER (decl));
+ if (optimize)
+ return true;
+
+ if (!DECL_REGISTER (decl))
+ return false;
+
+ switch (TREE_CODE (TREE_TYPE (decl)))
+ {
+ case RECORD_TYPE:
+ case UNION_TYPE:
+ case QUAL_UNION_TYPE:
+ /* When not optimizing, disregard register keyword for variables with
+ types containing methods, otherwise the methods won't be callable
+ from the debugger. */
+ if (TYPE_METHODS (TREE_TYPE (decl)))
+ return false;
+ break;
+ default:
+ break;
+ }
+
+ return true;
}
/* Return true if TYPE should be passed by invisible reference. */
@@ -2967,10 +2988,13 @@ assign_parm_setup_stack (struct assign_parm_data_all *all, tree parm,
if (data->stack_parm == 0)
{
+ int align = STACK_SLOT_ALIGNMENT (data->passed_type,
+ GET_MODE (data->entry_parm),
+ TYPE_ALIGN (data->passed_type));
data->stack_parm
= assign_stack_local (GET_MODE (data->entry_parm),
GET_MODE_SIZE (GET_MODE (data->entry_parm)),
- TYPE_ALIGN (data->passed_type));
+ align);
set_mem_attributes (data->stack_parm, parm, 1);
}
@@ -3032,11 +3056,13 @@ assign_parms_unsplit_complex (struct assign_parm_data_all *all, tree fnargs)
{
rtx rmem, imem;
HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (parm));
+ int align = STACK_SLOT_ALIGNMENT (TREE_TYPE (parm),
+ DECL_MODE (parm),
+ TYPE_ALIGN (TREE_TYPE (parm)));
/* split_complex_arg put the real and imag parts in
pseudos. Move them to memory. */
- tmp = assign_stack_local (DECL_MODE (parm), size,
- TYPE_ALIGN (TREE_TYPE (parm)));
+ tmp = assign_stack_local (DECL_MODE (parm), size, align);
set_mem_attributes (tmp, parm, 1);
rmem = adjust_address_nv (tmp, inner, 0);
imem = adjust_address_nv (tmp, inner, GET_MODE_SIZE (inner));
diff --git a/gcc/function.h b/gcc/function.h
index 3f03727dfdc..31d223a3d39 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -378,12 +378,6 @@ struct rtl_data GTY(())
/* Nonzero if function being compiled has an asm statement. */
bool has_asm_statement;
- /* Nonzero if the current function is a thunk, i.e., a lightweight
- function implemented by the output_mi_thunk hook) that just
- adjusts one of its arguments and forwards to another
- function. */
- bool is_thunk;
-
/* This bit is used by the exception handling logic. It is set if all
calls (if any) are sibling calls. Such functions do not have to
have EH tables generated, as they cannot throw. A call to such a
@@ -507,9 +501,6 @@ struct function GTY(())
pointer. */
tree nonlocal_goto_save_area;
- /* Function sequence number for profiling, debugging, etc. */
- int funcdef_no;
-
/* List of function local variables, functions, types and constants. */
tree local_decls;
@@ -527,6 +518,9 @@ struct function GTY(())
/* Last statement uid. */
int last_stmt_uid;
+ /* Function sequence number for profiling, debugging, etc. */
+ int funcdef_no;
+
/* Line number of the start of the function for debugging purposes. */
location_t function_start_locus;
@@ -600,6 +594,12 @@ struct function GTY(())
/* Nonzero if this function has local DECL_HARD_REGISTER variables.
In this case code motion has to be done more carefully. */
unsigned int has_local_explicit_reg_vars : 1;
+
+ /* Nonzero if the current function is a thunk, i.e., a lightweight
+ function implemented by the output_mi_thunk hook) that just
+ adjusts one of its arguments and forwards to another
+ function. */
+ unsigned int is_thunk : 1;
};
/* If va_list_[gf]pr_size is set to this, it means we don't know how
diff --git a/gcc/gcc.c b/gcc/gcc.c
index c4d4537eb2c..0b986c6efe8 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3283,7 +3283,7 @@ display_help (void)
fputs (_(" -pass-exit-codes Exit with highest error code from a phase\n"), stdout);
fputs (_(" --help Display this information\n"), stdout);
fputs (_(" --target-help Display target specific command line options\n"), stdout);
- fputs (_(" --help={target|optimizers|warnings|undocumented|params}[,{[^]joined|[^]separate}]\n"), stdout);
+ fputs (_(" --help={target|optimizers|warnings|params|[^]{joined|separate|undocumented}}[,...]\n"), stdout);
fputs (_(" Display specific types of command line options\n"), stdout);
if (! verbose_flag)
fputs (_(" (Use '-v --help' to display command line options of sub-processes)\n"), stdout);
diff --git a/gcc/genpreds.c b/gcc/genpreds.c
index e0fb3f42e52..a1232e9573f 100644
--- a/gcc/genpreds.c
+++ b/gcc/genpreds.c
@@ -2,7 +2,7 @@
- prototype declarations for operand predicates (tm-preds.h)
- function definitions of operand predicates, if defined new-style
(insn-preds.c)
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of GCC.
@@ -234,7 +234,7 @@ needs_variable (rtx exp, const char *var)
if (q != p && (ISALNUM (q[-1]) || q[-1] == '_'))
return false;
q += strlen (var);
- if (ISALNUM (q[0] || q[0] == '_'))
+ if (ISALNUM (q[0]) || q[0] == '_')
return false;
}
return true;
@@ -1103,7 +1103,7 @@ write_tm_constrs_h (void)
"{\n", c->c_name,
needs_op ? "op" : "ARG_UNUSED (op)");
if (needs_mode)
- puts ("enum machine_mode mode = GET_MODE (op);");
+ puts (" enum machine_mode mode = GET_MODE (op);");
if (needs_ival)
puts (" HOST_WIDE_INT ival = 0;");
if (needs_hval)
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index d1003aba200..2ed00fb5aa3 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -2354,11 +2354,7 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
else if (parms)
p = parms;
else
- {
- if (nargs != 0)
- CALL_CANNOT_INLINE_P (*expr_p) = 1;
- p = NULL_TREE;
- }
+ p = NULL_TREE;
for (i = 0; i < nargs && p; i++, p = TREE_CHAIN (p))
;
@@ -7242,6 +7238,8 @@ gimplify_type_sizes (tree type, gimple_seq *list_p)
if (TREE_CODE (field) == FIELD_DECL)
{
gimplify_one_sizepos (&DECL_FIELD_OFFSET (field), list_p);
+ gimplify_one_sizepos (&DECL_SIZE (field), list_p);
+ gimplify_one_sizepos (&DECL_SIZE_UNIT (field), list_p);
gimplify_type_sizes (TREE_TYPE (field), list_p);
}
break;
diff --git a/gcc/graphite.c b/gcc/graphite.c
index 58b67f4255a..b732b40d214 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -1058,31 +1058,24 @@ loop_affine_expr (basic_block scop_entry, struct loop *loop, tree expr)
|| evolution_function_is_affine_multivariate_p (scev, n));
}
-/* Return false if the tree_code of the operand OP or any of its operands
- is component_ref. */
+/* Return true if REF or any of its subtrees contains a
+ component_ref. */
static bool
-exclude_component_ref (tree op)
+contains_component_ref_p (tree ref)
{
- int i;
- int len;
+ if (!ref)
+ return false;
- if (op)
+ while (handled_component_p (ref))
{
- if (TREE_CODE (op) == COMPONENT_REF)
- return false;
- else
- {
- len = TREE_OPERAND_LENGTH (op);
- for (i = 0; i < len; ++i)
- {
- if (!exclude_component_ref (TREE_OPERAND (op, i)))
- return false;
- }
- }
+ if (TREE_CODE (ref) == COMPONENT_REF)
+ return true;
+
+ ref = TREE_OPERAND (ref, 0);
}
- return true;
+ return false;
}
/* Return true if the operand OP is simple. */
@@ -1094,13 +1087,15 @@ is_simple_operand (loop_p loop, gimple stmt, tree op)
if (DECL_P (op)
/* or a structure, */
|| AGGREGATE_TYPE_P (TREE_TYPE (op))
+ /* or a COMPONENT_REF, */
+ || contains_component_ref_p (op)
/* or a memory access that cannot be analyzed by the data
reference analysis. */
|| ((handled_component_p (op) || INDIRECT_REF_P (op))
&& !stmt_simple_memref_p (loop, stmt, op)))
return false;
- return exclude_component_ref (op);
+ return true;
}
/* Return true only when STMT is simple enough for being handled by
diff --git a/gcc/ipa-struct-reorg.c b/gcc/ipa-struct-reorg.c
index df34f92beab..ab70c98e9b9 100644
--- a/gcc/ipa-struct-reorg.c
+++ b/gcc/ipa-struct-reorg.c
@@ -1253,7 +1253,7 @@ create_general_new_stmt (struct access_site *acc, tree new_type)
{
tree *pos;
tree new_var = find_new_var_of_type (var, new_type);
- tree lhs, rhs;
+ tree lhs, rhs = NULL_TREE;
gcc_assert (new_var);
finalize_var_creation (new_var);
diff --git a/gcc/ira-conflicts.c b/gcc/ira-conflicts.c
index b5537bfe8df..05870ab4b16 100644
--- a/gcc/ira-conflicts.c
+++ b/gcc/ira-conflicts.c
@@ -800,29 +800,33 @@ ira_build_conflicts (void)
}
FOR_EACH_ALLOCNO (a, ai)
{
- if (ALLOCNO_CALLS_CROSSED_NUM (a) == 0)
- continue;
- if (! flag_caller_saves)
+ reg_attrs *attrs;
+ tree decl;
+
+ if ((! flag_caller_saves && ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
+ /* For debugging purposes don't put user defined variables in
+ callee-clobbered registers. */
+ || (optimize <= 1
+ && (attrs = REG_ATTRS (regno_reg_rtx [ALLOCNO_REGNO (a)])) != NULL
+ && (decl = attrs->decl) != NULL
+ && VAR_OR_FUNCTION_DECL_P (decl)
+ && ! DECL_ARTIFICIAL (decl)))
{
IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
call_used_reg_set);
- if (ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
- call_used_reg_set);
+ IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
+ call_used_reg_set);
}
- else
+ else if (ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
{
IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
no_caller_save_reg_set);
IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
temp_hard_reg_set);
- if (ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
- {
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
- no_caller_save_reg_set);
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
- temp_hard_reg_set);
- }
+ IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
+ no_caller_save_reg_set);
+ IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
+ temp_hard_reg_set);
}
}
if (optimize && ira_conflicts_p
diff --git a/gcc/ira-int.h b/gcc/ira-int.h
index dfa5734ab9e..4cb3928564c 100644
--- a/gcc/ira-int.h
+++ b/gcc/ira-int.h
@@ -240,8 +240,6 @@ struct ira_allocno
/* Mode of the allocno which is the mode of the corresponding
pseudo-register. */
enum machine_mode mode;
- /* Final rtx representation of the allocno. */
- rtx reg;
/* Hard register assigned to given allocno. Negative value means
that memory was allocated to the allocno. During the reload,
spilled allocno has value equal to the corresponding stack slot
@@ -249,6 +247,8 @@ struct ira_allocno
reload (at this point pseudo-register has only one allocno) which
did not get stack slot yet. */
int hard_regno;
+ /* Final rtx representation of the allocno. */
+ rtx reg;
/* Allocnos with the same regno are linked by the following member.
Allocnos corresponding to inner loops are first in the list (it
corresponds to depth-first traverse of the loops). */
@@ -312,33 +312,29 @@ struct ira_allocno
correspondingly minimal and maximal conflict ids of allocnos with
which given allocno can conflict. */
int min, max;
- /* The unique member value represents given allocno in conflict bit
- vectors. */
- int conflict_id;
/* Vector of accumulated conflicting allocnos with NULL end marker
(if CONFLICT_VEC_P is true) or conflict bit vector otherwise.
Only allocnos with the same cover class are in the vector or in
the bit vector. */
void *conflict_allocno_array;
+ /* The unique member value represents given allocno in conflict bit
+ vectors. */
+ int conflict_id;
/* Allocated size of the previous array. */
unsigned int conflict_allocno_array_size;
- /* Number of accumulated conflicts in the vector of conflicting
- allocnos. */
- int conflict_allocnos_num;
/* Initial and accumulated hard registers conflicting with this
allocno and as a consequences can not be assigned to the allocno.
All non-allocatable hard regs and hard regs of cover classes
different from given allocno one are included in the sets. */
HARD_REG_SET conflict_hard_regs, total_conflict_hard_regs;
+ /* Number of accumulated conflicts in the vector of conflicting
+ allocnos. */
+ int conflict_allocnos_num;
/* Accumulated frequency of calls which given allocno
intersects. */
int call_freq;
- /* Length of the previous array (number of the intersected calls). */
+ /* Accumulated number of the intersected calls. */
int calls_crossed_num;
- /* Non NULL if we remove restoring value from given allocno to
- MEM_OPTIMIZED_DEST at loop exit (see ira-emit.c) because the
- allocno value is not changed inside the loop. */
- ira_allocno_t mem_optimized_dest;
/* TRUE if the allocno assigned to memory was a destination of
removed move (see ira-emit.c) at loop exit because the value of
the corresponding pseudo-register is not changed inside the
@@ -383,6 +379,10 @@ struct ira_allocno
vector where a bit with given index represents allocno with the
same number. */
unsigned int conflict_vec_p : 1;
+ /* Non NULL if we remove restoring value from given allocno to
+ MEM_OPTIMIZED_DEST at loop exit (see ira-emit.c) because the
+ allocno value is not changed inside the loop. */
+ ira_allocno_t mem_optimized_dest;
/* Array of usage costs (accumulated and the one updated during
coloring) for each hard register of the allocno cover class. The
member value can be NULL if all costs are the same and equal to
diff --git a/gcc/ira.c b/gcc/ira.c
index 8eb11254720..3742f0f35c1 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -1864,21 +1864,21 @@ mark_elimination (int from, int to)
struct equivalence
{
- /* Set when an attempt should be made to replace a register
- with the associated src_p entry. */
- char replace;
/* Set when a REG_EQUIV note is found or created. Use to
keep track of what memory accesses might be created later,
e.g. by reload. */
rtx replacement;
rtx *src_p;
+ /* The list of each instruction which initializes this register. */
+ rtx init_insns;
/* Loop depth is used to recognize equivalences which appear
to be present within the same loop (or in an inner loop). */
int loop_depth;
- /* The list of each instruction which initializes this register. */
- rtx init_insns;
/* Nonzero if this had a preexisting REG_EQUIV note. */
int is_arg_equivalence;
+ /* Set when an attempt should be made to replace a register
+ with the associated src_p entry. */
+ char replace;
};
/* reg_equiv[N] (where N is a pseudo reg number) is the equivalence
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 7726ca483d1..6a7e44fe119 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,7 @@
+2009-03-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * lang.opt: Unify help text for -Wdeprecated.
+
2009-02-03 Jakub Jelinek <jakub@redhat.com>
* jcf-dump.c (version): Update copyright notice dates.
diff --git a/gcc/java/lang.opt b/gcc/java/lang.opt
index 7947a1ac045..8af1bd59e46 100644
--- a/gcc/java/lang.opt
+++ b/gcc/java/lang.opt
@@ -1,5 +1,5 @@
; Options for the Java front end.
-; Copyright (C) 2003, 2005, 2007 Free Software Foundation, Inc.
+; Copyright (C) 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
@@ -62,7 +62,7 @@ Java
Wdeprecated
Java Var(warn_deprecated) VarExists
-Warn if a deprecated compiler feature, class, method, or field is used
+; Documented for C
Wextraneous-semicolon
Java Var(flag_extraneous_semicolon)
diff --git a/gcc/lambda-code.c b/gcc/lambda-code.c
index 794d4e8b256..07b9469e35e 100644
--- a/gcc/lambda-code.c
+++ b/gcc/lambda-code.c
@@ -2472,7 +2472,8 @@ perfect_nestify (struct loop *loop,
it to one just in case. */
exit_condition = get_loop_exit_condition (newloop);
- uboundvar = create_tmp_var (integer_type_node, "uboundvar");
+ uboundvar = create_tmp_var (TREE_TYPE (VEC_index (tree, ubounds, 0)),
+ "uboundvar");
add_referenced_var (uboundvar);
stmt = gimple_build_assign (uboundvar, VEC_index (tree, ubounds, 0));
uboundvar = make_ssa_name (uboundvar, stmt);
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index 08f1ee69732..369c29f6abf 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -1831,6 +1831,7 @@ CTYPE
CONCAT3(__mul,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
{
MTYPE ac, bd, ad, bc, x, y;
+ CTYPE res;
ac = a * c;
bd = b * d;
@@ -1887,7 +1888,9 @@ CONCAT3(__mul,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
}
}
- return x + I * y;
+ __real__ res = x;
+ __imag__ res = y;
+ return res;
}
#endif /* complex multiply */
@@ -1898,6 +1901,7 @@ CTYPE
CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
{
MTYPE denom, ratio, x, y;
+ CTYPE res;
/* ??? We can get better behavior from logarithmic scaling instead of
the division. But that would mean starting to link libgcc against
@@ -1943,7 +1947,9 @@ CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
}
}
- return x + I * y;
+ __real__ res = x;
+ __imag__ res = y;
+ return res;
}
#endif /* complex divide */
@@ -2062,7 +2068,7 @@ getpagesize (void)
int
mprotect (char *addr, int len, int prot)
{
- int np, op;
+ DWORD np, op;
if (prot == 7)
np = 0x40;
@@ -2076,6 +2082,8 @@ mprotect (char *addr, int len, int prot)
np = 0x02;
else if (prot == 0)
np = 0x01;
+ else
+ return -1;
if (VirtualProtect (addr, len, np, &op))
return 0;
diff --git a/gcc/matrix-reorg.c b/gcc/matrix-reorg.c
index 7ea185ced20..d916f70266c 100644
--- a/gcc/matrix-reorg.c
+++ b/gcc/matrix-reorg.c
@@ -1,5 +1,5 @@
/* Matrix layout transformations.
- Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
Contributed by Razya Ladelsky <razya@il.ibm.com>
Originally written by Revital Eres and Mustafa Hagog.
@@ -261,9 +261,6 @@ struct matrix_info
gimple min_indirect_level_escape_stmt;
- /* Is the matrix transposed. */
- bool is_transposed_p;
-
/* Hold the allocation site for each level (dimension).
We can use NUM_DIMS as the upper bound and allocate the array
once with this number of elements and no need to use realloc and
@@ -272,6 +269,9 @@ struct matrix_info
int max_malloced_level;
+ /* Is the matrix transposed. */
+ bool is_transposed_p;
+
/* The location of the allocation sites (they must be in one
function). */
tree allocation_function_decl;
@@ -303,7 +303,7 @@ struct matrix_info
/* An array of the accesses to be flattened.
elements are of type "struct access_site_info *". */
- VEC (access_site_info_p, heap) * access_l;
+ VEC (access_site_info_p, heap) * access_l;
/* A map of how the dimensions will be organized at the end of
the analyses. */
diff --git a/gcc/optabs.c b/gcc/optabs.c
index bbda18edc42..2687b479dfd 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -6082,6 +6082,24 @@ init_one_libfunc (const char *name)
return XEXP (DECL_RTL (decl), 0);
}
+/* Adjust the assembler name of libfunc NAME to ASMSPEC. */
+
+rtx
+set_user_assembler_libfunc (const char *name, const char *asmspec)
+{
+ tree id, decl;
+ void **slot;
+ hashval_t hash;
+
+ id = get_identifier (name);
+ hash = htab_hash_string (name);
+ slot = htab_find_slot_with_hash (libfunc_decls, id, hash, NO_INSERT);
+ gcc_assert (slot);
+ decl = (tree) *slot;
+ set_user_assembler_name (decl, asmspec);
+ return XEXP (DECL_RTL (decl), 0);
+}
+
/* Call this to reset the function entry for one optab (OPTABLE) in mode
MODE to NAME, which should be either 0 or a string constant. */
void
diff --git a/gcc/opts.c b/gcc/opts.c
index add6c8bc7cd..7a8a71debb5 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -770,13 +770,21 @@ flag_instrument_functions_exclude_p (tree fndecl)
void
warn_if_disallowed_function_p (const_tree exp)
{
- if (TREE_CODE(exp) == CALL_EXPR
+ if (TREE_CODE (exp) == CALL_EXPR
&& VEC_length (char_p, warning_disallowed_functions) > 0)
{
int i;
char *s;
- const char *fnname =
- IDENTIFIER_POINTER (DECL_NAME (get_callee_fndecl (exp)));
+ tree fndecl = get_callee_fndecl (exp);
+ const char *fnname;
+
+ if (fndecl == NULL)
+ return;
+
+ fnname = get_name (fndecl);
+ if (fnname == NULL)
+ return;
+
for (i = 0; VEC_iterate (char_p, warning_disallowed_functions, i, s);
++i)
{
@@ -1429,7 +1437,7 @@ print_specific_help (unsigned int include_flags,
default:
if (i >= cl_lang_count)
break;
- if ((exclude_flags & ((1U << cl_lang_count) - 1)) != 0)
+ if (exclude_flags & all_langs_mask)
description = _("The following options are specific to just the language ");
else
description = _("The following options are supported by the language ");
@@ -1442,8 +1450,12 @@ print_specific_help (unsigned int include_flags,
{
if (any_flags == 0)
{
- if (include_flags == CL_UNDOCUMENTED)
+ if (include_flags & CL_UNDOCUMENTED)
description = _("The following options are not documented");
+ else if (include_flags & CL_SEPARATE)
+ description = _("The following options take separate arguments");
+ else if (include_flags & CL_JOINED)
+ description = _("The following options take joined arguments");
else
{
internal_error ("unrecognized include_flags 0x%x passed to print_specific_help",
@@ -1548,6 +1560,8 @@ common_handle_option (size_t scode, const char *arg, int value,
{ "warnings", CL_WARNING },
{ "undocumented", CL_UNDOCUMENTED },
{ "params", CL_PARAMS },
+ { "joined", CL_JOINED },
+ { "separate", CL_SEPARATE },
{ "common", CL_COMMON },
{ NULL, 0 }
};
@@ -1570,6 +1584,11 @@ common_handle_option (size_t scode, const char *arg, int value,
len = strlen (a);
else
len = comma - a;
+ if (len == 0)
+ {
+ a = comma + 1;
+ continue;
+ }
/* Check to see if the string matches an option class name. */
for (i = 0, specific_flag = 0; specifics[i].string != NULL; i++)
@@ -1578,7 +1597,7 @@ common_handle_option (size_t scode, const char *arg, int value,
specific_flag = specifics[i].flag;
break;
}
-
+
/* Check to see if the string matches a language name.
Note - we rely upon the alpha-sorted nature of the entries in
the lang_names array, specifically that shorter names appear
diff --git a/gcc/recog.c b/gcc/recog.c
index 7c22faec6de..70370e3ad81 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -379,6 +379,16 @@ verify_changes (int num)
if (! memory_address_p (GET_MODE (object), XEXP (object, 0)))
break;
}
+ else if (REG_P (changes[i].old)
+ && asm_noperands (PATTERN (object)) > 0
+ && REG_EXPR (changes[i].old) != NULL_TREE
+ && DECL_ASSEMBLER_NAME_SET_P (REG_EXPR (changes[i].old))
+ && DECL_REGISTER (REG_EXPR (changes[i].old)))
+ {
+ /* Don't allow changes of hard register operands to inline
+ assemblies if they have been defined as register asm ("x"). */
+ break;
+ }
else if (insn_invalid_p (object))
{
rtx pat = PATTERN (object);
diff --git a/gcc/reginfo.c b/gcc/reginfo.c
index 51e69f7f79e..e579c281aa3 100644
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -875,6 +875,8 @@ globalize_reg (int i)
SET_HARD_REG_BIT (fixed_reg_set, i);
SET_HARD_REG_BIT (call_used_reg_set, i);
SET_HARD_REG_BIT (call_fixed_reg_set, i);
+
+ reinit_regs ();
}
diff --git a/gcc/reload.h b/gcc/reload.h
index 17d8a3e04b2..3789680f7ca 100644
--- a/gcc/reload.h
+++ b/gcc/reload.h
@@ -205,10 +205,22 @@ struct insn_chain
all insns that need reloading. */
struct insn_chain *next_need_reload;
- /* The basic block this insn is in. */
- int block;
/* The rtx of the insn. */
rtx insn;
+
+ /* The basic block this insn is in. */
+ int block;
+
+ /* Nonzero if find_reloads said the insn requires reloading. */
+ unsigned int need_reload:1;
+ /* Nonzero if find_reloads needs to be run during reload_as_needed to
+ perform modifications on any operands. */
+ unsigned int need_operand_change:1;
+ /* Nonzero if eliminate_regs_in_insn said it requires eliminations. */
+ unsigned int need_elim:1;
+ /* Nonzero if this insn was inserted by perform_caller_saves. */
+ unsigned int is_caller_save_insn:1;
+
/* Register life information: record all live hard registers, and
all live pseudos that have a hard register. This set also
contains pseudos spilled by IRA. */
@@ -221,16 +233,6 @@ struct insn_chain
/* Indicates which registers have already been used for spills. */
HARD_REG_SET used_spill_regs;
-
- /* Nonzero if find_reloads said the insn requires reloading. */
- unsigned int need_reload:1;
- /* Nonzero if find_reloads needs to be run during reload_as_needed to
- perform modifications on any operands. */
- unsigned int need_operand_change:1;
- /* Nonzero if eliminate_regs_in_insn said it requires eliminations. */
- unsigned int need_elim:1;
- /* Nonzero if this insn was inserted by perform_caller_saves. */
- unsigned int is_caller_save_insn:1;
};
/* A chain of insn_chain structures to describe all non-note insns in
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 9a485f08300..fcf0bd3fc4d 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -4367,29 +4367,39 @@ reload_as_needed (int live_known)
SET_REGNO_REG_SET (&reg_has_output_reload,
REGNO (XEXP (in_reg, 0)));
}
- else if ((code == PRE_INC || code == PRE_DEC
- || code == POST_INC || code == POST_DEC))
+ else if (code == PRE_INC || code == PRE_DEC
+ || code == POST_INC || code == POST_DEC)
{
- int in_hard_regno;
int in_regno = REGNO (XEXP (in_reg, 0));
if (reg_last_reload_reg[in_regno] != NULL_RTX)
{
+ int in_hard_regno;
+ bool forget_p = true;
+
in_hard_regno = REGNO (reg_last_reload_reg[in_regno]);
- gcc_assert (TEST_HARD_REG_BIT (reg_reloaded_valid,
- in_hard_regno));
- for (x = old_prev ? NEXT_INSN (old_prev) : insn;
- x != old_next;
- x = NEXT_INSN (x))
- if (x == reg_reloaded_insn[in_hard_regno])
- break;
+ if (TEST_HARD_REG_BIT (reg_reloaded_valid,
+ in_hard_regno))
+ {
+ for (x = old_prev ? NEXT_INSN (old_prev) : insn;
+ x != old_next;
+ x = NEXT_INSN (x))
+ if (x == reg_reloaded_insn[in_hard_regno])
+ {
+ forget_p = false;
+ break;
+ }
+ }
/* If for some reasons, we didn't set up
reg_last_reload_reg in this insn,
invalidate inheritance from previous
insns for the incremented/decremented
register. Such registers will be not in
- reg_has_output_reload. */
- if (x == old_next)
+ reg_has_output_reload. Invalidate it
+ also if the corresponding element in
+ reg_reloaded_insn is also
+ invalidated. */
+ if (forget_p)
forget_old_reloads_1 (XEXP (in_reg, 0),
NULL_RTX, NULL);
}
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 7e80603dd53..e8d42c8cc61 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -141,10 +141,10 @@ typedef struct
stricter alignment; OFFSET is the offset of the MEM within that object. */
typedef struct mem_attrs GTY(())
{
- alias_set_type alias; /* Memory alias set. */
tree expr; /* expr corresponding to MEM. */
rtx offset; /* Offset from start of DECL, as CONST_INT. */
rtx size; /* Size in bytes, as a CONST_INT. */
+ alias_set_type alias; /* Memory alias set. */
unsigned int align; /* Alignment of MEM in bits. */
} mem_attrs;
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 26f69b09300..b35d774859c 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -4061,7 +4061,8 @@ nonzero_bits1 (const_rtx x, enum machine_mode mode, const_rtx known_x,
low-order bits by left shifts. */
if (GET_CODE (XEXP (x, 1)) == CONST_INT
&& INTVAL (XEXP (x, 1)) >= 0
- && INTVAL (XEXP (x, 1)) < HOST_BITS_PER_WIDE_INT)
+ && INTVAL (XEXP (x, 1)) < HOST_BITS_PER_WIDE_INT
+ && INTVAL (XEXP (x, 1)) < GET_MODE_BITSIZE (GET_MODE (x)))
{
enum machine_mode inner_mode = GET_MODE (x);
unsigned int width = GET_MODE_BITSIZE (inner_mode);
@@ -4542,7 +4543,8 @@ num_sign_bit_copies1 (const_rtx x, enum machine_mode mode, const_rtx known_x,
num0 = cached_num_sign_bit_copies (XEXP (x, 0), mode,
known_x, known_mode, known_ret);
if (GET_CODE (XEXP (x, 1)) == CONST_INT
- && INTVAL (XEXP (x, 1)) > 0)
+ && INTVAL (XEXP (x, 1)) > 0
+ && INTVAL (XEXP (x, 1)) < GET_MODE_BITSIZE (GET_MODE (x)))
num0 = MIN ((int) bitwidth, num0 + INTVAL (XEXP (x, 1)));
return num0;
@@ -4551,7 +4553,8 @@ num_sign_bit_copies1 (const_rtx x, enum machine_mode mode, const_rtx known_x,
/* Left shifts destroy copies. */
if (GET_CODE (XEXP (x, 1)) != CONST_INT
|| INTVAL (XEXP (x, 1)) < 0
- || INTVAL (XEXP (x, 1)) >= (int) bitwidth)
+ || INTVAL (XEXP (x, 1)) >= (int) bitwidth
+ || INTVAL (XEXP (x, 1)) >= GET_MODE_BITSIZE (GET_MODE (x)))
return 1;
num0 = cached_num_sign_bit_copies (XEXP (x, 0), mode,
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a2f28bba4c8..e3e6ab4932d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,336 @@
+2009-03-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/39554
+ * gcc.dg/wdisallowed-functions-3.c: New test.
+ * g++.dg/warn/Wdisallowed-functions-3.C: New test.
+
+2009-03-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/inline-33.c: Fix when pic.
+
+2009-03-25 Alexander Monakov <amonakov@ispras.ru>
+
+ * gcc.target/ia64/20090324-1.c: New test.
+
+2009-03-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/27898
+ * gcc.dg/pr27898.c: New test.
+
+ PR tree-optimization/32139
+ * gcc.c-torture/compile/pr32139.c: New test.
+
+2009-03-24 Jason Merrill <jason@redhat.com>
+
+ PR c++/28274
+ * g++.dg/parse/defarg14.C: New test.
+
+2009-03-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/39528
+ * gfortran.dg/read_repeat.f90: New test.
+
+2009-03-24 Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/39529
+ * gcc.dg/vect/pr39529.c: New test.
+
+2009-03-24 Dodji Seketeli <dodji@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/39524
+ * g++.dg/debug/dwarf2/imported-decl-1.C: New test.
+
+2009-03-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/39495
+ * gcc.dg/gomp/pr39495-2.c: Remove xfails.
+
+2009-03-23 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/auto12.C: Add variadic test.
+
+ PR c++/39526
+ * g++.dg/warn/Wshadow-4.C: New test.
+
+2009-03-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/39516
+ * gfortran.dg/pr39516.f: New test.
+
+2009-03-22 Hans-Peter Nilsson <hp@axis.com>
+
+ * lib/target-libpath.exp (set_ld_library_path_env_vars):
+ Correct TEST_GCC_EXEC_PREFIX test to check existence as a tcl
+ variable, not environment variable.
+
+2009-03-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/28879
+ * g++.dg/ext/vla6.C: New test.
+
+2009-03-20 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/initlist5.C: Add additional test.
+
+2009-03-19 Jakub Jelinek <jakub@redhat.com>
+ Janis Johnson <janis187@us.ibm.com>
+
+ * lib/compat.exp (compat-get-options-main, compat-get-options):
+ Handle dg-prune-output in source file.
+ * lib/gcc-defs.exp (${tool}_check_compile): Process prune requests.
+ * gcc.dg/compat/struct-layout-1_main.c: Use dg-prune for warning.
+ * gcc.dg/compat/struct-layout-1_generate.c: Use -Wno-abi, prune
+ two warnings.
+
+2009-03-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/39495
+ * gcc.dg/gomp/pr39495-1.c: New test.
+ * gcc.dg/gomp/pr39495-2.c: New test.
+ * g++.dg/gomp/pr39495-1.C: New test.
+ * g++.dg/gomp/pr39495-2.C: New test.
+
+ PR target/39496
+ * gcc.target/i386/pr39496.c: New test.
+ * g++.dg/other/pr39496.C: New test.
+
+2009-03-19 Li Feng <nemokingdom@gmail.com>
+
+ PR middle-end/39500
+ * gcc.dg/autopar/pr39500-1.c: New.
+ * gcc.dg/autopar/pr39500-2.c: New.
+
+2009-03-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ * g++.dg/dg.exp: Prune graphite.
+
+2009-03-18 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/39447
+ * g++.dg/graphite: New.
+ * g++.dg/graphite/graphite.exp: New.
+ * g++.dg/graphite/pr39447.C: New.
+
+2009-03-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR c++/39425
+ * g++.dg/template/pr39425.C: New.
+
+ * g++.dg/template/spec33.C: Updated.
+
+2009-03-17 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/auto6.C, auto12.C: Update mangling.
+
+2009-03-17 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/39475
+ * g++.dg/ext/unary_trait_incomplete.C: New.
+
+2009-03-17 Jing Yu <jingyu@google.com>
+
+ PR middle-end/39378
+ * g++.dg/inherit/thunk10.C: New test.
+
+2009-03-17 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/39482
+ * gcc.target/i386/pr39482.c: New test.
+
+2009-03-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/39471
+ * g++.dg/debug/dwarf2/imported-module-2.C: Expect
+ DW_TAG_imported_module, not just any DW_TAG_imported prefixed tag.
+ * g++.dg/debug/dwarf2/imported-module-3.C: Likewise.
+ * g++.dg/debug/dwarf2/imported-module-4.C: Likewise.
+
+ PR middle-end/39443
+ * gcc.dg/pr39443.c: New test.
+
+ PR debug/39412
+ * gcc.dg/debug/pr39412.c: New test.
+
+2009-03-17 Janis Johnson <janis187@us.ibm.com>
+
+ PR testsuite/38526
+ * lib/target-libpath.exp (set_ld_library_path_env_vars): Save
+ existing GCC_EXEC_PREFIX, set to TEST_GCC_EXEC_PREFIX if that
+ is defined.
+ (restore_ld_library_path_env_vars): Restore GCC_EXEC_PREFIX to
+ its original value, or unset if it was not defined.
+ * gcc.dg/compat/struct-layout-1.exp: Use set/restore library
+ path procs around use of HOSTCC.
+ * g++.dg/compat/struct-layout-1.exp: Ditto.
+ * objc.dg/gnu-encoding/gnu-encoding.exp: Ditto.
+
+2009-03-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.target/x86_64/abi/callabi/func-indirect.c (main): Return 0.
+
+2009-03-16 Janis Johnson <janis187@us.ibm.com>
+
+ Revert patch for PR testsuite/37630.
+
+ PR testsuite/37960
+ * gcc.dg/pr11492.c: Replace constant and remove xfail.
+
+ PR testsuite/37630
+ * lib/target-supports.exp (check_effective_target_ieee): New.
+ * gcc.c-torture/execute/ieee/ieee.exp: Use it.
+ * gcc.dg/20001012-1.c: Require ieee.
+
+ PR testsuite/37628
+ * gcc.c-torture/execute/pr35456.x: New, skip test for vax.
+
+2009-03-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/39455
+ * gcc.dg/pr39455.c: New test.
+
+2009-03-13 David Ayers <ayers@fsfe.org>
+
+ * objc/execute/trivial.m. New test.
+
+2009-03-13 Jack Howarth <howarth@bromo.med.uc.edu>
+
+ PR target/39137
+ * testsuite/gcc.target/i386/stackalign/longlong-2.c: Skip on darwin.
+
+2009-03-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR testsuite/39451
+ * gcc.dg/asm-b.c: Use "Q" constraint on %b1/%h1 and "R"
+ constraint on (%2).
+
+2009-03-12 David Ayers <ayers@fsfe.org>
+
+ PR libobjc/27466
+ * objc/execute/exceptions/handler-1.m. New test.
+
+2008-03-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/39431
+ * gcc.target/i386/pr39431.c: New test.
+
+2009-03-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/39445
+ * gcc.target/i386/pr39445.c: New.
+
+ * gcc.target/i386/push-1.c: XFAIL.
+
+2009-03-11 Adam Nemet <anemet@caviumnetworks.com>
+
+ * gcc.dg/inline-33.c: New test.
+
+2009-03-11 Nathan Froyd <froydnj@codesourcery.com>
+
+ * gcc.dg/vect/vect-82.c: Combine dg-do and
+ dg-require-effective-target into dg-skip-if.
+ * gcc.dg/vect/vect-83.c: Likewise.
+
+2009-03-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/39137
+ * gcc.target/i386/stackalign/longlong-1.c: New test.
+ * gcc.target/i386/stackalign/longlong-2.c: New test.
+
+2009-03-11 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * g++.old-deja/g++.jason/thunk2.C: Skip on SPU.
+
+2009-03-11 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * gcc.c-torture/execute/ieee/inf-3.c: New test.
+ * gcc.c-torture/execute/ieee/inf-2.c: Fix typo.
+
+2009-03-11 Olivier Hainque <hainque@adacore.com>
+
+ * gnat.dg/slice_enum.adb: New test.
+
+2009-03-11 Jason Merrill <jason@redhat.com>
+
+ PR debug/39086
+ * g++.dg/opt/nrv15.C: New test.
+
+2009-03-10 Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/39422
+ * gcc.dg/vect/costmodel/spu/costmodel-vect-76b.c: Move
+ constant array with static initialization to global memory.
+ * gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c: Likewise.
+
+2009-03-10 Hariharan Sandanagobalane <hariharan@picochip.com>
+
+ * gcc.c-torture/execute/pr39339.c: Bitfield sizes changed to avoid
+ padding.
+
+2009-03-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/39371
+ * g++.dg/opt/switch2.C: Add -w to dg-options.
+ * g++.dg/warn/Wswitch-1.C: Adjust expected warnings.
+ * g++.dg/warn/switch1.C: New test.
+ * g++.dg/other/switch3.C: New test.
+
+ PR tree-optimization/39394
+ * gcc.c-torture/compile/pr39394.c: New test.
+
+2009-03-09 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * gcc.target/s390/20090223-1.c: New testcase.
+
+2009-03-08 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/39402
+ * gfortran.dg/fmt_f0_1.f90: New test.
+
+2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR c++/39060
+ * g++.dg/other/new1.C: Adjusted.
+ * g++.dg/parse/crash40.C: Likewise.
+ * g++.dg/parse/defarg12.C: Likewise.
+ * g++.dg/template/error15.C: Likewise.
+
+ * g++.dg/other/pr39060.C: New.
+
+2009-03-07 Jason Merrill <jason@redhat.com>
+
+ PR c++/39367
+ * g++.dg/opt/new1.C: New.
+
+2009-03-06 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/33492
+ * g++.dg/other/error32.C: New.
+
+2009-03-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/39360
+ * gcc.c-torture/compile/pr39360.c: New test.
+
+ PR debug/39372
+ * g++.dg/debug/dwarf2/static-local-var-in-ctor.C: New test.
+
+2009-03-05 Jason Merrill <jason@redhat.com>
+
+ PR c++/38908
+ * g++.dg/warn/Wuninitialized-3.C: New test.
+
+2009-03-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/39379
+ * g++.dg/debug/dwarf2/imported-module-3.C: New test.
+ * g++.dg/debug/dwarf2/imported-module-4.C: New test.
+
+2009-03-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/13549
+ * g++.dg/template/koenig7.C: New test.
+
2009-03-04 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/torture/predcom-1.C: New test.
@@ -48,8 +381,7 @@
2009-03-03 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/39248
- * gcc.dg/vect/vect-complex-1.c: Add attribute aligned
- to the arrays.
+ * gcc.dg/vect/vect-complex-1.c: Add attribute aligned to the arrays.
* gcc.dg/vect/vect-iv-6.c: Don't expect to fail to vectorize
on targets without vector misalignment support.
* lib/target-supports.exp
@@ -91,7 +423,7 @@
2009-02-26 H.J. Lu <hongjiu.lu@intel.com>
PR c++/37789
- * other/pr37789.C: New.
+ * g++.dg/other/pr37789.C: New.
2009-02-26 Paul Thomas <pault@gcc.gnu.org>
diff --git a/gcc/testsuite/g++.dg/compat/struct-layout-1.exp b/gcc/testsuite/g++.dg/compat/struct-layout-1.exp
index 1ebb83be541..7fa89470e16 100644
--- a/gcc/testsuite/g++.dg/compat/struct-layout-1.exp
+++ b/gcc/testsuite/g++.dg/compat/struct-layout-1.exp
@@ -129,20 +129,11 @@ set generator_src "$generator_src $srcdir/$subdir/../../gcc.dg/compat/generate-r
set generator_src "$generator_src $srcdir/$subdir/../../gcc.dg/compat/generate-random_r.c"
set generator_cmd "-o $generator $generator_src"
-# Temporarily unset GCC_EXEC_PREFIX from environment, as that might
-# confuse the $HOSTCC.
-set orig_gcc_exec_prefix_saved 0
-if [info exists env(GCC_EXEC_PREFIX)] {
- set orig_gcc_exec_prefix "$env(GCC_EXEC_PREFIX)"
- set orig_gcc_exec_prefix_saved 1
- unsetenv GCC_EXEC_PREFIX
-}
+# Temporarily switch to the environment of the host compiler.
+restore_ld_library_path_env_vars
set status [remote_exec build "$HOSTCC $HOSTCFLAGS $generator_cmd"]
set status [lindex $status 0]
-if { $orig_gcc_exec_prefix_saved } {
- set orig_gcc_exec_prefix_saved 0
- setenv GCC_EXEC_PREFIX "$orig_gcc_exec_prefix"
-}
+set_ld_library_path_env_vars
if { $status == 0 } then {
file delete -force $tstobjdir
file mkdir $tstobjdir
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto12.C b/gcc/testsuite/g++.dg/cpp0x/auto12.C
index 437088d654c..34dc8c90b84 100644
--- a/gcc/testsuite/g++.dg/cpp0x/auto12.C
+++ b/gcc/testsuite/g++.dg/cpp0x/auto12.C
@@ -35,18 +35,29 @@ auto A<T>::f(U u) -> decltype (u + i)
return u + i;
}
+template <class... Args>
+int f (Args... args);
+
+template <class... Args>
+auto g (Args... args) -> decltype (f ((args+1)...))
+{
+ return (f ((args+1)...));
+}
+
int main()
{
- // { dg-final { scan-assembler "_ZN1AIiE1fIiEEDTplsTT_sTiES2_" } }
+ // { dg-final { scan-assembler "_ZN1AIiE1fIiEEDTplfp_L_ZNS0_1iEEET_" } }
A<int>().f(1);
- // { dg-final { scan-assembler "_ZN1AIiE2frIiEEDTplsTT_sTiES2_" } }
+ // { dg-final { scan-assembler "_ZN1AIiE2frIiEEDTplfp_L_ZNS0_2irEEET_" } }
A<int>().fr(1);
- // { dg-final { scan-assembler "_ZN1AIiE3frrIiEEDTplsTT_sTiES2_" } }
+ // { dg-final { scan-assembler "_ZN1AIiE3frrIiEEDTplfp_L_ZNS0_3irrEEET_" } }
A<int>().frr(1);
- // { dg-final { scan-assembler "_ZN1AIiE1gIiEEDTplsTT_sR.ES2_" } }
+ // { dg-final { scan-assembler "_ZN1AIiE1gIiEEDTplfp_szL_ZNS0_1iEEET_" } }
A<int>().g(1);
- // { dg-final { scan-assembler "_ZN1AIiE1hIiEEDTplsTT_sr1BIS2_E1iES2_" } }
+ // { dg-final { scan-assembler "_ZN1AIiE1hIiEEDTplfp_sr1BIT_E1iES3_" } }
A<int>().h(1);
- // { dg-final { scan-assembler "_ZN1AIiE1jIiEEDTplsTT_sRiES2_" } }
+ // { dg-final { scan-assembler "_ZN1AIiE1jIiEEDTplfp_clL_Z1xvEEET_" } }
A<int>().j(1);
+ // { dg-final { scan-assembler "_Z1gIIidEEDTclL_Z1fEspplfp_Li1EEEDpT_" } }
+ g(42, 1.0);
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto6.C b/gcc/testsuite/g++.dg/cpp0x/auto6.C
index 7d659c7236a..dfd6a202698 100644
--- a/gcc/testsuite/g++.dg/cpp0x/auto6.C
+++ b/gcc/testsuite/g++.dg/cpp0x/auto6.C
@@ -95,21 +95,21 @@ A<int> a, *p;
int main()
{
- // { dg-final { scan-assembler "_Z3addIidEDTplsTT_sTT0_ES0_S1_" } }
+ // { dg-final { scan-assembler "_Z3addIidEDTplfp_fp0_ET_T0_" } }
auto i = add(1, 2.0);
- // { dg-final { scan-assembler "_Z4add4IidEDTplsTT_sTT0_ES0_S1_" } }
+ // { dg-final { scan-assembler "_Z4add4IidEDTpldecvPT_Li0EdecvPT0_Li0EES0_S2_" } }
auto i4 = add4(1, 2.0);
- // { dg-final { scan-assembler "_Z4add2IidEDTplsRT_sRT0_ES0_S1_" } }
+ // { dg-final { scan-assembler "_Z4add2IidEDTplcvT__EcvT0__EES0_S1_" } }
auto i2 = add2(1, 2.0);
- // { dg-final { scan-assembler "_Z4add3IidEDTclL_Z2agEsTT_sTT0_EES0_S1_" } }
+ // { dg-final { scan-assembler "_Z4add3IidEDTclL_Z2agEfp_fp0_EET_T0_" } }
auto i3 = add3(1, 2.0);
- // { dg-final { scan-assembler "_Z1fI1AIiEEDTclptsTPT_1fEES3_" } }
+ // { dg-final { scan-assembler "_Z1fI1AIiEEDTclptfp_1fEEPT_" } }
f(p);
- // { dg-final { scan-assembler "_Z1gI1AIiEEDTcldtsTT_1fEES2_" } }
+ // { dg-final { scan-assembler "_Z1gI1AIiEEDTcldtfp_1fEET_" } }
g(a);
- // { dg-final { scan-assembler "_Z1hI1AIiEdEDTcldtsTT_1gIT0_EEES2_S3_" } }
+ // { dg-final { scan-assembler "_Z1hI1AIiEdEDTcldtfp_1gIT0_EEET_S2_" } }
h(a,1.0);
- // { dg-final { scan-assembler "_Z1kI1C1AIiE1DEDtdtsTT_srNT0_1BIT1_EE3MEMES4_S5_S7_" } }
+ // { dg-final { scan-assembler "_Z1kI1C1AIiE1DEDtdtfp_srNT0_1BIT1_EE3MEMET_S4_S6_" } }
k( C(), A<int>(), D() );
// { dg-final { scan-assembler "_Z1lIiET_S0_" } }
l(1);
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist5.C b/gcc/testsuite/g++.dg/cpp0x/initlist5.C
index fbdc673948f..958007c9bd8 100644
--- a/gcc/testsuite/g++.dg/cpp0x/initlist5.C
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist5.C
@@ -20,6 +20,8 @@ C c2 = { 1.1, 2 }; // { dg-error "narrowing" }
int j { 1 }; // initialize to 1
int k {}; // initialize to 0
-// PR c++/39693
+// PR c++/36963
double d = 1.1;
float fa[] = { d, 1.1 }; // { dg-error "narrowing conversion of 'd'" }
+const double d2 = 1.1;
+float fa2[] = { d2, 1.1 };
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-1.C
new file mode 100644
index 00000000000..bfdb4f8f5a0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-1.C
@@ -0,0 +1,17 @@
+// PR debug/39524
+// { dg-do compile }
+// { dg-options "-gdwarf-2 -dA -O0 -fno-merge-debug-strings" }
+
+namespace A
+{
+ static int var2 = 2;
+}
+
+int
+func ()
+{
+ using A::var2;
+ return var2;
+}
+
+// { dg-final { scan-assembler-times "var2\[^\n\r\]*DW_AT_name" 1 } }
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C
index 86128975b47..9a4821ab54a 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C
@@ -2,7 +2,7 @@
// Origin: PR debug/38390
// { dg-do compile }
// { dg-options "-g -dA" }
-// { dg-final { scan-assembler "DW_TAG_imported" } }
+// { dg-final { scan-assembler "DW_TAG_imported_module" } }
namespace A
{
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-3.C b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-3.C
new file mode 100644
index 00000000000..9559bcb4ce2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-3.C
@@ -0,0 +1,17 @@
+// PR debug/39379
+// { dg-do compile }
+// { dg-options "-g -dA" }
+// { dg-final { scan-assembler "DW_TAG_imported_module" } }
+
+namespace A
+{
+ int v;
+}
+
+int
+main ()
+{
+ using namespace A;
+ v++;
+ return v - 1;
+}
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-4.C b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-4.C
new file mode 100644
index 00000000000..7ac6bab498d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-4.C
@@ -0,0 +1,21 @@
+// PR debug/39379
+// { dg-do compile }
+// { dg-options "-g -dA" }
+// { dg-final { scan-assembler "DW_TAG_imported_module" } }
+
+namespace A
+{
+ int v;
+}
+
+int
+f ()
+{
+ int i;
+ {
+ using namespace A;
+ v++;
+ i = v - 1;
+ }
+ return i;
+}
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/static-local-var-in-ctor.C b/gcc/testsuite/g++.dg/debug/dwarf2/static-local-var-in-ctor.C
new file mode 100644
index 00000000000..a1bf6b53cd4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/static-local-var-in-ctor.C
@@ -0,0 +1,37 @@
+// PR debug/39372
+// { dg-do compile }
+// { dg-options "-O0 -g -dA" }
+// { dg-final { scan-assembler "DW_OP_addr\[^\n\r\]*\[\n\r\]*\[^\n\r\]*staticvar1" } }
+// { dg-final { scan-assembler "DW_OP_addr\[^\n\r\]*\[\n\r\]*\[^\n\r\]*staticvar2" } }
+
+extern void f (int *);
+
+struct A
+{
+ A(int i);
+ void foo(int i);
+};
+
+A::A(int i)
+{
+ static int *staticvar1 = new int(i);
+ f (staticvar1);
+}
+
+void A::foo(int i)
+{
+ static int *staticvar2 = new int(i);
+ f (staticvar2);
+}
+
+void f (int *)
+{
+}
+
+int
+main (void)
+{
+ A a(42);
+ a.foo(42);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/dg.exp b/gcc/testsuite/g++.dg/dg.exp
index e7a327a4a75..4700463f1b3 100644
--- a/gcc/testsuite/g++.dg/dg.exp
+++ b/gcc/testsuite/g++.dg/dg.exp
@@ -44,6 +44,7 @@ set tests [prune $tests $srcdir/$subdir/vect/*]
set tests [prune $tests $srcdir/$subdir/gomp/*]
set tests [prune $tests $srcdir/$subdir/tree-prof/*]
set tests [prune $tests $srcdir/$subdir/torture/*]
+set tests [prune $tests $srcdir/$subdir/graphite/*]
# Main loop.
dg-runtest $tests "" $DEFAULT_CXXFLAGS
diff --git a/gcc/testsuite/g++.dg/ext/unary_trait_incomplete.C b/gcc/testsuite/g++.dg/ext/unary_trait_incomplete.C
new file mode 100644
index 00000000000..d5148bebbc6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/unary_trait_incomplete.C
@@ -0,0 +1,76 @@
+// PR c++/39475
+
+struct I;
+struct C { };
+
+bool nas1 = __has_nothrow_assign(I); // { dg-error "incomplete type" }
+bool nas2 = __has_nothrow_assign(C[]);
+bool nas3 = __has_nothrow_assign(I[]);
+bool nas4 = __has_nothrow_assign(void);
+bool nas5 = __has_nothrow_assign(const void);
+
+bool tas1 = __has_trivial_assign(I); // { dg-error "incomplete type" }
+bool tas2 = __has_trivial_assign(C[]);
+bool tas3 = __has_trivial_assign(I[]);
+bool tas4 = __has_trivial_assign(void);
+bool tas5 = __has_trivial_assign(const void);
+
+bool nco1 = __has_nothrow_constructor(I); // { dg-error "incomplete type" }
+bool nco2 = __has_nothrow_constructor(C[]);
+bool nco3 = __has_nothrow_constructor(I[]);
+bool nco4 = __has_nothrow_constructor(void);
+bool nco5 = __has_nothrow_constructor(const void);
+
+bool tco1 = __has_trivial_constructor(I); // { dg-error "incomplete type" }
+bool tco2 = __has_trivial_constructor(C[]);
+bool tco3 = __has_trivial_constructor(I[]);
+bool tco4 = __has_trivial_constructor(void);
+bool tco5 = __has_trivial_constructor(const void);
+
+bool ncp1 = __has_nothrow_copy(I); // { dg-error "incomplete type" }
+bool ncp2 = __has_nothrow_copy(C[]);
+bool ncp3 = __has_nothrow_copy(I[]);
+bool ncp4 = __has_nothrow_copy(void);
+bool ncp5 = __has_nothrow_copy(const void);
+
+bool tcp1 = __has_trivial_copy(I); // { dg-error "incomplete type" }
+bool tcp2 = __has_trivial_copy(C[]);
+bool tcp3 = __has_trivial_copy(I[]);
+bool tcp4 = __has_trivial_copy(void);
+bool tcp5 = __has_trivial_copy(const void);
+
+bool vde1 = __has_virtual_destructor(I); // { dg-error "incomplete type" }
+bool vde2 = __has_virtual_destructor(C[]);
+bool vde3 = __has_virtual_destructor(I[]);
+bool vde4 = __has_virtual_destructor(void);
+bool vde5 = __has_virtual_destructor(const void);
+
+bool tde1 = __has_trivial_destructor(I); // { dg-error "incomplete type" }
+bool tde2 = __has_trivial_destructor(C[]);
+bool tde3 = __has_trivial_destructor(I[]);
+bool tde4 = __has_trivial_destructor(void);
+bool tde5 = __has_trivial_destructor(const void);
+
+bool abs1 = __is_abstract(I); // { dg-error "incomplete type" }
+bool abs2 = __is_abstract(C[]);
+bool abs3 = __is_abstract(I[]);
+bool abs4 = __is_abstract(void);
+bool abs5 = __is_abstract(const void);
+
+bool pod1 = __is_pod(I); // { dg-error "incomplete type" }
+bool pod2 = __is_pod(C[]);
+bool pod3 = __is_pod(I[]);
+bool pod4 = __is_pod(void);
+bool pod5 = __is_pod(const void);
+
+bool emp1 = __is_empty(I); // { dg-error "incomplete type" }
+bool emp2 = __is_empty(C[]);
+bool emp3 = __is_empty(I[]);
+bool emp4 = __is_empty(void);
+bool emp5 = __is_empty(const void);
+
+bool pol1 = __is_polymorphic(I); // { dg-error "incomplete type" }
+bool pol2 = __is_polymorphic(C[]);
+bool pol3 = __is_polymorphic(I[]);
+bool pol4 = __is_polymorphic(void);
+bool pol5 = __is_polymorphic(const void);
diff --git a/gcc/testsuite/g++.dg/ext/vla6.C b/gcc/testsuite/g++.dg/ext/vla6.C
new file mode 100644
index 00000000000..83011f2f0ab
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/vla6.C
@@ -0,0 +1,18 @@
+// PR c++/28879
+// { dg-options "" }
+
+struct A
+{
+ int i;
+ A(): i(1) {}
+};
+
+template<int> void foo()
+{
+ int x[A().i];
+}
+
+void f()
+{
+ foo<1>();
+}
diff --git a/gcc/testsuite/g++.dg/gomp/pr39495-1.C b/gcc/testsuite/g++.dg/gomp/pr39495-1.C
new file mode 100644
index 00000000000..8563e684fff
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr39495-1.C
@@ -0,0 +1,95 @@
+// PR c/39495
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+#define INT_MIN (-__INT_MAX__ - 1)
+#define INT_MAX __INT_MAX__
+#define UINT_MAX (2U * __INT_MAX__ + 1)
+
+int
+foo (void)
+{
+ int i;
+ unsigned int u;
+
+#pragma omp for
+ for (i = INT_MIN + 6; i > INT_MIN + 1; i--)
+ ;
+#pragma omp for
+ for (i = INT_MIN + 6; i >= INT_MIN + 1; i--)
+ ;
+#pragma omp for
+ for (i = INT_MIN + 6; i > INT_MIN; i--)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i < INT_MAX - 1; i++)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i <= INT_MAX - 1; i++)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i < INT_MAX; i++)
+ ;
+#pragma omp for
+ for (u = 6; u > 1; u--)
+ ;
+#pragma omp for
+ for (u = 6; u >= 1; u--)
+ ;
+#pragma omp for
+ for (u = 6; u > 0; u--)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u < UINT_MAX - 1; u++)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u <= UINT_MAX - 1; u++)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u < UINT_MAX; u++)
+ ;
+}
+
+int
+bar (void)
+{
+ int i;
+ unsigned int u;
+
+#pragma omp for
+ for (i = INT_MIN + 6; i > INT_MIN + 1; i -= 2)
+ ;
+#pragma omp for
+ for (i = INT_MIN + 6; i >= INT_MIN + 1; i -= 2)
+ ;
+#pragma omp for
+ for (i = INT_MIN + 6; i > INT_MIN; i -= 2)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i < INT_MAX - 1; i += 2)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i <= INT_MAX - 1; i += 2)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i < INT_MAX; i += 2)
+ ;
+#pragma omp for
+ for (u = 6; u > 1; u -= 2)
+ ;
+#pragma omp for
+ for (u = 6; u >= 1; u -= 2)
+ ;
+#pragma omp for
+ for (u = 6; u > 0; u -= 2)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u < UINT_MAX - 1; u += 2)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u <= UINT_MAX - 1; u += 2)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u < UINT_MAX; u += 2)
+ ;
+}
diff --git a/gcc/testsuite/g++.dg/gomp/pr39495-2.C b/gcc/testsuite/g++.dg/gomp/pr39495-2.C
new file mode 100644
index 00000000000..c0b4d5dbdee
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr39495-2.C
@@ -0,0 +1,39 @@
+// PR c/39495
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+#define INT_MIN (-__INT_MAX__ - 1)
+#define INT_MAX __INT_MAX__
+#define UINT_MAX (2U * __INT_MAX__ + 1)
+
+int
+foo (void)
+{
+ int i;
+ unsigned int u;
+
+#pragma omp for
+ for (i = INT_MIN + 6; i != INT_MIN; i--) // { dg-error "invalid controlling predicate" }
+ ;
+#pragma omp for
+ for (i = INT_MIN + 6; i == INT_MIN; i--) // { dg-error "invalid controlling predicate" }
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i != INT_MAX; i++) // { dg-error "invalid controlling predicate" }
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i == INT_MAX; i++) // { dg-error "invalid controlling predicate" }
+ ;
+#pragma omp for
+ for (u = 6; u != 0; u--) // { dg-error "invalid controlling predicate" }
+ ;
+#pragma omp for
+ for (u = 6; u == 0; u--) // { dg-error "invalid controlling predicate" }
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u != UINT_MAX; u++) // { dg-error "invalid controlling predicate" }
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u == UINT_MAX; u++) // { dg-error "invalid controlling predicate" }
+ ;
+}
diff --git a/gcc/testsuite/g++.dg/graphite/graphite.exp b/gcc/testsuite/g++.dg/graphite/graphite.exp
new file mode 100644
index 00000000000..d1993a2e805
--- /dev/null
+++ b/gcc/testsuite/g++.dg/graphite/graphite.exp
@@ -0,0 +1,48 @@
+# Copyright (C) 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib g++-dg.exp
+
+if ![check_effective_target_fgraphite] {
+ return
+}
+
+# The default action for a test is 'compile'. Save current default.
+global dg-do-what-default
+set save-dg-do-what-default ${dg-do-what-default}
+set dg-do-what-default compile
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C]] \
+ "" $DEFAULT_CFLAGS
+
+# Clean up.
+set dg-do-what-default ${save-dg-do-what-default}
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/g++.dg/graphite/pr39447.C b/gcc/testsuite/g++.dg/graphite/pr39447.C
new file mode 100644
index 00000000000..a0d09ec2b93
--- /dev/null
+++ b/gcc/testsuite/g++.dg/graphite/pr39447.C
@@ -0,0 +1,34 @@
+/* { dg-options "-O2 -fgraphite-identity" } */
+
+struct Point
+{
+ int line, col;
+
+ Point( int l = -1, int c = 0 ) throw() : line( l ), col( c ) {}
+ bool operator==( const Point & p ) const throw()
+ { return ( line == p.line && col == p.col ); }
+ bool operator<( const Point & p ) const throw()
+ { return ( line < p.line || ( line == p.line && col < p.col ) ); }
+};
+
+class Buffer
+{
+public:
+ int characters( const int line ) const throw();
+ int pgetc( Point & p ) const throw();
+ Point eof() const throw() { return Point( 0, 0 ); }
+ bool pisvalid( const Point & p ) const throw()
+ { return ( ( p.col >= 0 && p.col < characters( p.line ) ) || p == eof() );
+ }
+ bool save( Point p1 = Point(), Point p2 = Point() ) const;
+};
+
+bool Buffer::save( Point p1, Point p2 ) const
+{
+ if( !this->pisvalid( p1 ) ) p1 = eof();
+ if( !this->pisvalid( p2 ) ) p2 = eof();
+ for( Point p = p1; p < p2; ) { pgetc( p ); }
+ return true;
+}
+
+
diff --git a/gcc/testsuite/g++.dg/inherit/thunk10.C b/gcc/testsuite/g++.dg/inherit/thunk10.C
new file mode 100644
index 00000000000..702067749fa
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/thunk10.C
@@ -0,0 +1,60 @@
+/* { dg-options "-mthumb" { target arm*-*-* } } */
+/* { dg-do run } */
+/* { dg-timeout 100 } */
+
+/* PR middle-end/39378 */
+/* Check if the thunk target function is emitted correctly. */
+class B1
+{
+public:
+ virtual int foo1(void);
+ int b1;
+};
+
+class B2
+{
+public:
+ virtual int foo2 (void);
+ int b2;
+};
+
+class D : public B1, public B2
+{
+ int foo1(void);
+ int foo2(void);
+ int d;
+};
+
+int B1::foo1(void)
+{
+ return 3;
+}
+
+int B2::foo2(void)
+{
+ return 4;
+}
+
+int D::foo1(void)
+{
+ return 1;
+}
+
+int D::foo2(void)
+{
+ return 2;
+}
+
+__attribute__((noinline)) int test(B2* bp)
+{
+ return bp->foo2();
+}
+
+int main()
+{
+ B2 *bp = new D();
+ if (test(bp) == 2)
+ return 0;
+ else
+ return 1;
+}
diff --git a/gcc/testsuite/g++.dg/opt/new1.C b/gcc/testsuite/g++.dg/opt/new1.C
new file mode 100644
index 00000000000..dbcc0f8517a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/new1.C
@@ -0,0 +1,71 @@
+// PR c++/39367
+// { dg-options "-O" }
+
+class QScriptEnginePrivate;
+class QScriptClassInfo;
+namespace QScript {
+ enum Type { InvalidType };
+};
+class QScriptValueImpl {
+public:
+ inline QScriptValueImpl();
+ QScript::Type m_type;
+};
+namespace QScript {
+ namespace Ecma {
+ class Core {
+ public:
+ inline QScriptEnginePrivate *engine() const { }
+ inline QScriptClassInfo *classInfo() const { }
+ QScriptValueImpl publicPrototype;
+ };
+ class Boolean: public Core {
+ void newBoolean(QScriptValueImpl *result, bool value = false);
+ };
+ }
+ template <typename T> class Buffer {
+ public:
+ inline void reserve(int num);
+ inline void resize(int s);
+ T *m_data;
+ int m_capacity;
+ int m_size;
+ };
+}
+template <typename T> void QScript::Buffer<T>::resize(int s) {
+ if (m_capacity < s)
+ reserve (s << 1);
+}
+template <typename T> void QScript::Buffer<T>::reserve(int x) {
+ T *new_data = new T[m_capacity];
+ for (int i=0; i<m_size; ++i)
+ new_data[i] = m_data[i];
+}
+class QScriptObject {
+public:
+ inline void reset();
+ QScript::Buffer<QScriptValueImpl> m_values;
+};
+class QScriptEnginePrivate {
+public:
+ inline QScriptObject *allocObject() { return 0; }
+ inline void newObject(QScriptValueImpl *o, const QScriptValueImpl &proto,
+ QScriptClassInfo *oc = 0);
+};
+inline void QScriptEnginePrivate::newObject(QScriptValueImpl *o,
+ const QScriptValueImpl &proto,
+ QScriptClassInfo *oc)
+{
+ QScriptObject *od = allocObject();
+ od->reset();
+}
+inline QScriptValueImpl::QScriptValueImpl() : m_type(QScript::InvalidType) { }
+inline void QScriptObject::reset() { m_values.resize(0); }
+namespace QScript {
+ namespace Ecma {
+ void Boolean::newBoolean(QScriptValueImpl *result, bool value)
+ {
+ engine()->newObject(result, publicPrototype, classInfo());
+ }
+ }
+}
diff --git a/gcc/testsuite/g++.dg/opt/nrv15.C b/gcc/testsuite/g++.dg/opt/nrv15.C
new file mode 100644
index 00000000000..23511b284b2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/nrv15.C
@@ -0,0 +1,97 @@
+// PR debug/39086
+// { dg-options "-g -O -fno-tree-sra" }
+
+struct A { int v; };
+
+A ax;
+
+struct B
+{
+ static A f1 () { return ax; }
+ static bool f2 ();
+ static A f3 ();
+};
+
+struct C
+{
+ A f4 ()
+ {
+ A x;
+ if (__builtin_expect (this->f6 () < this->f12 (), true))
+ x = B::f1 ();
+ else
+ x = this->f7 ();
+ return x;
+ }
+ A f5 ()
+ {
+ A y;
+ if (this->f6 () < this->f12 ())
+ y = B::f1 ();
+ else
+ y = this->f7 ();
+ return y;
+ }
+ void *f6 () const;
+ void *f12 () const;
+ virtual A f7 ();
+};
+
+C *dx;
+
+struct D
+{
+ C *f8 () const;
+};
+
+class E : virtual public D
+{
+ void f11 ();
+ void f9 ();
+ void f10 ();
+};
+
+struct G
+{
+ explicit G ();
+ operator bool () const;
+};
+
+void
+E::f11 (void)
+{
+ A d = B::f3 ();
+ d = this->f8 ()->f4 ();
+}
+
+void
+E::f9 ()
+{
+ G c;
+ if (c)
+ {
+ const A e = B::f3 ();
+ C * f = this->f8 ();
+ A d = f->f5 ();
+ if (B::f2 ())
+ ;
+ else if (B::f2 ())
+ f->f4 ();
+ }
+}
+
+void
+E::f10 ()
+{
+ G c;
+ if (c)
+ {
+ const A e = B::f3 ();
+ C * f = this->f8 ();
+ A d = f->f5 ();
+ if (B::f2 ())
+ ;
+ else if (B::f2 ())
+ f->f4 ();
+ }
+}
diff --git a/gcc/testsuite/g++.dg/opt/switch2.C b/gcc/testsuite/g++.dg/opt/switch2.C
index 2590273c5d9..f7374cb7474 100644
--- a/gcc/testsuite/g++.dg/opt/switch2.C
+++ b/gcc/testsuite/g++.dg/opt/switch2.C
@@ -1,5 +1,5 @@
// { dg-do compile }
-// { dg-options "-O2" }
+// { dg-options "-O2 -w" }
extern int foo (int);
diff --git a/gcc/testsuite/g++.dg/other/error32.C b/gcc/testsuite/g++.dg/other/error32.C
new file mode 100644
index 00000000000..35c64c4eab9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/error32.C
@@ -0,0 +1,8 @@
+// PR c++/33492
+// { dg-options "" }
+
+void foo()
+{
+ if (throw 0) // { dg-error "could not convert .\\<throw-expression\\>. to .bool." }
+ ;
+}
diff --git a/gcc/testsuite/g++.dg/other/new1.C b/gcc/testsuite/g++.dg/other/new1.C
index 30b651326aa..71383706ea4 100644
--- a/gcc/testsuite/g++.dg/other/new1.C
+++ b/gcc/testsuite/g++.dg/other/new1.C
@@ -10,5 +10,5 @@ struct A
void foo()
{
- new A;
+ new A; // { dg-error "default argument" }
}
diff --git a/gcc/testsuite/g++.dg/other/pr39060.C b/gcc/testsuite/g++.dg/other/pr39060.C
new file mode 100644
index 00000000000..a625aea108e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/pr39060.C
@@ -0,0 +1,19 @@
+// PR c++/39060
+// { dg-do compile }
+
+struct A
+{
+ A(void* i=); // { dg-error "with|specification" }
+ A(void* i=); // { dg-error "overloaded" }
+ A(void* i=); // { dg-error "overloaded" }
+
+ void operator+ (void* i=); // { dg-error "arguments" }
+
+ virtual void foo1(=); // { dg-error "identifier" }
+ void foo2(=); // { dg-error "identifier" }
+ void foo3(=); // { dg-error "identifier" }
+ void foo4(=); // { dg-error "identifier" }
+ void foo5(=); // { dg-error "identifier" }
+}; // { dg-error "primary-expression" }
+
+A::A (void* i=) {} // { dg-error "primary-expression|argument" }
diff --git a/gcc/testsuite/g++.dg/other/pr39496.C b/gcc/testsuite/g++.dg/other/pr39496.C
new file mode 100644
index 00000000000..94e33abbe11
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/pr39496.C
@@ -0,0 +1,35 @@
+// PR target/39496
+// { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* } && ilp32 } } }
+// { dg-options "-O0 -fverbose-asm -fno-omit-frame-pointer -msse2 -mfpmath=sse" }
+// Verify that {foo,bar}{,2}param are all passed on the stack, using
+// normal calling conventions, when not optimizing.
+// { dg-final { scan-assembler "\[^0-9-\]8\\(%ebp\\),\[^\n\]*fooparam," } }
+// { dg-final { scan-assembler "\[^0-9-\]8\\(%ebp\\),\[^\n\]*barparam," } }
+// { dg-final { scan-assembler "\[^0-9-\]8\\(%ebp\\),\[^\n\]*foo2param," } }
+// { dg-final { scan-assembler "\[^0-9-\]8\\(%ebp\\),\[^\n\]*bar2param," } }
+
+static inline int foo (int fooparam)
+{
+ return fooparam;
+}
+
+static int bar (int barparam)
+{
+ return foo (barparam);
+}
+
+static inline double foo2 (double foo2param)
+{
+ return foo2param;
+}
+
+static double bar2 (double bar2param)
+{
+ return foo2 (bar2param);
+}
+
+int
+main ()
+{
+ return bar (0) + bar2 (0.0);
+}
diff --git a/gcc/testsuite/g++.dg/other/switch3.C b/gcc/testsuite/g++.dg/other/switch3.C
new file mode 100644
index 00000000000..4f9b5485ef9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/switch3.C
@@ -0,0 +1,25 @@
+// PR c++/39371
+// { dg-do compile }
+
+void
+foo (bool b)
+{
+ switch ((unsigned int) b)
+ {
+ case 1:
+ case 2:
+ break;
+ }
+}
+
+void
+bar (unsigned char b)
+{
+ switch ((unsigned int) b)
+ {
+ case 1:
+ case 257:
+ case 513:
+ break;
+ }
+}
diff --git a/gcc/testsuite/g++.dg/parse/crash40.C b/gcc/testsuite/g++.dg/parse/crash40.C
index af44fdb695c..6a15228c063 100644
--- a/gcc/testsuite/g++.dg/parse/crash40.C
+++ b/gcc/testsuite/g++.dg/parse/crash40.C
@@ -37,6 +37,6 @@ void bar()
int i;
i.C::foo<0>(); /* { dg-error "which is of non-class type" } */
- S<false> s;
+ S<false> s; /* { dg-error "default argument" } */
SS<false> ss; /* { dg-error "within this context" } */
}
diff --git a/gcc/testsuite/g++.dg/parse/defarg12.C b/gcc/testsuite/g++.dg/parse/defarg12.C
index 3717ad5db7d..80ef5c38e1f 100644
--- a/gcc/testsuite/g++.dg/parse/defarg12.C
+++ b/gcc/testsuite/g++.dg/parse/defarg12.C
@@ -9,5 +9,5 @@ struct A
void foo()
{
- A().i;
+ A().i; /* { dg-error "default argument" } */
}
diff --git a/gcc/testsuite/g++.dg/parse/defarg14.C b/gcc/testsuite/g++.dg/parse/defarg14.C
new file mode 100644
index 00000000000..0930b45eea4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/defarg14.C
@@ -0,0 +1,6 @@
+// PR c++/28274
+
+extern "C" {
+void foo (int i, int j = 6);
+void foo (int i = 4, int j);
+}
diff --git a/gcc/testsuite/g++.dg/template/error15.C b/gcc/testsuite/g++.dg/template/error15.C
index 6bd1f77e874..b7c7bc8ca47 100644
--- a/gcc/testsuite/g++.dg/template/error15.C
+++ b/gcc/testsuite/g++.dg/template/error15.C
@@ -18,7 +18,7 @@ protected:
template <class T>
void B<T>::g(void) {
- f();
+ f(); // { dg-error "default argument" }
}
template class B<long>;
diff --git a/gcc/testsuite/g++.dg/template/koenig7.C b/gcc/testsuite/g++.dg/template/koenig7.C
new file mode 100644
index 00000000000..07f2fcad33d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/koenig7.C
@@ -0,0 +1,11 @@
+// PR c++/13549
+// We need to do arg-dep lookup for g<T>(j) at instantiation time because
+// g<T> is dependent, even though (j) is not; at that point we can find
+// g(h).
+
+template <typename T> int g(int);
+class h{};
+template <typename T> int l(){h j; return g<T>(j);}
+template <typename T> int g(const h&);
+class j{};
+int jj(){return l<j>();}
diff --git a/gcc/testsuite/g++.dg/template/pr39425.C b/gcc/testsuite/g++.dg/template/pr39425.C
new file mode 100644
index 00000000000..a063e05c2c7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/pr39425.C
@@ -0,0 +1,18 @@
+// PR c++/39425
+// { dg-do compile }
+
+class a {
+
+ template<unsigned int s>
+ struct _rec {
+ static const char size = _rec< (s >> 1) >::size;
+ };
+
+ template<> // { dg-error "explicit" }
+ struct _rec <0> {
+ static const char size = 0;
+ };
+
+ static const unsigned int value = _rec < 1 >::size;
+
+} // { dg-error "unqualified-id" }
diff --git a/gcc/testsuite/g++.dg/template/spec33.C b/gcc/testsuite/g++.dg/template/spec33.C
index 809d4f012c1..7b7a7519829 100644
--- a/gcc/testsuite/g++.dg/template/spec33.C
+++ b/gcc/testsuite/g++.dg/template/spec33.C
@@ -3,5 +3,5 @@
struct A
{
template<int> static void foo () {}
- template<> static void foo<0>() {} // { dg-error "explicit" }
+ template<> static void foo<0>() {} // { dg-error "explicit|template" }
};
diff --git a/gcc/testsuite/g++.dg/warn/Wdisallowed-functions-3.C b/gcc/testsuite/g++.dg/warn/Wdisallowed-functions-3.C
new file mode 100644
index 00000000000..3ecfb0c2264
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wdisallowed-functions-3.C
@@ -0,0 +1,10 @@
+// PR c++/39554
+// { dg-do compile }
+// { dg-options "-Wdisallowed-function-list=bar" }
+
+void
+foo (void (*p) (), void (*bar) ())
+{
+ p ();
+ bar ();
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wshadow-4.C b/gcc/testsuite/g++.dg/warn/Wshadow-4.C
new file mode 100644
index 00000000000..16399b2fb60
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wshadow-4.C
@@ -0,0 +1,20 @@
+// PR c++/39526
+// { dg-options "-Wshadow" }
+
+class INetURLObject
+{
+public:
+ INetURLObject(int i);
+ int GetMainURL() const;
+};
+
+int foo(int infoo) // { dg-warning "shadowed declaration" }
+{
+ int outfoo( INetURLObject( infoo ).GetMainURL()); // { dg-bogus "shadows" }
+ extern void f(int infoo);
+ struct A
+ {
+ void f(int infoo) { } // { dg-warning "shadows a parameter" }
+ };
+ return outfoo;
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wswitch-1.C b/gcc/testsuite/g++.dg/warn/Wswitch-1.C
index 9b05cd16c5d..6a2094466cf 100644
--- a/gcc/testsuite/g++.dg/warn/Wswitch-1.C
+++ b/gcc/testsuite/g++.dg/warn/Wswitch-1.C
@@ -50,14 +50,14 @@ foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el,
{
case e1: return 1;
case e2: return 2;
- case 3: return 3; /* { dg-warning "case value '3' not in enumerated type 'e'" "excess 3" } */
+ case 3: return 3; /* { dg-warning "exceeds maximum value" } */
}
switch (ep)
{
case e1: return 1;
case e2: return 2;
- case 3: return 3;
+ case 3: return 3; /* { dg-warning "exceeds maximum value" } */
default: break;
- } /* Since there is a default, no warning about ``case 3'' */
+ }
return 0;
}
diff --git a/gcc/testsuite/g++.dg/warn/Wuninitialized-3.C b/gcc/testsuite/g++.dg/warn/Wuninitialized-3.C
new file mode 100644
index 00000000000..dc3be3f67fa
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-3.C
@@ -0,0 +1,17 @@
+// PR C++/38908
+// { dg-options "-Wuninitialized -O" }
+
+struct empty {};
+
+struct dfs_visitor {
+ dfs_visitor() { }
+ empty m_vis;
+};
+
+void bar(const dfs_visitor&);
+void foo(void)
+{
+ dfs_visitor vis;
+ dfs_visitor vis2 = vis;
+ bar (vis2);
+}
diff --git a/gcc/testsuite/g++.dg/warn/switch1.C b/gcc/testsuite/g++.dg/warn/switch1.C
new file mode 100644
index 00000000000..49c17e9120c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/switch1.C
@@ -0,0 +1,15 @@
+// { dg-do compile { target { int32plus } } }
+
+signed char sc;
+
+void
+foo (void)
+{
+ switch (sc)
+ {
+ case 1:
+ case 2 * __SCHAR_MAX__ + 3: // { dg-warning "case label value exceeds maximum" }
+ case - 2 * __SCHAR_MAX__ - 1: // { dg-warning "case label value is less than minimum" }
+ break;
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C b/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C
index 18bbec8c88a..ad13022ddb3 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C
@@ -1,6 +1,7 @@
// { dg-do run { target fpic } }
// { dg-options "-fPIC" }
// { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))|\[Bb\]ad fixup at .DATA.:" "PIC unsupported" { xfail *-*-netware* } 0 }
+// { dg-skip-if "requires unsupported run-time relocation" { spu-*-* } { "*" } { "" } }
// Test that non-variadic function calls using thunks and PIC work right.
struct A {
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr32139.c b/gcc/testsuite/gcc.c-torture/compile/pr32139.c
new file mode 100644
index 00000000000..7b8522f5174
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr32139.c
@@ -0,0 +1,11 @@
+/* PR tree-optimization/32139 */
+int foo (void);
+int bar (void) __attribute__ ((const));
+
+int
+test (int x)
+{
+ int a = (x == 10000 ? foo : bar) ();
+ int b = (x == 10000 ? foo : bar) ();
+ return a + b;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr39360.c b/gcc/testsuite/gcc.c-torture/compile/pr39360.c
new file mode 100644
index 00000000000..0bd63114431
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr39360.c
@@ -0,0 +1,16 @@
+/* PR middle-end/39360 */
+
+static int a[] = { 1 };
+
+static inline void
+bar (int **x)
+{
+ static int *c[2] = { 0, a };
+ *x = c[1];
+}
+
+int
+foo (int **x)
+{
+ bar (x);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr39394.c b/gcc/testsuite/gcc.c-torture/compile/pr39394.c
new file mode 100644
index 00000000000..325a08ff470
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr39394.c
@@ -0,0 +1,28 @@
+/* PR tree-optimization/39394 */
+
+char *p;
+int x;
+
+static inline void
+f1 (int n)
+{
+ asm volatile ("" : "=m" (*(struct { char x[n]; } *) p));
+}
+
+static inline void
+f2 (void)
+{
+ x ? f1 (1) : f1 (2);
+}
+
+static inline void
+f3 (void)
+{
+ f2 ();
+}
+
+void
+f4 (void)
+{
+ f3 ();
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/inf-2.c b/gcc/testsuite/gcc.c-torture/execute/ieee/inf-2.c
index 1823b35ff0f..dafd95835c8 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/inf-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/inf-2.c
@@ -77,7 +77,7 @@ int main()
{
test (34.0, __builtin_inf());
testf (34.0f, __builtin_inff());
- testf (34.0l, __builtin_infl());
+ testl (34.0l, __builtin_infl());
return 0;
}
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/inf-3.c b/gcc/testsuite/gcc.c-torture/execute/ieee/inf-3.c
new file mode 100644
index 00000000000..f2ee4806265
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/inf-3.c
@@ -0,0 +1,79 @@
+extern void abort (void);
+
+void test(double f, double i)
+{
+ if (f == __builtin_huge_val())
+ abort ();
+ if (f == -__builtin_huge_val())
+ abort ();
+ if (i == -__builtin_huge_val())
+ abort ();
+ if (i != __builtin_huge_val())
+ abort ();
+
+ if (f >= __builtin_huge_val())
+ abort ();
+ if (f > __builtin_huge_val())
+ abort ();
+ if (i > __builtin_huge_val())
+ abort ();
+ if (f <= -__builtin_huge_val())
+ abort ();
+ if (f < -__builtin_huge_val())
+ abort ();
+}
+
+void testf(float f, float i)
+{
+ if (f == __builtin_huge_valf())
+ abort ();
+ if (f == -__builtin_huge_valf())
+ abort ();
+ if (i == -__builtin_huge_valf())
+ abort ();
+ if (i != __builtin_huge_valf())
+ abort ();
+
+ if (f >= __builtin_huge_valf())
+ abort ();
+ if (f > __builtin_huge_valf())
+ abort ();
+ if (i > __builtin_huge_valf())
+ abort ();
+ if (f <= -__builtin_huge_valf())
+ abort ();
+ if (f < -__builtin_huge_valf())
+ abort ();
+}
+
+void testl(long double f, long double i)
+{
+ if (f == __builtin_huge_vall())
+ abort ();
+ if (f == -__builtin_huge_vall())
+ abort ();
+ if (i == -__builtin_huge_vall())
+ abort ();
+ if (i != __builtin_huge_vall())
+ abort ();
+
+ if (f >= __builtin_huge_vall())
+ abort ();
+ if (f > __builtin_huge_vall())
+ abort ();
+ if (i > __builtin_huge_vall())
+ abort ();
+ if (f <= -__builtin_huge_vall())
+ abort ();
+ if (f < -__builtin_huge_vall())
+ abort ();
+}
+
+int main()
+{
+ test (34.0, __builtin_huge_val());
+ testf (34.0f, __builtin_huge_valf());
+ testl (34.0l, __builtin_huge_vall());
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr35456.x b/gcc/testsuite/gcc.c-torture/execute/pr35456.x
new file mode 100644
index 00000000000..73b18fb7495
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr35456.x
@@ -0,0 +1,3 @@
+# VAX does not support signed zero.
+if [istarget "vax-*-*"] { return 1 }
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr39339.c b/gcc/testsuite/gcc.c-torture/execute/pr39339.c
index 539ac0646ef..6c1b9e72ede 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr39339.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr39339.c
@@ -4,8 +4,8 @@ struct C
struct D
{
unsigned int columns : 4;
- unsigned int fore : 9;
- unsigned int back : 9;
+ unsigned int fore : 12;
+ unsigned int back : 6;
unsigned int fragment : 1;
unsigned int standout : 1;
unsigned int underline : 1;
diff --git a/gcc/testsuite/gcc.dg/asm-b.c b/gcc/testsuite/gcc.dg/asm-b.c
index ec9683925c4..beb35f28d8a 100644
--- a/gcc/testsuite/gcc.dg/asm-b.c
+++ b/gcc/testsuite/gcc.dg/asm-b.c
@@ -24,8 +24,8 @@ bar (void)
#if defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) || defined (_POWER) || defined (__ppc64__)
__asm __volatile ("sthbrx %1,0,%2" : "=m" (*z) : "r" (y), "r" (z));
#elif defined __i386__ || defined __x86_64__
- __asm __volatile ("movb %b1,1(%2); movb %h1,(%2)" : "=m" (*z) : "r" (y), "r"
-(z));
+ __asm __volatile ("movb %b1,1(%2)\n\tmovb %h1,(%2)"
+ : "=m" (*z) : "Q" (y), "R" (z));
#endif
return (x & 1) == 0;
}
diff --git a/gcc/testsuite/gcc.dg/autopar/pr39500-1.c b/gcc/testsuite/gcc.dg/autopar/pr39500-1.c
new file mode 100644
index 00000000000..161f31da6a1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/pr39500-1.c
@@ -0,0 +1,28 @@
+/* pr39500: autopar fails to parallel */
+/* origin: nemokingdom@gmail.com(LiFeng) */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details" } */
+
+void abort (void);
+
+int main (void)
+{
+ int i;
+ int x[1000];
+
+ for (i = 0; i < 100; i++)
+ x[i] = x[i+100];
+
+ for (i = 0; i < 100; i++)
+ {
+ if (x[i] != x[i+100])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* Check that the first loop in parloop got parallelized. */
+
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
diff --git a/gcc/testsuite/gcc.dg/autopar/pr39500-2.c b/gcc/testsuite/gcc.dg/autopar/pr39500-2.c
new file mode 100644
index 00000000000..eabac3f88c6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/pr39500-2.c
@@ -0,0 +1,20 @@
+/* pr39500: autopar fails to parallel */
+/* origin: nemokingdom@gmail.com(LiFeng) */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details" } */
+
+int main (void)
+{
+ int i;
+ int x[1000];
+
+ for (i = 0; i < 101; i++)
+ x[i] = x[i+100];
+
+ return x[12];
+}
+
+/* This loop cannot be parallelized due to a dependence. */
+
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
diff --git a/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp b/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp
index fe42528d56f..e541f6ed3ad 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp
+++ b/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp
@@ -43,6 +43,7 @@ global compat_have_dfp
# Load procedures from common libraries.
load_lib standard.exp
load_lib gcc.exp
+load_lib target-libpath.exp
# Load the language-dependent compabibility support procedures.
load_lib c-compat.exp
@@ -90,20 +91,12 @@ set generator_src "$generator_src $srcdir/$subdir/generate-random.c"
set generator_src "$generator_src $srcdir/$subdir/generate-random_r.c"
set generator_cmd "-o $generator $skip_dfp $generator_src"
-# Temporarily unset GCC_EXEC_PREFIX from environment, as that might
-# confuse the $HOSTCC.
-set orig_gcc_exec_prefix_saved 0
-if [info exists env(GCC_EXEC_PREFIX)] {
- set orig_gcc_exec_prefix "$env(GCC_EXEC_PREFIX)"
- set orig_gcc_exec_prefix_saved 1
- unsetenv GCC_EXEC_PREFIX
-}
+# Temporarily switch to the environment for the host compiler.
+restore_ld_library_path_env_vars
set status [remote_exec build "$HOSTCC $HOSTCFLAGS $generator_cmd"]
set status [lindex $status 0]
-if { $orig_gcc_exec_prefix_saved } {
- set orig_gcc_exec_prefix_saved 0
- setenv GCC_EXEC_PREFIX "$orig_gcc_exec_prefix"
-}
+set_ld_library_path_env_vars
+
if { $status == 0 } then {
file delete -force $tstobjdir
file mkdir $tstobjdir
diff --git a/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c b/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c
index 2e2943dd513..f563c2774bd 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c
@@ -44,6 +44,7 @@ along with GCC; see the file COPYING3. If not see
const char *dg_options[] = {
"/* { dg-options \"%s-I%s\" } */\n",
+"/* { dg-options \"%s-I%s -Wno-abi\" } */\n",
"/* { dg-options \"%s-I%s -mno-mmx -Wno-abi\" { target i?86-*-* x86_64-*-* } } */\n",
"/* { dg-options \"%s-I%s -fno-common\" { target hppa*-*-hpux* powerpc*-*-darwin* *-*-mingw32* *-*-cygwin* } } */\n",
"/* { dg-options \"%s-I%s -mno-mmx -fno-common -Wno-abi\" { target i?86-*-darwin* x86_64-*-darwin* } } */\n",
@@ -789,6 +790,8 @@ switchfiles (int fields)
fprintf (outfile, "/* { dg-require-effective-target int32plus } */\n");
for (i = 0; i < NDG_OPTIONS; i++)
fprintf (outfile, dg_options[i], "", srcdir_safe);
+ fprintf (outfile, "/* { dg-prune-output \".*-Wno-abi.*\" } */\n");
+ fprintf (outfile, "/* { dg-prune-output \".*Offset of packed bit-field.*\" } */\n");
fprintf (outfile, "\
#include \"struct-layout-1.h\"\n\
\n\
diff --git a/gcc/testsuite/gcc.dg/compat/struct-layout-1_main.c b/gcc/testsuite/gcc.dg/compat/struct-layout-1_main.c
index 0a2fb42c792..b59453e0b10 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-layout-1_main.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-layout-1_main.c
@@ -1,3 +1,5 @@
+/* { dg-prune-output ".*-Wno-abi.*" } */
+
#include "struct-layout-1.h"
#define TX(n, type, attrs, fields, ops) extern void test##n (void);
diff --git a/gcc/testsuite/gcc.dg/debug/pr39412.c b/gcc/testsuite/gcc.dg/debug/pr39412.c
new file mode 100644
index 00000000000..71b7b5e21a9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr39412.c
@@ -0,0 +1,16 @@
+/* PR debug/39412 */
+/* { dg-do compile } */
+
+struct S { int i; };
+
+inline void
+bar (const void *x, unsigned long y)
+{
+ const union { struct S a[y]; } *u = x;
+}
+
+void
+foo (const void *x, unsigned long y)
+{
+ bar (x, y);
+}
diff --git a/gcc/testsuite/gcc.dg/gomp/pr39495-1.c b/gcc/testsuite/gcc.dg/gomp/pr39495-1.c
new file mode 100644
index 00000000000..cc165ca52db
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr39495-1.c
@@ -0,0 +1,95 @@
+/* PR c/39495 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+#define INT_MIN (-__INT_MAX__ - 1)
+#define INT_MAX __INT_MAX__
+#define UINT_MAX (2U * __INT_MAX__ + 1)
+
+int
+foo (void)
+{
+ int i;
+ unsigned int u;
+
+#pragma omp for
+ for (i = INT_MIN + 6; i > INT_MIN + 1; i--)
+ ;
+#pragma omp for
+ for (i = INT_MIN + 6; i >= INT_MIN + 1; i--)
+ ;
+#pragma omp for
+ for (i = INT_MIN + 6; i > INT_MIN; i--)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i < INT_MAX - 1; i++)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i <= INT_MAX - 1; i++)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i < INT_MAX; i++)
+ ;
+#pragma omp for
+ for (u = 6; u > 1; u--)
+ ;
+#pragma omp for
+ for (u = 6; u >= 1; u--)
+ ;
+#pragma omp for
+ for (u = 6; u > 0; u--)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u < UINT_MAX - 1; u++)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u <= UINT_MAX - 1; u++)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u < UINT_MAX; u++)
+ ;
+}
+
+int
+bar (void)
+{
+ int i;
+ unsigned int u;
+
+#pragma omp for
+ for (i = INT_MIN + 6; i > INT_MIN + 1; i -= 2)
+ ;
+#pragma omp for
+ for (i = INT_MIN + 6; i >= INT_MIN + 1; i -= 2)
+ ;
+#pragma omp for
+ for (i = INT_MIN + 6; i > INT_MIN; i -= 2)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i < INT_MAX - 1; i += 2)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i <= INT_MAX - 1; i += 2)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i < INT_MAX; i += 2)
+ ;
+#pragma omp for
+ for (u = 6; u > 1; u -= 2)
+ ;
+#pragma omp for
+ for (u = 6; u >= 1; u -= 2)
+ ;
+#pragma omp for
+ for (u = 6; u > 0; u -= 2)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u < UINT_MAX - 1; u += 2)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u <= UINT_MAX - 1; u += 2)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u < UINT_MAX; u += 2)
+ ;
+}
diff --git a/gcc/testsuite/gcc.dg/gomp/pr39495-2.c b/gcc/testsuite/gcc.dg/gomp/pr39495-2.c
new file mode 100644
index 00000000000..a276c24ed98
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr39495-2.c
@@ -0,0 +1,39 @@
+/* PR c/39495 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+#define INT_MIN (-__INT_MAX__ - 1)
+#define INT_MAX __INT_MAX__
+#define UINT_MAX (2U * __INT_MAX__ + 1)
+
+int
+foo (void)
+{
+ int i;
+ unsigned int u;
+
+#pragma omp for
+ for (i = INT_MIN + 6; i != INT_MIN; i--) /* { dg-error "invalid controlling predicate" } */
+ ;
+#pragma omp for
+ for (i = INT_MIN + 6; i == INT_MIN; i--) /* { dg-error "invalid controlling predicate" } */
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i != INT_MAX; i++) /* { dg-error "invalid controlling predicate" } */
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i == INT_MAX; i++) /* { dg-error "invalid controlling predicate" } */
+ ;
+#pragma omp for
+ for (u = 6; u != 0; u--) /* { dg-error "invalid controlling predicate" } */
+ ;
+#pragma omp for
+ for (u = 6; u == 0; u--) /* { dg-error "invalid controlling predicate" } */
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u != UINT_MAX; u++) /* { dg-error "invalid controlling predicate" } */
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u == UINT_MAX; u++) /* { dg-error "invalid controlling predicate" } */
+ ;
+}
diff --git a/gcc/testsuite/gcc.dg/inline-33.c b/gcc/testsuite/gcc.dg/inline-33.c
new file mode 100644
index 00000000000..ac577e3cb88
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/inline-33.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+/* { dg-options "-O3 -fdump-tree-optimized -fpie" { target { ! nonpic } } } */
+
+int i;
+
+int foo ();
+
+main ()
+{
+ return foo (i);
+}
+
+int foo (i)
+ int i;
+{
+ return bar(i);
+}
+
+/* { dg-final { scan-tree-dump-times "bar" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr11492.c b/gcc/testsuite/gcc.dg/pr11492.c
index 4a8b617617f..86630995344 100644
--- a/gcc/testsuite/gcc.dg/pr11492.c
+++ b/gcc/testsuite/gcc.dg/pr11492.c
@@ -5,7 +5,7 @@ int main( void )
{
unsigned int a;
unsigned char b;
- for ( a = 0, b = 2; a > b * 1000; a++ ) /* { dg-bogus "comparison between signed and unsigned integer" "" { xfail { ! int32plus } } } */
+ for ( a = 0, b = 2; a > b * 100; a++ ) /* { dg-bogus "comparison between signed and unsigned integer" "" } */
{ ; }
return 0;
diff --git a/gcc/testsuite/gcc.dg/pr27898.c b/gcc/testsuite/gcc.dg/pr27898.c
new file mode 100644
index 00000000000..bb7cce17550
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr27898.c
@@ -0,0 +1,8 @@
+/* PR c/27898 */
+/* { dg-do compile } */
+/* { dg-options "--combine" } */
+/* { dg-additional-sources "pr27898.c" } */
+
+union u { struct { int i; }; };
+
+extern int foo (union u *);
diff --git a/gcc/testsuite/gcc.dg/pr39443.c b/gcc/testsuite/gcc.dg/pr39443.c
new file mode 100644
index 00000000000..1baa63a9985
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr39443.c
@@ -0,0 +1,18 @@
+/* PR middle-end/39443 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not "memcmp" } } */
+
+typedef __SIZE_TYPE__ size_t;
+
+extern int memcmp (const void *s1, const void *s2, size_t n)
+ __attribute__ ((__nothrow__, __pure__));
+extern __typeof (memcmp) memcmp __asm__ ("memory_compare");
+
+int
+test (char *s, char *t, int cnt)
+{
+ if (__builtin_expect (cnt, 0))
+ return memcmp (s, t, cnt);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr39455.c b/gcc/testsuite/gcc.dg/pr39455.c
new file mode 100644
index 00000000000..8e8c67034f2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr39455.c
@@ -0,0 +1,13 @@
+/* PR tree-optimization/39455 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -w" } */
+
+void
+foo (char *x, unsigned long y, unsigned char *z)
+{
+ unsigned int c[256], *d;
+
+ for (d = c + 1; d < c + 256; ++d)
+ *d += d[-1];
+ x[--c[z[y]]] = 0;
+}
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76b.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76b.c
index 3aac4c90005..4969a31e0ab 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76b.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76b.c
@@ -11,12 +11,12 @@
more involved than just an ssa_name. */
int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 0, 1, 3, 5, 7, 11, 13, 17};
+int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 0, 1, 3, 5, 7, 11, 13, 17};
int main1 (int *pib)
{
int i;
int ia[N+OFF];
- int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 0, 1, 3, 5, 7, 11, 13, 17};
for (i = OFF; i < N; i++)
{
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c
index f6127ba873b..573d8aacdd4 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c
@@ -11,12 +11,12 @@
more involved than just an ssa_name. */
int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
+int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
int main1 (int *pib)
{
int i;
int ia[N+OFF];
- int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
for (i = OFF; i < N; i++)
{
diff --git a/gcc/testsuite/gcc.dg/vect/pr39529.c b/gcc/testsuite/gcc.dg/vect/pr39529.c
new file mode 100644
index 00000000000..4853c13503f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr39529.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+void
+foo (void)
+{
+ char a[1024];
+ char *p = &a[0];
+ char *p2;
+
+ p2 = p + 1024;
+ do
+ {
+ p += 2;
+ *(p-2) = 1;
+ *(p-1) = 1;
+ } while (p < p2);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc/testsuite/gcc.dg/vect/vect-82.c b/gcc/testsuite/gcc.dg/vect/vect-82.c
index e962f8f61fe..7fbaa92163d 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-82.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-82.c
@@ -1,5 +1,4 @@
-/* { dg-do run { target powerpc*-*-* } } */
-/* { dg-require-effective-target vect_int } */
+/* { dg-skip-if "powerpc and integer vectorization only" { ! { powerpc*-*-* && vect_int } } { "*" } { "" } } */
#include <stdarg.h>
#include "tree-vect.h"
diff --git a/gcc/testsuite/gcc.dg/vect/vect-83.c b/gcc/testsuite/gcc.dg/vect/vect-83.c
index 4cebd7f1b8a..c031db9df63 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-83.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-83.c
@@ -1,5 +1,4 @@
-/* { dg-do run { target powerpc*-*-* } } */
-/* { dg-require-effective-target vect_int } */
+/* { dg-skip-if "powerpc and integer vectorization only" { ! { powerpc*-*-* && vect_int } } { "*" } { "" } } */
#include <stdarg.h>
#include "tree-vect.h"
diff --git a/gcc/testsuite/gcc.dg/wdisallowed-functions-3.c b/gcc/testsuite/gcc.dg/wdisallowed-functions-3.c
new file mode 100644
index 00000000000..5b8b31bdfc9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/wdisallowed-functions-3.c
@@ -0,0 +1,10 @@
+/* PR c++/39554 */
+/* { dg-do compile } */
+/* { dg-options "-Wdisallowed-function-list=bar" } */
+
+void
+foo (void (*p) (void), void (*bar) (void))
+{
+ p ();
+ bar ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr39431.c b/gcc/testsuite/gcc.target/i386/pr39431.c
new file mode 100644
index 00000000000..756bdb9ebb8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr39431.c
@@ -0,0 +1,15 @@
+/* PR target/39431 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -march=i686 -fpic" { target { ilp32 && fpic } } } */
+
+extern void bar (char *, int);
+
+int
+foo (long long *p, long long oldv, long long *q, int n)
+{
+ char buf[n];
+ bar (buf, n);
+ p[256 + n] = __sync_val_compare_and_swap (p + n, oldv, oldv + 6);
+ return __sync_bool_compare_and_swap (q + n, oldv, oldv + 8);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr39445.c b/gcc/testsuite/gcc.target/i386/pr39445.c
new file mode 100644
index 00000000000..6f0295bc1e0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr39445.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-Os -msse2" } */
+
+#include "sse2-check.h"
+
+typedef struct { __m128 f __attribute__((packed)); } packed;
+
+__m128 __attribute__((noinline))
+foo (__m128 a1, __m128 a2, __m128 a3, __m128 a4,
+ __m128 a5, __m128 a6, __m128 a7, __m128 a8,
+ int b1, int b2, int b3, int b4, int b5, int b6, int b7, packed y)
+{
+ return y.f;
+}
+
+void
+sse2_test (void)
+{
+ packed x;
+ __m128 y = { 0 };
+ x.f = y;
+ y = foo (y, y, y, y, y, y, y, y, 1, 2, 3, 4, 5, 6, -1, x);
+ if (__builtin_memcmp (&y, &x.f, sizeof (y)) != 0)
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr39482.c b/gcc/testsuite/gcc.target/i386/pr39482.c
new file mode 100644
index 00000000000..4e2dfa724a9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr39482.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-mno-sse2" } */
+
+extern double log (double __x);
+
+double foo (unsigned long int m_liOutputBufferLen)
+{
+ return log ((double) m_liOutputBufferLen);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr39496.c b/gcc/testsuite/gcc.target/i386/pr39496.c
new file mode 100644
index 00000000000..d90a2c7f3ea
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr39496.c
@@ -0,0 +1,35 @@
+/* PR target/39496 */
+/* { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* } && ilp32 } } } */
+/* { dg-options "-O0 -fverbose-asm -fno-omit-frame-pointer -msse2 -mfpmath=sse" } */
+/* Verify that {foo,bar}{,2}param are all passed on the stack, using
+ normal calling conventions, when not optimizing. */
+/* { dg-final { scan-assembler "\[^0-9-\]8\\(%ebp\\),\[^\n\]*fooparam," } } */
+/* { dg-final { scan-assembler "\[^0-9-\]8\\(%ebp\\),\[^\n\]*barparam," } } */
+/* { dg-final { scan-assembler "\[^0-9-\]8\\(%ebp\\),\[^\n\]*foo2param," } } */
+/* { dg-final { scan-assembler "\[^0-9-\]8\\(%ebp\\),\[^\n\]*bar2param," } } */
+
+static inline int foo (int fooparam)
+{
+ return fooparam;
+}
+
+static int bar (int barparam)
+{
+ return foo (barparam);
+}
+
+static inline double foo2 (double foo2param)
+{
+ return foo2param;
+}
+
+static double bar2 (double bar2param)
+{
+ return foo2 (bar2param);
+}
+
+int
+main ()
+{
+ return bar (0) + bar2 (0.0);
+}
diff --git a/gcc/testsuite/gcc.target/i386/push-1.c b/gcc/testsuite/gcc.target/i386/push-1.c
index cf5a1041364..da9b39ec9b5 100644
--- a/gcc/testsuite/gcc.target/i386/push-1.c
+++ b/gcc/testsuite/gcc.target/i386/push-1.c
@@ -12,4 +12,4 @@ bar (void)
foo (x, x, x, x, 5);
}
-/* { dg-final { scan-assembler-not "movups" } } */
+/* { dg-final { scan-assembler-not "movups" { xfail *-*-* } } } */
diff --git a/gcc/testsuite/gcc.target/i386/stackalign/longlong-1.c b/gcc/testsuite/gcc.target/i386/stackalign/longlong-1.c
new file mode 100644
index 00000000000..225d0c5e558
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/stackalign/longlong-1.c
@@ -0,0 +1,15 @@
+/* PR target/39137 */
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O2 -mpreferred-stack-boundary=2" } */
+/* Make sure dynamic stack realignment isn't performed just because there
+ are long long variables. */
+/* { dg-final { scan-assembler-not "and\[lq\]?\[^\\n\]*-8,\[^\\n\]*sp" } } */
+
+void fn (void *);
+
+void f1 (void)
+{
+ unsigned long long a;
+ fn (&a);
+}
diff --git a/gcc/testsuite/gcc.target/i386/stackalign/longlong-2.c b/gcc/testsuite/gcc.target/i386/stackalign/longlong-2.c
new file mode 100644
index 00000000000..ae7f3ee333a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/stackalign/longlong-2.c
@@ -0,0 +1,33 @@
+/* { dg-do compile { target { ! *-*-darwin* } } } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O2 -mpreferred-stack-boundary=2" } */
+/* { dg-final { scan-assembler-times "and\[lq\]?\[^\\n\]*-8,\[^\\n\]*sp" 2 } } */
+/* { dg-final { scan-assembler-times "and\[lq\]?\[^\\n\]*-16,\[^\\n\]*sp" 2 } } */
+
+void fn (void *);
+
+void f2 (void)
+{
+ unsigned long long a __attribute__((aligned (8)));
+ fn (&a);
+}
+
+void f3 (void)
+{
+ typedef unsigned long long L __attribute__((aligned (8)));
+ L a;
+ fn (&a);
+}
+
+void f4 (void)
+{
+ unsigned long long a __attribute__((aligned (16)));
+ fn (&a);
+}
+
+void f5 (void)
+{
+ typedef unsigned long long L __attribute__((aligned (16)));
+ L a;
+ fn (&a);
+}
diff --git a/gcc/testsuite/gcc.target/ia64/20090324-1.c b/gcc/testsuite/gcc.target/ia64/20090324-1.c
new file mode 100644
index 00000000000..d9aff6a18b4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/ia64/20090324-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fmodulo-sched" } */
+
+static char *place_region_bounds_x, *place_region_bounds_y;
+static void read_place () {
+ char msg[300];
+ update_screen (msg);
+}
+static void alloc_and_load_placement_structs () {
+ int i, j;
+ for (j=0;
+ j<100;
+ j++) {
+ place_region_bounds_x[i] = place_region_bounds_x[i-1];
+ place_region_bounds_y[i] = place_region_bounds_y[i-1];
+ }
+}
+void place_and_route () {
+ read_place ();
+ alloc_and_load_placement_structs ();
+}
diff --git a/gcc/testsuite/gcc.target/s390/20090223-1.c b/gcc/testsuite/gcc.target/s390/20090223-1.c
new file mode 100644
index 00000000000..443ccb9aa69
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/20090223-1.c
@@ -0,0 +1,60 @@
+/* The RTL loop optimizer used to replace the output register of the
+ inline assembly with a pseudo although the variable is declared as
+ register asm ("0"). */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+static unsigned char __attribute__ ((always_inline))
+mytoupper (unsigned char c)
+{
+ if (c >= 'a' && c <= 'z')
+ c -= 'a' - 'A';
+ return c;
+}
+
+static unsigned long __attribute__ ((always_inline))
+strlen (const char *s)
+{
+ register unsigned long r0 asm ("0");
+ const char *tmp = s;
+
+ asm (
+#ifdef __s390x__
+ " lghi %0, 0\n"
+#else
+ " lhi %0, 0\n"
+#endif
+ "0:srst %0,%1\n"
+ " jo 0b"
+ : "=d" (r0), "+a" (tmp)
+ :
+ :"cc");
+ return r0 - (unsigned long) s;
+}
+
+char boot_command_line[] = "this is a test";
+
+void __attribute__ ((noinline))
+foo (char *str)
+{
+ if (strcmp (str, "THIS IS A TEST") != 0)
+ abort ();
+}
+
+int
+main ()
+{
+ char upper_command_line[1024];
+ int i;
+
+ for (i = 0; i < strlen (boot_command_line); i++)
+ upper_command_line[i] = mytoupper (boot_command_line[i]);
+
+ upper_command_line[strlen (boot_command_line)] = 0;
+ foo (upper_command_line);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect.c b/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect.c
index 8c1cac82e1b..0c0cbb271ca 100644
--- a/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect.c
+++ b/gcc/testsuite/gcc.target/x86_64/abi/callabi/func-indirect.c
@@ -20,5 +20,5 @@ int main()
volatile func callme = callback;
if(callme(0, 0, 0, 0, 0x1234567890abcdefLL))
abort();
+ return 0;
}
-
diff --git a/gcc/testsuite/gfortran.dg/fmt_f0_1.f90 b/gcc/testsuite/gfortran.dg/fmt_f0_1.f90
new file mode 100644
index 00000000000..166846b87fe
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/fmt_f0_1.f90
@@ -0,0 +1,17 @@
+! { dg-do run )
+! PR39304 write of 0.0 with F0.3 gives **
+! Test case developed from case provided by reporter.
+ REAL :: x
+ CHARACTER(80) :: str
+ x = 0.0
+ write (str,'(f0.0)') x
+ if (str.ne."0.") call abort
+ write (str,'(f0.1)') x
+ if (str.ne."0.0") call abort
+ write (str,'(f0.2)') x
+ if (str.ne."0.00") call abort
+ write (str,'(f0.3)') x
+ if (str.ne."0.000") call abort
+ write (str,'(f0.4)') x
+ if (str.ne."0.0000") call abort
+ END
diff --git a/gcc/testsuite/gfortran.dg/pr39516.f b/gcc/testsuite/gfortran.dg/pr39516.f
new file mode 100644
index 00000000000..3d6104a8ebf
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr39516.f
@@ -0,0 +1,20 @@
+C PR tree-optimization/39516
+C { dg-do compile }
+C { dg-options "-O2 -ftree-loop-linear" }
+ SUBROUTINE SUB(A, B, M)
+ IMPLICIT NONE
+ DOUBLE PRECISION A(20,20), B(20)
+ INTEGER*8 I, J, K, M
+ DO I=1,M
+ DO J=1,M
+ A(I,J)=A(I,J)+1
+ END DO
+ END DO
+ DO K=1,20
+ DO I=1,M
+ DO J=1,M
+ B(I)=B(I)+A(I,J)
+ END DO
+ END DO
+ END DO
+ END SUBROUTINE
diff --git a/gcc/testsuite/gfortran.dg/read_repeat.f90 b/gcc/testsuite/gfortran.dg/read_repeat.f90
new file mode 100644
index 00000000000..192ebe81ffb
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/read_repeat.f90
@@ -0,0 +1,24 @@
+! { dg-do run }
+! PR39528 repeated entries not read when using list-directed input.
+! Test case derived from reporters example.
+program rread
+ implicit none
+ integer :: iarr(1:7), ia, ib, i
+
+ iarr = 0
+
+ write(10,*) " 2*1 3*2 /"
+ write(10,*) " 12"
+ write(10,*) " 13"
+ rewind(10)
+
+ read(10,*) (iarr(i), i=1,7)
+ read(10,*) ia, ib
+
+ if (any(iarr(1:2).ne.1)) call abort
+ if (any(iarr(3:5).ne.2)) call abort
+ if (any(iarr(6:7).ne.0)) call abort
+ if (ia .ne. 12 .or. ib .ne. 13) call abort
+
+ close(10, status="delete")
+end program rread
diff --git a/gcc/testsuite/gnat.dg/slice_enum.adb b/gcc/testsuite/gnat.dg/slice_enum.adb
new file mode 100644
index 00000000000..cdaea47d65c
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/slice_enum.adb
@@ -0,0 +1,8 @@
+-- { dg-do compile }
+
+procedure Slice_Enum is
+ Pos : array (Boolean) of Integer;
+begin
+ Pos (Boolean) := (others => 0);
+end;
+
diff --git a/gcc/testsuite/lib/compat.exp b/gcc/testsuite/lib/compat.exp
index 049e5a23270..a4ec3601e56 100644
--- a/gcc/testsuite/lib/compat.exp
+++ b/gcc/testsuite/lib/compat.exp
@@ -170,6 +170,7 @@ proc compat-get-options-main { src } {
foreach op $tmp {
set cmd [lindex $op 0]
if { ![string compare "dg-options" $cmd] \
+ || [string match "dg-prune-output" $cmd] \
|| [string match "dg-skip-if" $cmd] \
|| [string match "dg-require-*" $cmd] } {
set status [catch "$op" errmsg]
@@ -215,6 +216,7 @@ proc compat-get-options { src } {
foreach op $tmp {
set cmd [lindex $op 0]
if { ![string compare "dg-options" $cmd] \
+ || ![string compare "dg-prune-output" $cmd] \
|| ![string compare "dg-xfail-if" $cmd] } {
set status [catch "$op" errmsg]
if { $status != 0 } {
diff --git a/gcc/testsuite/lib/gcc-defs.exp b/gcc/testsuite/lib/gcc-defs.exp
index 0570f41e6d7..7bcbcabc087 100644
--- a/gcc/testsuite/lib/gcc-defs.exp
+++ b/gcc/testsuite/lib/gcc-defs.exp
@@ -49,6 +49,11 @@ proc ${tool}_check_compile {testcase option objname gcc_output} {
set gcc_output [prune_warnings $gcc_output]
+ if { [info proc ${tool}-dg-prune] != "" } {
+ global target_triplet
+ set gcc_output [${tool}-dg-prune $target_triplet $gcc_output]
+ }
+
set unsupported_message [${tool}_check_unsupported_p $gcc_output]
if { $unsupported_message != "" } {
unsupported "$testcase: $unsupported_message"
diff --git a/gcc/testsuite/lib/target-libpath.exp b/gcc/testsuite/lib/target-libpath.exp
index 8999aa47980..c95cba6d784 100644
--- a/gcc/testsuite/lib/target-libpath.exp
+++ b/gcc/testsuite/lib/target-libpath.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,6 +25,8 @@ set orig_ld_library64_path_saved 0
set orig_ld_library_path_32_saved 0
set orig_ld_library_path_64_saved 0
set orig_dyld_library_path_saved 0
+set orig_gcc_exec_prefix_saved 0
+set orig_gcc_exec_prefix_checked 0
#######################################
@@ -42,6 +44,8 @@ proc set_ld_library_path_env_vars { } {
global orig_ld_library_path_32_saved
global orig_ld_library_path_64_saved
global orig_dyld_library_path_saved
+ global orig_gcc_exec_prefix_saved
+ global orig_gcc_exec_prefix_checked
global orig_ld_library_path
global orig_ld_run_path
global orig_shlib_path
@@ -50,11 +54,23 @@ proc set_ld_library_path_env_vars { } {
global orig_ld_library_path_32
global orig_ld_library_path_64
global orig_dyld_library_path
- global GCC_EXEC_PREFIX
+ global orig_gcc_exec_prefix
+ global TEST_GCC_EXEC_PREFIX
+ global env
- # Set the relocated compiler prefix, but only if the user hasn't specified one.
- if { [info exists GCC_EXEC_PREFIX] && ![info exists env(GCC_EXEC_PREFIX)] } {
- setenv GCC_EXEC_PREFIX "$GCC_EXEC_PREFIX"
+ # Save the original GCC_EXEC_PREFIX.
+ if { $orig_gcc_exec_prefix_checked == 0 } {
+ if [info exists env(GCC_EXEC_PREFIX)] {
+ set orig_gcc_exec_prefix "$env(GCC_EXEC_PREFIX)"
+ set orig_gcc_exec_prefix_saved 1
+ }
+ set orig_gcc_exec_prefix_checked 1
+ }
+
+ # Set GCC_EXEC_PREFIX for the compiler under test to pick up files not in
+ # the build tree from a specified location (normally the install tree).
+ if [info exists TEST_GCC_EXEC_PREFIX] {
+ setenv GCC_EXEC_PREFIX "$TEST_GCC_EXEC_PREFIX"
}
# Setting the ld library path causes trouble when testing cross-compilers.
@@ -63,8 +79,6 @@ proc set_ld_library_path_env_vars { } {
}
if { $orig_environment_saved == 0 } {
- global env
-
set orig_environment_saved 1
# Save the original environment.
@@ -187,6 +201,7 @@ proc restore_ld_library_path_env_vars { } {
global orig_ld_library_path_32_saved
global orig_ld_library_path_64_saved
global orig_dyld_library_path_saved
+ global orig_gcc_exec_prefix_saved
global orig_ld_library_path
global orig_ld_run_path
global orig_shlib_path
@@ -195,11 +210,19 @@ proc restore_ld_library_path_env_vars { } {
global orig_ld_library_path_32
global orig_ld_library_path_64
global orig_dyld_library_path
+ global orig_gcc_exec_prefix
+ global env
if { $orig_environment_saved == 0 } {
return
}
+ if { $orig_gcc_exec_prefix_saved } {
+ setenv GCC_EXEC_PREFIX "$orig_gcc_exec_prefix"
+ } elseif [info exists env(GCC_EXEC_PREFIX)] {
+ unsetenv GCC_EXEC_PREFIX
+ }
+
if { $orig_ld_library_path_saved } {
setenv LD_LIBRARY_PATH "$orig_ld_library_path"
} elseif [info exists env(LD_LIBRARY_PATH)] {
diff --git a/gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp b/gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp
index 257c28e4805..b137b751ae0 100644
--- a/gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp
+++ b/gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp
@@ -17,6 +17,7 @@
# Load support procs.
load_lib objc-dg.exp
+load_lib target-libpath.exp
# If a testcase doesn't have special options, use these.
global DEFAULT_CFLAGS
@@ -37,20 +38,11 @@ set generator_src "$srcdir/$subdir/struct-layout-encoding-1_generate.c"
set generator_src "$generator_src $srcdir/$subdir/generate-random.c"
set generator_src "$generator_src $srcdir/$subdir/generate-random_r.c"
set generator_cmd "-o $generator $generator_src"
-# Temporarily unset GCC_EXEC_PREFIX from environment, as that might
-# confuse the $HOSTCC.
-set orig_gcc_exec_prefix_saved 0
-if [info exists env(GCC_EXEC_PREFIX)] {
- set orig_gcc_exec_prefix "$env(GCC_EXEC_PREFIX)"
- set orig_gcc_exec_prefix_saved 1
- unsetenv GCC_EXEC_PREFIX
-}
+# Temporarily switch to the environment of the host compiler.
+restore_ld_library_path_env_vars
set status [remote_exec build "$HOSTCC $HOSTCFLAGS $generator_cmd"]
set status [lindex $status 0]
-if { $orig_gcc_exec_prefix_saved } {
- set orig_gcc_exec_prefix_saved 0
- setenv GCC_EXEC_PREFIX "$orig_gcc_exec_prefix"
-}
+set_ld_library_path_env_vars
if { $status == 0 } then {
file delete -force $tstobjdir
file mkdir $tstobjdir
diff --git a/gcc/testsuite/objc/execute/exceptions/handler-1.m b/gcc/testsuite/objc/execute/exceptions/handler-1.m
new file mode 100644
index 00000000000..9cd8df19c44
--- /dev/null
+++ b/gcc/testsuite/objc/execute/exceptions/handler-1.m
@@ -0,0 +1,38 @@
+/* Test custom exception handlers */
+/* Author: David Ayers */
+
+#include <objc/objc-api.h>
+#include <objc/Object.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+static unsigned int handlerExpected = 0;
+
+void
+my_exception_handler(id excp)
+{
+ /* Returning from the handler would abort. */
+ if (handlerExpected)
+ exit(0);
+
+ abort();
+}
+
+int
+main(int argc, char *argv[])
+{
+ _objc_unexpected_exception = my_exception_handler;
+
+ @try
+ {
+ @throw [Object new];
+ }
+ @catch (id exc)
+ {
+ handlerExpected = 1;
+ }
+
+ @throw [Object new];
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/trivial.m b/gcc/testsuite/objc/execute/trivial.m
new file mode 100644
index 00000000000..f1dce2c1e2b
--- /dev/null
+++ b/gcc/testsuite/objc/execute/trivial.m
@@ -0,0 +1,7 @@
+#import <objc/Object.h>
+
+int main(void)
+{
+ [Object class];
+ return 0;
+}
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 45262f313d8..b1bc28afca2 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -1796,9 +1796,21 @@ remove_useless_stmts_bind (gimple_stmt_iterator *gsi, struct rus_data *data ATTR
|| (TREE_CODE (BLOCK_ABSTRACT_ORIGIN (block))
!= FUNCTION_DECL)))
{
- gsi_insert_seq_before (gsi, body_seq, GSI_SAME_STMT);
- gsi_remove (gsi, false);
- data->repeat = true;
+ tree var = NULL_TREE;
+ /* Even if there are no gimple_bind_vars, there might be other
+ decls in BLOCK_VARS rendering the GIMPLE_BIND not useless. */
+ if (block && !BLOCK_NUM_NONLOCALIZED_VARS (block))
+ for (var = BLOCK_VARS (block); var; var = TREE_CHAIN (var))
+ if (TREE_CODE (var) == IMPORTED_DECL)
+ break;
+ if (var || (block && BLOCK_NUM_NONLOCALIZED_VARS (block)))
+ gsi_next (gsi);
+ else
+ {
+ gsi_insert_seq_before (gsi, body_seq, GSI_SAME_STMT);
+ gsi_remove (gsi, false);
+ data->repeat = true;
+ }
}
else
gsi_next (gsi);
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 7c062602a1a..ea67f1d00b4 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -2302,7 +2302,7 @@ analyze_subscript_affine_affine (tree chrec_a,
/* If the overlap occurs outside of the bounds of the
loop, there is no dependence. */
- if (x1 > niter || y1 > niter)
+ if (x1 >= niter || y1 >= niter)
{
*overlaps_a = conflict_fn_no_dependence ();
*overlaps_b = conflict_fn_no_dependence ();
diff --git a/gcc/tree-data-ref.h b/gcc/tree-data-ref.h
index 25532f41702..40bdadb84a1 100644
--- a/gcc/tree-data-ref.h
+++ b/gcc/tree-data-ref.h
@@ -292,14 +292,6 @@ struct data_dependence_relation
struct data_reference *a;
struct data_reference *b;
- /* When the dependence relation is affine, it can be represented by
- a distance vector. */
- bool affine_p;
-
- /* Set to true when the dependence relation is on the same data
- access. */
- bool self_reference_p;
-
/* A "yes/no/maybe" field for the dependence relation:
- when "ARE_DEPENDENT == NULL_TREE", there exist a dependence
@@ -321,18 +313,26 @@ struct data_dependence_relation
/* The analyzed loop nest. */
VEC (loop_p, heap) *loop_nest;
- /* An index in loop_nest for the innermost loop that varies for
- this data dependence relation. */
- unsigned inner_loop;
-
/* The classic direction vector. */
VEC (lambda_vector, heap) *dir_vects;
/* The classic distance vector. */
VEC (lambda_vector, heap) *dist_vects;
+ /* An index in loop_nest for the innermost loop that varies for
+ this data dependence relation. */
+ unsigned inner_loop;
+
/* Is the dependence reversed with respect to the lexicographic order? */
bool reversed_p;
+
+ /* When the dependence relation is affine, it can be represented by
+ a distance vector. */
+ bool affine_p;
+
+ /* Set to true when the dependence relation is on the same data
+ access. */
+ bool self_reference_p;
};
typedef struct data_dependence_relation *ddr_p;
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 7ee20d0d835..b2f6805fb23 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -1,6 +1,6 @@
/* Data flow functions for trees.
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software
- Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
+ Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@redhat.com>
This file is part of GCC.
@@ -649,7 +649,7 @@ set_default_def (tree var, tree def)
/* Add VAR to the list of referenced variables if it isn't already there. */
-void
+bool
add_referenced_var (tree var)
{
var_ann_t v_ann;
@@ -665,7 +665,7 @@ add_referenced_var (tree var)
/* Tag's don't have DECL_INITIAL. */
if (MTAG_P (var))
- return;
+ return true;
/* Scan DECL_INITIAL for pointer variables as they may contain
address arithmetic referencing the address of other
@@ -677,7 +677,11 @@ add_referenced_var (tree var)
optimizers. */
&& !DECL_EXTERNAL (var))
walk_tree (&DECL_INITIAL (var), find_vars_r, NULL, 0);
+
+ return true;
}
+
+ return false;
}
/* Remove VAR from the list. */
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 9bb71d474a4..21a5f9781ef 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -769,7 +769,7 @@ extern void dump_referenced_vars (FILE *);
extern void dump_variable (FILE *, tree);
extern void debug_variable (tree);
extern tree get_virtual_var (tree);
-extern void add_referenced_var (tree);
+extern bool add_referenced_var (tree);
extern void remove_referenced_var (tree);
extern void mark_symbols_for_renaming (gimple);
extern void find_new_referenced_vars (gimple);
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index bdfd764cad9..cf1eb5c664e 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1,5 +1,5 @@
/* Tree inlining.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Alexandre Oliva <aoliva@redhat.com>
@@ -2110,6 +2110,10 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
We need to construct map for the variable anyway as it might be used
in different SSA names when parameter is set in function.
+ Do replacement at -O0 for const arguments replaced by constant.
+ This is important for builtin_constant_p and other construct requiring
+ constant argument to be visible in inlined function body.
+
FIXME: This usually kills the last connection in between inlined
function parameter and the actual value in debug info. Can we do
better here? If we just inserted the statement, copy propagation
@@ -2118,7 +2122,9 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
We might want to introduce a notion that single SSA_NAME might
represent multiple variables for purposes of debugging. */
if (gimple_in_ssa_p (cfun) && rhs && def && is_gimple_reg (p)
- && optimize
+ && (optimize
+ || (TREE_READONLY (p)
+ && is_gimple_min_invariant (rhs)))
&& (TREE_CODE (rhs) == SSA_NAME
|| is_gimple_min_invariant (rhs))
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (def))
@@ -3389,7 +3395,7 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
var = TREE_VALUE (t_step);
if (TREE_STATIC (var) && !TREE_ASM_WRITTEN (var))
{
- if (var_ann (var) && referenced_var_check_and_insert (var))
+ if (var_ann (var) && add_referenced_var (var))
cfun->local_decls = tree_cons (NULL_TREE, var,
cfun->local_decls);
}
diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c
index 40e7508f613..7e811cf8c9d 100644
--- a/gcc/tree-nrv.c
+++ b/gcc/tree-nrv.c
@@ -121,6 +121,10 @@ tree_nrv (void)
if (is_gimple_reg_type (result_type))
return 0;
+ /* If the front end already did something like this, don't do it here. */
+ if (DECL_NAME (result))
+ return 0;
+
/* Look through each block for assignments to the RESULT_DECL. */
FOR_EACH_BB (bb)
{
@@ -138,8 +142,8 @@ tree_nrv (void)
if (ret_val)
gcc_assert (ret_val == result);
}
- else if (is_gimple_assign (stmt)
- && gimple_assign_lhs (stmt) == result)
+ else if (gimple_has_lhs (stmt)
+ && gimple_get_lhs (stmt) == result)
{
tree rhs;
@@ -173,9 +177,9 @@ tree_nrv (void)
TREE_TYPE (found)))
return 0;
}
- else if (is_gimple_assign (stmt))
+ else if (gimple_has_lhs (stmt))
{
- tree addr = get_base_address (gimple_assign_lhs (stmt));
+ tree addr = get_base_address (gimple_get_lhs (stmt));
/* If there's any MODIFY of component of RESULT,
then bail out. */
if (addr && addr == result)
@@ -199,10 +203,17 @@ tree_nrv (void)
/* At this point we know that all the return statements return the
same local which has suitable attributes for NRV. Copy debugging
- information from FOUND to RESULT. */
- DECL_NAME (result) = DECL_NAME (found);
- DECL_SOURCE_LOCATION (result) = DECL_SOURCE_LOCATION (found);
- DECL_ABSTRACT_ORIGIN (result) = DECL_ABSTRACT_ORIGIN (found);
+ information from FOUND to RESULT if it will be useful. But don't set
+ DECL_ABSTRACT_ORIGIN to point at another function. */
+ if (!DECL_IGNORED_P (found)
+ && !(DECL_ABSTRACT_ORIGIN (found)
+ && DECL_CONTEXT (DECL_ABSTRACT_ORIGIN (found)) != current_function_decl))
+ {
+ DECL_NAME (result) = DECL_NAME (found);
+ DECL_SOURCE_LOCATION (result) = DECL_SOURCE_LOCATION (found);
+ DECL_ABSTRACT_ORIGIN (result) = DECL_ABSTRACT_ORIGIN (found);
+ }
+
TREE_ADDRESSABLE (result) = TREE_ADDRESSABLE (found);
/* Now walk through the function changing all references to VAR to be
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index 28a829caedf..5731964e457 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -740,7 +740,8 @@ remove_unused_locals (void)
if (TREE_CODE (var) != FUNCTION_DECL
&& (!(ann = var_ann (var))
- || !ann->used))
+ || !ann->used)
+ && (optimize || DECL_ARTIFICIAL (var)))
{
if (is_global_var (var))
{
@@ -781,8 +782,7 @@ remove_unused_locals (void)
if (TREE_CODE (var) == VAR_DECL
&& is_global_var (var)
- && bitmap_bit_p (global_unused_vars, DECL_UID (var))
- && (optimize || DECL_ARTIFICIAL (var)))
+ && bitmap_bit_p (global_unused_vars, DECL_UID (var)))
*cell = TREE_CHAIN (*cell);
else
cell = &TREE_CHAIN (*cell);
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index c7bfa07be80..fcaf7846458 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -1,6 +1,6 @@
/* Induction variable optimizations.
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software
- Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -219,15 +219,12 @@ struct ivopts_data
/* The currently optimized loop. */
struct loop *current_loop;
- /* Are we optimizing for speed? */
- bool speed;
+ /* Numbers of iterations for all exits of the current loop. */
+ struct pointer_map_t *niters;
/* Number of registers used in it. */
unsigned regs_used;
- /* Numbers of iterations for all exits of the current loop. */
- struct pointer_map_t *niters;
-
/* The size of version_info array allocated. */
unsigned version_info_size;
@@ -237,9 +234,6 @@ struct ivopts_data
/* The bitmap of indices in version_info whose value was changed. */
bitmap relevant;
- /* The maximum invariant id. */
- unsigned max_inv_id;
-
/* The uses of induction variables. */
VEC(iv_use_p,heap) *iv_uses;
@@ -249,9 +243,15 @@ struct ivopts_data
/* A bitmap of important candidates. */
bitmap important_candidates;
+ /* The maximum invariant id. */
+ unsigned max_inv_id;
+
/* Whether to consider just related and important candidates when replacing a
use. */
bool consider_all_candidates;
+
+ /* Are we optimizing for speed? */
+ bool speed;
};
/* An assignment of iv candidates to uses. */
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index c67e638d58a..d657e1ae78f 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -699,8 +699,10 @@ number_of_iterations_lt_to_ne (tree type, affine_iv *iv0, affine_iv *iv1,
iv0->base <= iv1->base + MOD. */
if (!iv0->no_overflow && !integer_zerop (mod))
{
- bound = fold_build2 (MINUS_EXPR, type,
+ bound = fold_build2 (MINUS_EXPR, type1,
TYPE_MAX_VALUE (type1), tmod);
+ if (POINTER_TYPE_P (type))
+ bound = fold_convert (type, bound);
assumption = fold_build2 (LE_EXPR, boolean_type_node,
iv1->base, bound);
if (integer_zerop (assumption))
@@ -708,6 +710,11 @@ number_of_iterations_lt_to_ne (tree type, affine_iv *iv0, affine_iv *iv1,
}
if (mpz_cmp (mmod, bnds->below) < 0)
noloop = boolean_false_node;
+ else if (POINTER_TYPE_P (type))
+ noloop = fold_build2 (GT_EXPR, boolean_type_node,
+ iv0->base,
+ fold_build2 (POINTER_PLUS_EXPR, type,
+ iv1->base, tmod));
else
noloop = fold_build2 (GT_EXPR, boolean_type_node,
iv0->base,
@@ -723,6 +730,8 @@ number_of_iterations_lt_to_ne (tree type, affine_iv *iv0, affine_iv *iv1,
{
bound = fold_build2 (PLUS_EXPR, type1,
TYPE_MIN_VALUE (type1), tmod);
+ if (POINTER_TYPE_P (type))
+ bound = fold_convert (type, bound);
assumption = fold_build2 (GE_EXPR, boolean_type_node,
iv0->base, bound);
if (integer_zerop (assumption))
@@ -730,6 +739,13 @@ number_of_iterations_lt_to_ne (tree type, affine_iv *iv0, affine_iv *iv1,
}
if (mpz_cmp (mmod, bnds->below) < 0)
noloop = boolean_false_node;
+ else if (POINTER_TYPE_P (type))
+ noloop = fold_build2 (GT_EXPR, boolean_type_node,
+ fold_build2 (POINTER_PLUS_EXPR, type,
+ iv0->base,
+ fold_build1 (NEGATE_EXPR,
+ type1, tmod)),
+ iv1->base);
else
noloop = fold_build2 (GT_EXPR, boolean_type_node,
fold_build2 (MINUS_EXPR, type1,
@@ -1084,10 +1100,10 @@ number_of_iterations_le (tree type, affine_iv *iv0, affine_iv *iv1,
{
if (integer_nonzerop (iv0->step))
assumption = fold_build2 (NE_EXPR, boolean_type_node,
- iv1->base, TYPE_MAX_VALUE (type1));
+ iv1->base, TYPE_MAX_VALUE (type));
else
assumption = fold_build2 (NE_EXPR, boolean_type_node,
- iv0->base, TYPE_MIN_VALUE (type1));
+ iv0->base, TYPE_MIN_VALUE (type));
if (integer_zerop (assumption))
return false;
@@ -1097,8 +1113,18 @@ number_of_iterations_le (tree type, affine_iv *iv0, affine_iv *iv1,
}
if (integer_nonzerop (iv0->step))
- iv1->base = fold_build2 (PLUS_EXPR, type1,
- iv1->base, build_int_cst (type1, 1));
+ {
+ if (POINTER_TYPE_P (type))
+ iv1->base = fold_build2 (POINTER_PLUS_EXPR, type, iv1->base,
+ build_int_cst (type1, 1));
+ else
+ iv1->base = fold_build2 (PLUS_EXPR, type1, iv1->base,
+ build_int_cst (type1, 1));
+ }
+ else if (POINTER_TYPE_P (type))
+ iv0->base = fold_build2 (POINTER_PLUS_EXPR, type, iv0->base,
+ fold_build1 (NEGATE_EXPR, type1,
+ build_int_cst (type1, 1)));
else
iv0->base = fold_build2 (MINUS_EXPR, type1,
iv0->base, build_int_cst (type1, 1));
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 728c444808a..d618418ac24 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -1817,9 +1817,9 @@ compute_topo_order (constraint_graph_t graph,
typedef struct equiv_class_label
{
+ hashval_t hashcode;
unsigned int equivalence_class;
bitmap labels;
- hashval_t hashcode;
} *equiv_class_label_t;
typedef const struct equiv_class_label *const_equiv_class_label_t;
diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c
index 5f9884f0010..a048342d8be 100644
--- a/gcc/tree-vect-transform.c
+++ b/gcc/tree-vect-transform.c
@@ -1099,7 +1099,10 @@ vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop,
if (!MTAG_P (tag))
new_type_alias (vect_ptr, tag, DR_REF (dr));
else
- set_symbol_mem_tag (vect_ptr, tag);
+ {
+ set_symbol_mem_tag (vect_ptr, tag);
+ mark_sym_for_renaming (tag);
+ }
/** Note: If the dataref is in an inner-loop nested in LOOP, and we are
vectorizing LOOP (i.e. outer-loop vectorization), we need to create two
@@ -8107,8 +8110,8 @@ vect_loop_versioning (loop_vec_info loop_vinfo)
min_profitable_iters);
cond_expr =
- build2 (GT_EXPR, boolean_type_node, scalar_loop_iters,
- build_int_cst (TREE_TYPE (scalar_loop_iters), th));
+ fold_build2 (GT_EXPR, boolean_type_node, scalar_loop_iters,
+ build_int_cst (TREE_TYPE (scalar_loop_iters), th));
cond_expr = force_gimple_operand (cond_expr, &cond_expr_stmt_list,
false, NULL_TREE);
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 9a3a9f3c8a7..2c5d9cca136 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -1066,8 +1066,8 @@ set_prologue_iterations (basic_block bb_before_first_loop,
e_fallthru = EDGE_SUCC (then_bb, 0);
cost_pre_condition =
- build2 (LE_EXPR, boolean_type_node, scalar_loop_iters,
- build_int_cst (TREE_TYPE (scalar_loop_iters), th));
+ fold_build2 (LE_EXPR, boolean_type_node, scalar_loop_iters,
+ build_int_cst (TREE_TYPE (scalar_loop_iters), th));
cost_pre_condition =
force_gimple_operand (cost_pre_condition, &gimplify_stmt_list,
true, NULL_TREE);
@@ -1319,8 +1319,8 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop,
= unshare_expr (LOOP_VINFO_NITERS_UNCHANGED
(loop_vec_info_for_loop (loop)));
cost_pre_condition =
- build2 (LE_EXPR, boolean_type_node, scalar_loop_iters,
- build_int_cst (TREE_TYPE (scalar_loop_iters), th));
+ fold_build2 (LE_EXPR, boolean_type_node, scalar_loop_iters,
+ build_int_cst (TREE_TYPE (scalar_loop_iters), th));
pre_condition = fold_build2 (TRUTH_OR_EXPR, boolean_type_node,
cost_pre_condition, pre_condition);
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 77fff6cf8c2..755b117e54a 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -5067,7 +5067,7 @@ check_array_ref (tree ref, const location_t *location, bool ignore_off_by_one)
address of an ARRAY_REF, and call check_array_ref on it. */
static void
-search_for_addr_array(tree t, const location_t *location)
+search_for_addr_array (tree t, const location_t *location)
{
while (TREE_CODE (t) == SSA_NAME)
{
@@ -5076,8 +5076,8 @@ search_for_addr_array(tree t, const location_t *location)
if (gimple_code (g) != GIMPLE_ASSIGN)
return;
- if (get_gimple_rhs_class (gimple_assign_rhs_code (g)) !=
- GIMPLE_SINGLE_RHS)
+ if (get_gimple_rhs_class (gimple_assign_rhs_code (g))
+ != GIMPLE_SINGLE_RHS)
return;
t = gimple_assign_rhs1 (g);
@@ -5094,7 +5094,7 @@ search_for_addr_array(tree t, const location_t *location)
if (TREE_CODE (t) == ARRAY_REF)
check_array_ref (t, location, true /*ignore_off_by_one*/);
- t = TREE_OPERAND(t,0);
+ t = TREE_OPERAND (t, 0);
}
while (handled_component_p (t));
}
diff --git a/gcc/tree.c b/gcc/tree.c
index 0caf282fa58..d79849a70c6 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -4240,6 +4240,7 @@ find_decls_types_in_node (struct cgraph_node *n, struct free_lang_data_d *fld)
{
basic_block bb;
struct function *fn;
+ tree t;
/* Although free_lang_data_in_cgraph will set the assembler name on
most DECLs, it refuses to do it on unused ones. For cgraph
@@ -4256,6 +4257,17 @@ find_decls_types_in_node (struct cgraph_node *n, struct free_lang_data_d *fld)
fn = DECL_STRUCT_FUNCTION (n->decl);
+ /* Traverse locals. */
+
+ for (t = fn->local_decls; t; t = TREE_CHAIN (t))
+ {
+ tree *tp = &TREE_VALUE (t);
+ tree saved_chain = TREE_CHAIN (*tp);
+ TREE_CHAIN (*tp) = NULL_TREE;
+ walk_tree (tp, find_decls_types_r, fld, fld->pset);
+ TREE_CHAIN (*tp) = saved_chain;
+ }
+
/* Traverse EH regions in FN. */
if (fn->eh->region_array)
{
diff --git a/gcc/tree.h b/gcc/tree.h
index 6b180489978..8b8d8f27082 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2310,6 +2310,7 @@ struct tree_type GTY(())
unsigned user_align : 1;
unsigned int align;
+ alias_set_type alias_set;
tree pointer_to;
tree reference_to;
union tree_type_symtab {
@@ -2326,7 +2327,6 @@ struct tree_type GTY(())
tree binfo;
tree context;
tree canonical;
- alias_set_type alias_set;
/* Points to a structure whose details depend on the language in use. */
struct lang_type *lang_specific;
};
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 6bb07e2cc60..21c7b82c936 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1675,7 +1675,7 @@ assemble_start_function (tree decl, const char *fnname)
/* When the function starts with a cold section, we need to explicitly
align the hot section and write out the hot section label.
But if the current function is a thunk, we do not have a CFG. */
- if (!crtl->is_thunk
+ if (!cfun->is_thunk
&& BB_PARTITION (ENTRY_BLOCK_PTR->next_bb) == BB_COLD_PARTITION)
{
switch_to_section (text_section);