From 95d282335c288737969c4e6ba28c6e8e9a8c26a5 Mon Sep 17 00:00:00 2001 From: John Marino Date: Fri, 10 Oct 2014 16:56:34 +0200 Subject: [PATCH] Upgrade GCC from 4.7.3 to 4.7.4 on the vendor branch --- contrib/gcc-4.7/LAST_UPDATED | 2 +- contrib/gcc-4.7/gcc/BASE-VER | 2 +- contrib/gcc-4.7/gcc/DATESTAMP | 2 +- contrib/gcc-4.7/gcc/alias.c | 17 +- contrib/gcc-4.7/gcc/bb-reorder.c | 3 +- contrib/gcc-4.7/gcc/builtins.c | 11 +- contrib/gcc-4.7/gcc/c-decl.c | 4 +- contrib/gcc-4.7/gcc/c-family/c-target.def | 16 +- contrib/gcc-4.7/gcc/c-family/c.opt | 10 +- contrib/gcc-4.7/gcc/cfgcleanup.c | 18 ++ contrib/gcc-4.7/gcc/cfgexpand.c | 5 +- contrib/gcc-4.7/gcc/collect2-aix.h | 13 +- contrib/gcc-4.7/gcc/collect2.c | 18 +- contrib/gcc-4.7/gcc/collect2.h | 4 +- contrib/gcc-4.7/gcc/config/i386/driver-i386.c | 105 +++++-- contrib/gcc-4.7/gcc/config/i386/f16cintrin.h | 2 +- contrib/gcc-4.7/gcc/config/i386/i386.c | 287 ++++++++++-------- contrib/gcc-4.7/gcc/config/i386/i386.md | 154 ++++++---- contrib/gcc-4.7/gcc/config/i386/predicates.md | 33 +- contrib/gcc-4.7/gcc/config/i386/sse.md | 14 +- contrib/gcc-4.7/gcc/config/i386/xopintrin.h | 8 +- contrib/gcc-4.7/gcc/coverage.c | 9 +- contrib/gcc-4.7/gcc/cp/call.c | 3 + contrib/gcc-4.7/gcc/cp/cp-tree.h | 17 +- contrib/gcc-4.7/gcc/cp/cvt.c | 41 +-- contrib/gcc-4.7/gcc/cp/decl.c | 6 +- contrib/gcc-4.7/gcc/cp/except.c | 3 + contrib/gcc-4.7/gcc/cp/init.c | 1 + contrib/gcc-4.7/gcc/cp/mangle.c | 1 + contrib/gcc-4.7/gcc/cp/name-lookup.c | 20 +- contrib/gcc-4.7/gcc/cp/parser.c | 33 +- contrib/gcc-4.7/gcc/cp/pt.c | 21 +- contrib/gcc-4.7/gcc/cp/semantics.c | 30 +- contrib/gcc-4.7/gcc/cp/tree.c | 6 +- contrib/gcc-4.7/gcc/cp/typeck.c | 8 +- contrib/gcc-4.7/gcc/doc/cpp.1 | 2 +- contrib/gcc-4.7/gcc/doc/extend.texi | 2 + contrib/gcc-4.7/gcc/doc/g++.1 | 87 +++--- contrib/gcc-4.7/gcc/doc/gcc.1 | 87 +++--- contrib/gcc-4.7/gcc/doc/gcov.1 | 2 +- contrib/gcc-4.7/gcc/doc/implement-cxx.texi | 4 +- contrib/gcc-4.7/gcc/doc/invoke.texi | 91 +++--- contrib/gcc-4.7/gcc/doc/tm.texi | 26 +- contrib/gcc-4.7/gcc/doc/tm.texi.in | 20 +- contrib/gcc-4.7/gcc/dwarf2out.c | 2 +- contrib/gcc-4.7/gcc/fold-const.c | 74 +++-- contrib/gcc-4.7/gcc/gengtype-lex.c | 104 +++---- contrib/gcc-4.7/gcc/gimple-low.c | 1 + contrib/gcc-4.7/gcc/gimple.h | 3 + contrib/gcc-4.7/gcc/gimplify.c | 25 +- contrib/gcc-4.7/gcc/ipa-cp.c | 16 +- contrib/gcc-4.7/gcc/ipa-prop.c | 3 +- contrib/gcc-4.7/gcc/ira.c | 12 + .../gcc/objc/objc-next-runtime-abi-01.c | 105 +++---- .../gcc/objc/objc-next-runtime-abi-02.c | 28 -- contrib/gcc-4.7/gcc/optabs.c | 16 +- contrib/gcc-4.7/gcc/predict.c | 8 +- contrib/gcc-4.7/gcc/recog.c | 5 +- contrib/gcc-4.7/gcc/regcprop.c | 18 ++ contrib/gcc-4.7/gcc/reginfo.c | 2 +- contrib/gcc-4.7/gcc/rtl.h | 2 + contrib/gcc-4.7/gcc/sched-deps.c | 30 +- contrib/gcc-4.7/gcc/sdbout.c | 10 +- contrib/gcc-4.7/gcc/sel-sched.c | 2 +- contrib/gcc-4.7/gcc/simplify-rtx.c | 1 + contrib/gcc-4.7/gcc/target.def | 7 + contrib/gcc-4.7/gcc/tlink.c | 16 +- contrib/gcc-4.7/gcc/tree-cfg.c | 3 +- contrib/gcc-4.7/gcc/tree-dfa.c | 185 ++++++----- contrib/gcc-4.7/gcc/tree-eh.c | 4 +- contrib/gcc-4.7/gcc/tree-flow.h | 1 + contrib/gcc-4.7/gcc/tree-if-conv.c | 82 ++--- contrib/gcc-4.7/gcc/tree-predcom.c | 6 +- contrib/gcc-4.7/gcc/tree-ssa-ccp.c | 3 + contrib/gcc-4.7/gcc/tree-ssa-dce.c | 34 +-- contrib/gcc-4.7/gcc/tree-ssa-loop-niter.c | 7 +- contrib/gcc-4.7/gcc/tree-ssa-phiprop.c | 9 + contrib/gcc-4.7/gcc/tree-ssa-pre.c | 31 +- contrib/gcc-4.7/gcc/tree-ssa-sccvn.c | 13 +- contrib/gcc-4.7/gcc/tree-ssa-sink.c | 12 +- contrib/gcc-4.7/gcc/tree-ssa-strlen.c | 25 +- contrib/gcc-4.7/gcc/tree-ssanames.c | 2 +- contrib/gcc-4.7/gcc/tree-streamer-in.c | 11 +- contrib/gcc-4.7/gcc/tree-tailcall.c | 13 +- contrib/gcc-4.7/gcc/tree-vect-data-refs.c | 6 + contrib/gcc-4.7/gcc/tree-vect-loop.c | 19 +- contrib/gcc-4.7/gcc/tree-vrp.c | 10 +- contrib/gcc-4.7/libgcc/Makefile.in | 3 +- contrib/gcc-4.7/libgcc/config.host | 6 +- .../libgcc/config/i386/32/sfp-machine.h | 8 + .../libgcc/config/i386/64/sfp-machine.h | 8 + .../libstdc++-v3/include/bits/atomic_base.h | 4 +- .../libstdc++-v3/include/bits/basic_string.h | 14 +- .../libstdc++-v3/include/bits/random.tcc | 2 +- .../include/bits/shared_ptr_base.h | 2 +- .../libstdc++-v3/include/bits/stl_algo.h | 41 +-- .../gcc-4.7/libstdc++-v3/include/std/future | 4 +- .../gcc-4.7/libstdc++-v3/include/tr2/bool_set | 2 +- .../libstdc++-v3/libsupc++/eh_alloc.cc | 12 - .../libstdc++-v3/libsupc++/eh_throw.cc | 3 + .../gcc-4.7/libstdc++-v3/src/c++11/future.cc | 2 +- .../libstdc++-v3/src/c++11/system_error.cc | 4 +- .../libstdc++-v3/src/c++98/compatibility.cc | 19 +- 103 files changed, 1340 insertions(+), 1008 deletions(-) diff --git a/contrib/gcc-4.7/LAST_UPDATED b/contrib/gcc-4.7/LAST_UPDATED index 2230e8f732..8b32fdedb4 100644 --- a/contrib/gcc-4.7/LAST_UPDATED +++ b/contrib/gcc-4.7/LAST_UPDATED @@ -1 +1 @@ -Obtained from SVN: tags/gcc_4_7_3_release revision 197739 +Obtained from SVN: tags/gcc_4_7_4_release revision 211579 diff --git a/contrib/gcc-4.7/gcc/BASE-VER b/contrib/gcc-4.7/gcc/BASE-VER index 87b18a567e..b48b2de9d9 100644 --- a/contrib/gcc-4.7/gcc/BASE-VER +++ b/contrib/gcc-4.7/gcc/BASE-VER @@ -1 +1 @@ -4.7.3 +4.7.4 diff --git a/contrib/gcc-4.7/gcc/DATESTAMP b/contrib/gcc-4.7/gcc/DATESTAMP index d8ba94e975..e00a573aab 100644 --- a/contrib/gcc-4.7/gcc/DATESTAMP +++ b/contrib/gcc-4.7/gcc/DATESTAMP @@ -1 +1 @@ -20130411 +20140612 diff --git a/contrib/gcc-4.7/gcc/alias.c b/contrib/gcc-4.7/gcc/alias.c index f20716d0df..7a56cda2de 100644 --- a/contrib/gcc-4.7/gcc/alias.c +++ b/contrib/gcc-4.7/gcc/alias.c @@ -2810,16 +2810,13 @@ init_alias_analysis (void) /* Wipe the reg_seen array clean. */ memset (reg_seen, 0, maxreg); - /* Mark all hard registers which may contain an address. - The stack, frame and argument pointers may contain an address. - An argument register which can hold a Pmode value may contain - an address even if it is not in BASE_REGS. - - The address expression is VOIDmode for an argument and - Pmode for other registers. */ - - memcpy (new_reg_base_value, static_reg_base_value, - FIRST_PSEUDO_REGISTER * sizeof (rtx)); + /* Initialize the alias information for this pass. */ + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) + if (static_reg_base_value[i]) + { + new_reg_base_value[i] = static_reg_base_value[i]; + reg_seen[i] = 1; + } /* Walk the insns adding values to the new_reg_base_value array. */ for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) diff --git a/contrib/gcc-4.7/gcc/bb-reorder.c b/contrib/gcc-4.7/gcc/bb-reorder.c index a35b8e6294..2ab2a910b5 100644 --- a/contrib/gcc-4.7/gcc/bb-reorder.c +++ b/contrib/gcc-4.7/gcc/bb-reorder.c @@ -1478,9 +1478,8 @@ fix_up_fall_thru_edges (void) edge e; edge_iterator ei; - /* Find EDGE_CAN_FALLTHRU edge. */ FOR_EACH_EDGE (e, ei, cur_bb->succs) - if (e->flags & EDGE_CAN_FALLTHRU) + if (e->flags & EDGE_FALLTHRU) { fall_thru = e; break; diff --git a/contrib/gcc-4.7/gcc/builtins.c b/contrib/gcc-4.7/gcc/builtins.c index 7e4eed19dd..e8fef179f8 100644 --- a/contrib/gcc-4.7/gcc/builtins.c +++ b/contrib/gcc-4.7/gcc/builtins.c @@ -9692,7 +9692,16 @@ fold_builtin_logb (location_t loc, tree arg, tree rettype) case rvc_inf: /* If arg is Inf or NaN and we're logb, return it. */ if (TREE_CODE (rettype) == REAL_TYPE) - return fold_convert_loc (loc, rettype, arg); + { + /* For logb(-Inf) we have to return +Inf. */ + if (real_isinf (value) && real_isneg (value)) + { + REAL_VALUE_TYPE tem; + real_inf (&tem); + return build_real (rettype, tem); + } + return fold_convert_loc (loc, rettype, arg); + } /* Fall through... */ case rvc_zero: /* Zero may set errno and/or raise an exception for logb, also diff --git a/contrib/gcc-4.7/gcc/c-decl.c b/contrib/gcc-4.7/gcc/c-decl.c index de46578e0b..2c3b8ac0ce 100644 --- a/contrib/gcc-4.7/gcc/c-decl.c +++ b/contrib/gcc-4.7/gcc/c-decl.c @@ -4618,7 +4618,9 @@ build_compound_literal (location_t loc, tree type, tree init, bool non_const) { int failure = complete_array_type (&TREE_TYPE (decl), DECL_INITIAL (decl), true); - gcc_assert (!failure); + /* If complete_array_type returns 3, it means that the + initial value of the compound literal is empty. Allow it. */ + gcc_assert (failure == 0 || failure == 3); type = TREE_TYPE (decl); TREE_TYPE (DECL_INITIAL (decl)) = type; diff --git a/contrib/gcc-4.7/gcc/c-family/c-target.def b/contrib/gcc-4.7/gcc/c-family/c-target.def index 356fe26680..c5ebdf14ac 100644 --- a/contrib/gcc-4.7/gcc/c-family/c-target.def +++ b/contrib/gcc-4.7/gcc/c-family/c-target.def @@ -59,7 +59,21 @@ DEFHOOK common-format string object when the target provides one.", tree, (tree string), NULL) - + +DEFHOOK +(objc_declare_unresolved_class_reference, + "Declare that Objective C class @var{classname} is referenced\ + by the current TU.", + void, (const char *classname), + NULL) + +DEFHOOK +(objc_declare_class_definition, + "Declare that Objective C class @var{classname} is defined\ + by the current TU.", + void, (const char *classname), + NULL) + DEFHOOK (string_object_ref_type_p, "If a target implements string objects then this hook should return\ diff --git a/contrib/gcc-4.7/gcc/c-family/c.opt b/contrib/gcc-4.7/gcc/c-family/c.opt index 40ff96cc50..8c65e33c21 100644 --- a/contrib/gcc-4.7/gcc/c-family/c.opt +++ b/contrib/gcc-4.7/gcc/c-family/c.opt @@ -814,7 +814,7 @@ C++ ObjC++ Var(flag_no_gnu_keywords, 0) Recognize GNU-defined keywords fgnu-runtime -ObjC ObjC++ Report RejectNegative Var(flag_next_runtime,0) Init(NEXT_OBJC_RUNTIME) +ObjC ObjC++ LTO Report RejectNegative Var(flag_next_runtime,0) Init(NEXT_OBJC_RUNTIME) Generate code for GNU runtime environment fgnu89-inline @@ -888,7 +888,7 @@ fnew-abi C++ ObjC++ Ignore Warn(switch %qs is no longer supported) fnext-runtime -ObjC ObjC++ Report RejectNegative Var(flag_next_runtime) +ObjC ObjC++ LTO Report RejectNegative Var(flag_next_runtime) Generate code for NeXT (Apple Mac OS X) runtime environment fnil-receivers @@ -906,7 +906,7 @@ C++ ObjC++ Optimization Var(flag_nothrow_opt) Treat a throw() exception specification as noexcept to improve code size fobjc-abi-version= -ObjC ObjC++ Joined Report RejectNegative UInteger Var(flag_objc_abi) +ObjC ObjC++ LTO Joined Report RejectNegative UInteger Var(flag_objc_abi) Specify which ABI to use for Objective-C family code and meta-data generation. ; Generate special '- .cxx_construct' and '- .cxx_destruct' methods @@ -926,7 +926,7 @@ ObjC ObjC++ Var(flag_objc_exceptions) Enable Objective-C exception and synchronization syntax fobjc-gc -ObjC ObjC++ Var(flag_objc_gc) +ObjC ObjC++ LTO Var(flag_objc_gc) Enable garbage collection (GC) in Objective-C/Objective-C++ programs fobjc-nilcheck @@ -986,7 +986,7 @@ C++ ObjC++ Var(flag_pretty_templates) Init(1) -fno-pretty-templates Do not pretty-print template specializations as the template signature followed by the arguments freplace-objc-classes -ObjC ObjC++ Var(flag_replace_objc_classes) +ObjC ObjC++ LTO Var(flag_replace_objc_classes) Used in Fix-and-Continue mode to indicate that object files may be swapped in at runtime frepo diff --git a/contrib/gcc-4.7/gcc/cfgcleanup.c b/contrib/gcc-4.7/gcc/cfgcleanup.c index 6ff161425f..fae3aa656e 100644 --- a/contrib/gcc-4.7/gcc/cfgcleanup.c +++ b/contrib/gcc-4.7/gcc/cfgcleanup.c @@ -922,6 +922,24 @@ merge_memattrs (rtx x, rtx y) set_mem_align (y, MEM_ALIGN (x)); } } + if (code == MEM) + { + if (MEM_READONLY_P (x) != MEM_READONLY_P (y)) + { + MEM_READONLY_P (x) = 0; + MEM_READONLY_P (y) = 0; + } + if (MEM_NOTRAP_P (x) != MEM_NOTRAP_P (y)) + { + MEM_NOTRAP_P (x) = 0; + MEM_NOTRAP_P (y) = 0; + } + if (MEM_VOLATILE_P (x) != MEM_VOLATILE_P (y)) + { + MEM_VOLATILE_P (x) = 1; + MEM_VOLATILE_P (y) = 1; + } + } fmt = GET_RTX_FORMAT (code); for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) diff --git a/contrib/gcc-4.7/gcc/cfgexpand.c b/contrib/gcc-4.7/gcc/cfgexpand.c index 21399e600e..10bacda2c8 100644 --- a/contrib/gcc-4.7/gcc/cfgexpand.c +++ b/contrib/gcc-4.7/gcc/cfgexpand.c @@ -3646,6 +3646,8 @@ static void avoid_complex_debug_insns (rtx insn, rtx *exp_p, int depth) { rtx exp = *exp_p; + const char *format_ptr; + int i, j; if (exp == NULL_RTX) return; @@ -3668,8 +3670,7 @@ avoid_complex_debug_insns (rtx insn, rtx *exp_p, int depth) return; } - const char *format_ptr = GET_RTX_FORMAT (GET_CODE (exp)); - int i, j; + format_ptr = GET_RTX_FORMAT (GET_CODE (exp)); for (i = 0; i < GET_RTX_LENGTH (GET_CODE (exp)); i++) switch (*format_ptr++) { diff --git a/contrib/gcc-4.7/gcc/collect2-aix.h b/contrib/gcc-4.7/gcc/collect2-aix.h index 1ab313d0f3..f67669b959 100644 --- a/contrib/gcc-4.7/gcc/collect2-aix.h +++ b/contrib/gcc-4.7/gcc/collect2-aix.h @@ -1,5 +1,5 @@ /* AIX cross support for collect2. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009-2013 Free Software Foundation, Inc. This file is part of GCC. @@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see Definitions adapted from bfd. (Fairly heavily adapted in some cases.) ------------------------------------------------------------------------- */ -/* Compatiblity types for bfd. */ +/* Compatibility types for bfd. */ typedef unsigned HOST_WIDE_INT bfd_vma; /* The size of an archive's fl_magic field. */ @@ -135,7 +135,7 @@ struct external_filehdr_32 /* The number of entries in the symbol table. */ char f_nsyms[4]; - /* The size of the auxillary header. */ + /* The size of the auxiliary header. */ char f_opthdr[2]; /* Flags. */ @@ -157,7 +157,7 @@ struct external_filehdr_64 /* The offset of the symbol table from the start of the file. */ char f_symptr[8]; - /* The size of the auxillary header. */ + /* The size of the auxiliary header. */ char f_opthdr[2]; /* Flags. */ @@ -222,14 +222,15 @@ struct external_syment /* The class of symbol (a C_* value). */ char n_sclass[1]; - /* The number of auxillary symbols attached to this entry. */ + /* The number of auxiliary symbols attached to this entry. */ char n_numaux[1]; }; /* Definitions required by collect2. */ #define C_EXT 2 -#define F_SHROBJ 0x2000 +#define F_SHROBJ 0x2000 +#define F_LOADONLY 0x4000 #define N_UNDEF ((short) 0) #define N_TMASK 060 diff --git a/contrib/gcc-4.7/gcc/collect2.c b/contrib/gcc-4.7/gcc/collect2.c index 748a3f479a..8870b7ce47 100644 --- a/contrib/gcc-4.7/gcc/collect2.c +++ b/contrib/gcc-4.7/gcc/collect2.c @@ -1,7 +1,7 @@ /* Collect static initialization info into data structures that can be traversed by C++ initialization and finalization routines. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011, 2013 Free Software Foundation, Inc. Contributed by Chris Smith (csmith@convex.com). Heavily modified by Michael Meissner (meissner@cygnus.com), @@ -384,8 +384,8 @@ static void scan_prog_file (const char *, scanpass, scanfilter); /* Delete tempfiles and exit function. */ -void -collect_exit (int status) +static void +collect_atexit (void) { if (c_file != 0 && c_file[0]) maybe_unlink (c_file); @@ -413,13 +413,8 @@ collect_exit (int status) maybe_unlink (lderrout); } - if (status != 0 && output_file != 0 && output_file[0]) - maybe_unlink (output_file); - if (response_file) maybe_unlink (response_file); - - exit (status); } @@ -1132,6 +1127,9 @@ main (int argc, char **argv) signal (SIGCHLD, SIG_DFL); #endif + if (atexit (collect_atexit) != 0) + fatal_error ("atexit failed"); + /* Unlock the stdio streams. */ unlock_std_streams (); @@ -1973,7 +1971,7 @@ collect_wait (const char *prog, struct pex_obj *pex) error ("%s terminated with signal %d [%s]%s", prog, sig, strsignal(sig), WCOREDUMP(status) ? ", core dumped" : ""); - collect_exit (FATAL_EXIT_CODE); + exit (FATAL_EXIT_CODE); } if (WIFEXITED (status)) @@ -1989,7 +1987,7 @@ do_wait (const char *prog, struct pex_obj *pex) if (ret != 0) { error ("%s returned %d exit status", prog, ret); - collect_exit (ret); + exit (ret); } if (response_file) diff --git a/contrib/gcc-4.7/gcc/collect2.h b/contrib/gcc-4.7/gcc/collect2.h index e18892d3a5..a9594d2f08 100644 --- a/contrib/gcc-4.7/gcc/collect2.h +++ b/contrib/gcc-4.7/gcc/collect2.h @@ -1,5 +1,5 @@ /* Header file for collect/tlink routines. - Copyright (C) 1998, 2003, 2004, 2005, 2007, 2010, 2011 + Copyright (C) 1998, 2003, 2004, 2005, 2007, 2010, 2011, 2013 Free Software Foundation, Inc. This file is part of GCC. @@ -26,8 +26,6 @@ extern void do_tlink (char **, char **); extern struct pex_obj *collect_execute (const char *, char **, const char *, const char *, int flags); -extern void collect_exit (int) ATTRIBUTE_NORETURN; - extern int collect_wait (const char *, struct pex_obj *); extern void dump_file (const char *, FILE *); diff --git a/contrib/gcc-4.7/gcc/config/i386/driver-i386.c b/contrib/gcc-4.7/gcc/config/i386/driver-i386.c index 7b5e4d7c14..c7151eb305 100644 --- a/contrib/gcc-4.7/gcc/config/i386/driver-i386.c +++ b/contrib/gcc-4.7/gcc/config/i386/driver-i386.c @@ -350,7 +350,10 @@ detect_caches_intel (bool xeon_mp, unsigned max_level, enum vendor_signatures { SIG_INTEL = 0x756e6547 /* Genu */, - SIG_AMD = 0x68747541 /* Auth */ + SIG_AMD = 0x68747541 /* Auth */, + SIG_CENTAUR = 0x746e6543 /* Cent */, + SIG_CYRIX = 0x69727943 /* Cyri */, + SIG_NSC = 0x646f6547 /* Geod */ }; enum processor_signatures @@ -466,27 +469,6 @@ const char *host_detect_local_cpu (int argc, const char **argv) has_fsgsbase = ebx & bit_FSGSBASE; } - /* Get XCR_XFEATURE_ENABLED_MASK register with xgetbv. */ -#define XCR_XFEATURE_ENABLED_MASK 0x0 -#define XSTATE_FP 0x1 -#define XSTATE_SSE 0x2 -#define XSTATE_YMM 0x4 - if (has_osxsave) - asm (".byte 0x0f; .byte 0x01; .byte 0xd0" - : "=a" (eax), "=d" (edx) - : "c" (XCR_XFEATURE_ENABLED_MASK)); - - /* Check if SSE and YMM states are supported. */ - if (!has_osxsave - || (eax & (XSTATE_SSE | XSTATE_YMM)) != (XSTATE_SSE | XSTATE_YMM)) - { - has_avx = 0; - has_avx2 = 0; - has_fma = 0; - has_fma4 = 0; - has_xop = 0; - } - /* Check cpuid level of extended features. */ __cpuid (0x80000000, ext_level, ebx, ecx, edx); @@ -508,9 +490,34 @@ const char *host_detect_local_cpu (int argc, const char **argv) has_3dnow = edx & bit_3DNOW; } + /* Get XCR_XFEATURE_ENABLED_MASK register with xgetbv. */ +#define XCR_XFEATURE_ENABLED_MASK 0x0 +#define XSTATE_FP 0x1 +#define XSTATE_SSE 0x2 +#define XSTATE_YMM 0x4 + if (has_osxsave) + asm (".byte 0x0f; .byte 0x01; .byte 0xd0" + : "=a" (eax), "=d" (edx) + : "c" (XCR_XFEATURE_ENABLED_MASK)); + + /* Check if SSE and YMM states are supported. */ + if (!has_osxsave + || (eax & (XSTATE_SSE | XSTATE_YMM)) != (XSTATE_SSE | XSTATE_YMM)) + { + has_avx = 0; + has_avx2 = 0; + has_fma = 0; + has_fma4 = 0; + has_f16c = 0; + has_xop = 0; + } + if (!arch) { - if (vendor == SIG_AMD) + if (vendor == SIG_AMD + || vendor == SIG_CENTAUR + || vendor == SIG_CYRIX + || vendor == SIG_NSC) cache = detect_caches_amd (ext_level); else if (vendor == SIG_INTEL) { @@ -549,6 +556,37 @@ const char *host_detect_local_cpu (int argc, const char **argv) else processor = PROCESSOR_PENTIUM; } + else if (vendor == SIG_CENTAUR) + { + if (arch) + { + switch (family) + { + case 6: + if (model > 9) + /* Use the default detection procedure. */ + processor = PROCESSOR_GENERIC32; + else if (model == 9) + cpu = "c3-2"; + else if (model >= 6) + cpu = "c3"; + else + processor = PROCESSOR_GENERIC32; + break; + case 5: + if (has_3dnow) + cpu = "winchip2"; + else if (has_mmx) + cpu = "winchip2-c6"; + else + processor = PROCESSOR_GENERIC32; + break; + default: + /* We have no idea. */ + processor = PROCESSOR_GENERIC32; + } + } + } else { switch (family) @@ -593,13 +631,18 @@ const char *host_detect_local_cpu (int argc, const char **argv) /* Atom. */ cpu = "atom"; break; + case 0x0f: + /* Merom. */ + case 0x17: + case 0x1d: + /* Penryn. */ + cpu = "core2"; + break; case 0x1a: case 0x1e: case 0x1f: case 0x2e: /* Nehalem. */ - cpu = "corei7"; - break; case 0x25: case 0x2c: case 0x2f: @@ -611,14 +654,10 @@ const char *host_detect_local_cpu (int argc, const char **argv) /* Sandy Bridge. */ cpu = "corei7-avx"; break; - case 0x17: - case 0x1d: - /* Penryn. */ - cpu = "core2"; - break; - case 0x0f: - /* Merom. */ - cpu = "core2"; + case 0x3a: + case 0x3e: + /* Ivy Bridge. */ + cpu = "core-avx-i"; break; default: if (arch) diff --git a/contrib/gcc-4.7/gcc/config/i386/f16cintrin.h b/contrib/gcc-4.7/gcc/config/i386/f16cintrin.h index ac827ca0e1..a8a9255052 100644 --- a/contrib/gcc-4.7/gcc/config/i386/f16cintrin.h +++ b/contrib/gcc-4.7/gcc/config/i386/f16cintrin.h @@ -35,7 +35,7 @@ extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _cvtsh_ss (unsigned short __S) { - __v8hi __H = __extension__ (__v8hi){ __S, 0, 0, 0, 0, 0, 0, 0 }; + __v8hi __H = __extension__ (__v8hi){ (short) __S, 0, 0, 0, 0, 0, 0, 0 }; __v4sf __A = __builtin_ia32_vcvtph2ps (__H); return __builtin_ia32_vec_ext_v4sf (__A, 0); } diff --git a/contrib/gcc-4.7/gcc/config/i386/i386.c b/contrib/gcc-4.7/gcc/config/i386/i386.c index 440bd82dd0..b39ec9dea1 100644 --- a/contrib/gcc-4.7/gcc/config/i386/i386.c +++ b/contrib/gcc-4.7/gcc/config/i386/i386.c @@ -1623,7 +1623,7 @@ struct processor_costs nocona_cost = { 8, /* MMX or SSE register to integer */ 8, /* size of l1 cache. */ 1024, /* size of l2 cache. */ - 128, /* size of prefetch block */ + 64, /* size of prefetch block */ 8, /* number of parallel prefetches */ 1, /* Branch cost */ COSTS_N_INSNS (6), /* cost of FADD and FSUB insns. */ @@ -2979,7 +2979,7 @@ ix86_option_override_internal (bool main_args_p) | PTA_SSSE3 | PTA_CX16}, {"corei7", PROCESSOR_COREI7_64, CPU_COREI7, PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3 - | PTA_SSSE3 | PTA_SSE4_1 | PTA_SSE4_2 | PTA_CX16}, + | PTA_SSSE3 | PTA_SSE4_1 | PTA_SSE4_2 | PTA_CX16 | PTA_POPCNT}, {"corei7-avx", PROCESSOR_COREI7_64, CPU_COREI7, PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3 | PTA_SSSE3 | PTA_SSE4_1 | PTA_SSE4_2 | PTA_AVX @@ -6078,25 +6078,28 @@ classify_argument (enum machine_mode mode, const_tree type, case CHImode: case CQImode: { - int size = (bit_offset % 64)+ (int) GET_MODE_BITSIZE (mode); + int size = bit_offset + (int) GET_MODE_BITSIZE (mode); + + /* Analyze last 128 bits only. */ + size = (size - 1) & 0x7f; - if (size <= 32) + if (size < 32) { classes[0] = X86_64_INTEGERSI_CLASS; return 1; } - else if (size <= 64) + else if (size < 64) { classes[0] = X86_64_INTEGER_CLASS; return 1; } - else if (size <= 64+32) + else if (size < 64+32) { classes[0] = X86_64_INTEGER_CLASS; classes[1] = X86_64_INTEGERSI_CLASS; return 2; } - else if (size <= 64+64) + else if (size < 64+64) { classes[0] = classes[1] = X86_64_INTEGER_CLASS; return 2; @@ -6303,7 +6306,7 @@ construct_container (enum machine_mode mode, enum machine_mode orig_mode, /* Likewise, error if the ABI requires us to return values in the x87 registers and the user specified -mno-80387. */ - if (!TARGET_80387 && in_return) + if (!TARGET_FLOAT_RETURNS_IN_80387 && in_return) for (i = 0; i < n; i++) if (regclass[i] == X86_64_X87_CLASS || regclass[i] == X86_64_X87UP_CLASS @@ -6357,7 +6360,7 @@ construct_container (enum machine_mode mode, enum machine_mode orig_mode, return gen_rtx_REG (XFmode, FIRST_STACK_REG); if (n == 2 && regclass[0] == X86_64_INTEGER_CLASS && regclass[1] == X86_64_INTEGER_CLASS - && (mode == CDImode || mode == TImode || mode == TFmode) + && (mode == CDImode || mode == TImode) && intreg[0] + 1 == intreg[1]) return gen_rtx_REG (mode, intreg[0]); @@ -7129,9 +7132,15 @@ ix86_function_value_regno_p (const unsigned int regno) switch (regno) { case AX_REG: + case DX_REG: return true; + case DI_REG: + case SI_REG: + return TARGET_64BIT && ix86_abi != MS_ABI; - case FIRST_FLOAT_REG: + /* Complex values are returned in %st(0)/%st(1) pair. */ + case ST0_REG: + case ST1_REG: /* TODO: The function should depend on current function ABI but builtins.c would need updating then. Therefore we use the default ABI. */ @@ -7139,10 +7148,12 @@ ix86_function_value_regno_p (const unsigned int regno) return false; return TARGET_FLOAT_RETURNS_IN_80387; - case FIRST_SSE_REG: + /* Complex values are returned in %xmm0/%xmm1 pair. */ + case XMM0_REG: + case XMM1_REG: return TARGET_SSE; - case FIRST_MMX_REG: + case MM0_REG: if (TARGET_MACHO || TARGET_64BIT) return false; return TARGET_MMX; @@ -8613,17 +8624,12 @@ output_set_got (rtx dest, rtx label ATTRIBUTE_UNUSED) if (!flag_pic) { - xops[2] = gen_rtx_LABEL_REF (Pmode, label ? label : gen_label_rtx ()); + if (TARGET_MACHO) + /* We don't need a pic base, we're not producing pic. */ + gcc_unreachable (); + xops[2] = gen_rtx_LABEL_REF (Pmode, label ? label : gen_label_rtx ()); output_asm_insn ("mov%z0\t{%2, %0|%0, %2}", xops); - -#if TARGET_MACHO - /* Output the Mach-O "canonical" label name ("Lxx$pb") here too. This - is what will be referenced by the Mach-O PIC subsystem. */ - if (!label) - ASM_OUTPUT_LABEL (asm_out_file, MACHOPIC_FUNCTION_BASE_NAME); -#endif - targetm.asm_out.internal_label (asm_out_file, "L", CODE_LABEL_NUMBER (XEXP (xops[2], 0))); } @@ -8636,12 +8642,18 @@ output_set_got (rtx dest, rtx label ATTRIBUTE_UNUSED) xops[2] = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name)); xops[2] = gen_rtx_MEM (QImode, xops[2]); output_asm_insn ("call\t%X2", xops); - /* Output the Mach-O "canonical" label name ("Lxx$pb") here too. This - is what will be referenced by the Mach-O PIC subsystem. */ + #if TARGET_MACHO - if (!label) + /* Output the Mach-O "canonical" pic base label name ("Lxx$pb") here. + This is what will be referenced by the Mach-O PIC subsystem. */ + if (machopic_should_output_picbase_label () || !label) ASM_OUTPUT_LABEL (asm_out_file, MACHOPIC_FUNCTION_BASE_NAME); - else + + /* When we are restoring the pic base at the site of a nonlocal label, + and we decided to emit the pic base above, we will still output a + local label used for calculating the correction offset (even though + the offset will be 0 in that case). */ + if (label) targetm.asm_out.internal_label (asm_out_file, "L", CODE_LABEL_NUMBER (label)); #endif @@ -8717,7 +8729,8 @@ ix86_save_reg (unsigned int regno, bool maybe_eh_return) && (df_regs_ever_live_p (REAL_PIC_OFFSET_TABLE_REGNUM) || crtl->profile || crtl->calls_eh_return - || crtl->uses_const_pool)) + || crtl->uses_const_pool + || cfun->has_nonlocal_label)) return ix86_select_alt_pic_regnum () == INVALID_REGNUM; if (crtl->calls_eh_return && maybe_eh_return) @@ -10421,14 +10434,14 @@ ix86_expand_prologue (void) if (r10_live && eax_live) { - t = choose_baseaddr (m->fs.sp_offset - allocate); + t = gen_rtx_PLUS (Pmode, stack_pointer_rtx, eax); emit_move_insn (r10, gen_frame_mem (Pmode, t)); - t = choose_baseaddr (m->fs.sp_offset - allocate - UNITS_PER_WORD); + t = plus_constant (t, UNITS_PER_WORD); emit_move_insn (eax, gen_frame_mem (Pmode, t)); } else if (eax_live || r10_live) { - t = choose_baseaddr (m->fs.sp_offset - allocate); + t = gen_rtx_PLUS (Pmode, stack_pointer_rtx, eax); emit_move_insn ((eax_live ? eax : r10), gen_frame_mem (Pmode, t)); } } @@ -11424,30 +11437,6 @@ ix86_live_on_entry (bitmap regs) } } -/* Determine if op is suitable SUBREG RTX for address. */ - -static bool -ix86_address_subreg_operand (rtx op) -{ - enum machine_mode mode; - - if (!REG_P (op)) - return false; - - mode = GET_MODE (op); - - if (GET_MODE_CLASS (mode) != MODE_INT) - return false; - - /* Don't allow SUBREGs that span more than a word. It can lead to spill - failures when the register is one word out of a two word structure. */ - if (GET_MODE_SIZE (mode) > UNITS_PER_WORD) - return false; - - /* Allow only SUBREGs of non-eliminable hard registers. */ - return register_no_elim_operand (op, mode); -} - /* Extract the parts of an RTL expression that is a valid memory address for an instruction. Return 0 if the structure of the address is grossly off. Return -1 if the address contains ASHIFT, so it is not @@ -11512,7 +11501,7 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) base = addr; else if (GET_CODE (addr) == SUBREG) { - if (ix86_address_subreg_operand (SUBREG_REG (addr))) + if (REG_P (SUBREG_REG (addr))) base = addr; else return 0; @@ -11570,7 +11559,7 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) break; case SUBREG: - if (!ix86_address_subreg_operand (SUBREG_REG (op))) + if (!REG_P (SUBREG_REG (op))) return 0; /* FALLTHRU */ @@ -11615,19 +11604,6 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) scale = 1 << scale; retval = -1; } - else if (CONST_INT_P (addr)) - { - if (!x86_64_immediate_operand (addr, VOIDmode)) - return 0; - - /* Constant addresses are sign extended to 64bit, we have to - prevent addresses from 0x80000000 to 0xffffffff in x32 mode. */ - if (TARGET_X32 - && val_signbit_known_set_p (SImode, INTVAL (addr))) - return 0; - - disp = addr; - } else disp = addr; /* displacement */ @@ -11636,7 +11612,7 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) if (REG_P (index)) ; else if (GET_CODE (index) == SUBREG - && ix86_address_subreg_operand (SUBREG_REG (index))) + && REG_P (SUBREG_REG (index))) ; else return 0; @@ -12115,6 +12091,45 @@ ix86_legitimize_reload_address (rtx x, return false; } +/* Determine if op is suitable RTX for an address register. + Return naked register if a register or a register subreg is + found, otherwise return NULL_RTX. */ + +static rtx +ix86_validate_address_register (rtx op) +{ + enum machine_mode mode = GET_MODE (op); + + /* Only SImode or DImode registers can form the address. */ + if (mode != SImode && mode != DImode) + return NULL_RTX; + + if (REG_P (op)) + return op; + else if (GET_CODE (op) == SUBREG) + { + rtx reg = SUBREG_REG (op); + + if (!REG_P (reg)) + return NULL_RTX; + + mode = GET_MODE (reg); + + /* Don't allow SUBREGs that span more than a word. It can + lead to spill failures when the register is one word out + of a two word structure. */ + if (GET_MODE_SIZE (mode) > UNITS_PER_WORD) + return NULL_RTX; + + /* Allow only SUBREGs of non-eliminable hard registers. */ + if (register_no_elim_operand (reg, mode)) + return reg; + } + + /* Op is not a register. */ + return NULL_RTX; +} + /* Recognizes RTL expressions that are valid memory addresses for an instruction. The MODE argument is the machine mode for the MEM expression that wants to use this address. @@ -12130,6 +12145,7 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, struct ix86_address parts; rtx base, index, disp; HOST_WIDE_INT scale; + enum ix86_address_seg seg; if (ix86_decompose_address (addr, &parts) <= 0) /* Decomposition failed. */ @@ -12139,21 +12155,14 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, index = parts.index; disp = parts.disp; scale = parts.scale; + seg = parts.seg; /* Validate base register. */ if (base) { - rtx reg; - - if (REG_P (base)) - reg = base; - else if (GET_CODE (base) == SUBREG && REG_P (SUBREG_REG (base))) - reg = SUBREG_REG (base); - else - /* Base is not a register. */ - return false; + rtx reg = ix86_validate_address_register (base); - if (GET_MODE (base) != SImode && GET_MODE (base) != DImode) + if (reg == NULL_RTX) return false; if ((strict && ! REG_OK_FOR_BASE_STRICT_P (reg)) @@ -12165,17 +12174,9 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, /* Validate index register. */ if (index) { - rtx reg; + rtx reg = ix86_validate_address_register (index); - if (REG_P (index)) - reg = index; - else if (GET_CODE (index) == SUBREG && REG_P (SUBREG_REG (index))) - reg = SUBREG_REG (index); - else - /* Index is not a register. */ - return false; - - if (GET_MODE (index) != SImode && GET_MODE (index) != DImode) + if (reg == NULL_RTX) return false; if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (reg)) @@ -12189,6 +12190,12 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, && GET_MODE (base) != GET_MODE (index)) return false; + /* Address override works only on the (%reg) part of %fs:(%reg). */ + if (seg != SEG_DEFAULT + && ((base && GET_MODE (base) != word_mode) + || (index && GET_MODE (index) != word_mode))) + return false; + /* Validate scale factor. */ if (scale != 1) { @@ -12310,6 +12317,12 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, && !x86_64_immediate_operand (disp, VOIDmode)) /* Displacement is out of range. */ return false; + /* In x32 mode, constant addresses are sign extended to 64bit, so + we have to prevent addresses from 0x80000000 to 0xffffffff. */ + else if (TARGET_X32 && !(index || base) + && CONST_INT_P (disp) + && val_signbit_known_set_p (SImode, INTVAL (disp))) + return false; } /* Everything looks valid. */ @@ -13652,8 +13665,6 @@ put_condition_code (enum rtx_code code, enum machine_mode mode, int reverse, Those same assemblers have the same but opposite lossage on cmov. */ if (mode == CCmode) suffix = fp ? "nbe" : "a"; - else if (mode == CCCmode) - suffix = "b"; else gcc_unreachable (); break; @@ -13675,8 +13686,12 @@ put_condition_code (enum rtx_code code, enum machine_mode mode, int reverse, } break; case LTU: - gcc_assert (mode == CCmode || mode == CCCmode); - suffix = "b"; + if (mode == CCmode) + suffix = "b"; + else if (mode == CCCmode) + suffix = "c"; + else + gcc_unreachable (); break; case GE: switch (mode) @@ -13696,20 +13711,20 @@ put_condition_code (enum rtx_code code, enum machine_mode mode, int reverse, } break; case GEU: - /* ??? As above. */ - gcc_assert (mode == CCmode || mode == CCCmode); - suffix = fp ? "nb" : "ae"; + if (mode == CCmode) + suffix = fp ? "nb" : "ae"; + else if (mode == CCCmode) + suffix = "nc"; + else + gcc_unreachable (); break; case LE: gcc_assert (mode == CCmode || mode == CCGCmode || mode == CCNOmode); suffix = "le"; break; case LEU: - /* ??? As above. */ if (mode == CCmode) suffix = "be"; - else if (mode == CCCmode) - suffix = fp ? "nb" : "ae"; else gcc_unreachable (); break; @@ -16973,16 +16988,23 @@ ix86_avoid_lea_for_addr (rtx insn, rtx operands[]) int ok; /* FIXME: Handle zero-extended addresses. */ - if (GET_CODE (operands[1]) == ZERO_EXTEND - || GET_CODE (operands[1]) == AND) + if (SImode_address_operand (operands[1], VOIDmode)) return false; /* Check we need to optimize. */ if (!TARGET_OPT_AGU || optimize_function_for_size_p (cfun)) return false; - /* Check it is correct to split here. */ - if (!ix86_ok_to_clobber_flags(insn)) + /* The "at least two components" test below might not catch simple + move insns if parts.base is non-NULL and parts.disp is const0_rtx + as the only components in the address, e.g. if the register is + %rbp or %r13. As this test is much cheaper and moves are the + common case, do this check first. */ + if (REG_P (operands[1])) + return false; + + /* Check if it is OK to split here. */ + if (!ix86_ok_to_clobber_flags (insn)) return false; ok = ix86_decompose_address (operands[1], &parts); @@ -18057,12 +18079,7 @@ ix86_cc_mode (enum rtx_code code, rtx op0, rtx op1) return CCmode; case GTU: /* CF=0 & ZF=0 */ case LEU: /* CF=1 | ZF=1 */ - /* Detect overflow checks. They need just the carry flag. */ - if (GET_CODE (op0) == MINUS - && rtx_equal_p (op1, XEXP (op0, 0))) - return CCCmode; - else - return CCmode; + return CCmode; /* Codes possibly doable only with sign flag when comparing against zero. */ case GE: /* SF=OF or SF=0 */ @@ -20026,7 +20043,7 @@ ix86_expand_vec_perm (rtx operands[]) vec[i * 2 + 1] = const1_rtx; } vt = gen_rtx_CONST_VECTOR (maskmode, gen_rtvec_v (w, vec)); - vt = force_const_mem (maskmode, vt); + vt = validize_mem (force_const_mem (maskmode, vt)); t1 = expand_simple_binop (maskmode, PLUS, t1, vt, t1, 1, OPTAB_DIRECT); @@ -20056,7 +20073,7 @@ ix86_expand_vec_perm (rtx operands[]) return; case V8SFmode: - mask = gen_lowpart (V8SFmode, mask); + mask = gen_lowpart (V8SImode, mask); if (one_operand_shuffle) emit_insn (gen_avx2_permvarv8sf (target, op0, mask)); else @@ -20223,7 +20240,7 @@ ix86_expand_vec_perm (rtx operands[]) for (i = 0; i < 16; ++i) vec[i] = GEN_INT (i/e * e); vt = gen_rtx_CONST_VECTOR (V16QImode, gen_rtvec_v (16, vec)); - vt = force_const_mem (V16QImode, vt); + vt = validize_mem (force_const_mem (V16QImode, vt)); if (TARGET_XOP) emit_insn (gen_xop_pperm (mask, mask, mask, vt)); else @@ -20234,7 +20251,7 @@ ix86_expand_vec_perm (rtx operands[]) for (i = 0; i < 16; ++i) vec[i] = GEN_INT (i % e); vt = gen_rtx_CONST_VECTOR (V16QImode, gen_rtvec_v (16, vec)); - vt = force_const_mem (V16QImode, vt); + vt = validize_mem (force_const_mem (V16QImode, vt)); emit_insn (gen_addv16qi3 (mask, mask, vt)); } @@ -24258,7 +24275,8 @@ ix86_constant_alignment (tree exp, int align) int ix86_data_alignment (tree type, int align) { - int max_align = optimize_size ? BITS_PER_WORD : MIN (256, MAX_OFILE_ALIGNMENT); + int max_align + = optimize_size ? BITS_PER_WORD : MIN (256, MAX_OFILE_ALIGNMENT); if (AGGREGATE_TYPE_P (type) && TYPE_SIZE (type) @@ -27199,8 +27217,8 @@ static const struct builtin_description bdesc_multi_arg[] = { OPTION_MASK_ISA_XOP, CODE_FOR_xop_shlv8hi3, "__builtin_ia32_vpshlw", IX86_BUILTIN_VPSHLW, UNKNOWN, (int)MULTI_ARG_2_HI }, { OPTION_MASK_ISA_XOP, CODE_FOR_xop_shlv16qi3, "__builtin_ia32_vpshlb", IX86_BUILTIN_VPSHLB, UNKNOWN, (int)MULTI_ARG_2_QI }, - { OPTION_MASK_ISA_XOP, CODE_FOR_xop_vmfrczv4sf2, "__builtin_ia32_vfrczss", IX86_BUILTIN_VFRCZSS, UNKNOWN, (int)MULTI_ARG_2_SF }, - { OPTION_MASK_ISA_XOP, CODE_FOR_xop_vmfrczv2df2, "__builtin_ia32_vfrczsd", IX86_BUILTIN_VFRCZSD, UNKNOWN, (int)MULTI_ARG_2_DF }, + { OPTION_MASK_ISA_XOP, CODE_FOR_xop_vmfrczv4sf2, "__builtin_ia32_vfrczss", IX86_BUILTIN_VFRCZSS, UNKNOWN, (int)MULTI_ARG_1_SF }, + { OPTION_MASK_ISA_XOP, CODE_FOR_xop_vmfrczv2df2, "__builtin_ia32_vfrczsd", IX86_BUILTIN_VFRCZSD, UNKNOWN, (int)MULTI_ARG_1_DF }, { OPTION_MASK_ISA_XOP, CODE_FOR_xop_frczv4sf2, "__builtin_ia32_vfrczps", IX86_BUILTIN_VFRCZPS, UNKNOWN, (int)MULTI_ARG_1_SF }, { OPTION_MASK_ISA_XOP, CODE_FOR_xop_frczv2df2, "__builtin_ia32_vfrczpd", IX86_BUILTIN_VFRCZPD, UNKNOWN, (int)MULTI_ARG_1_DF }, { OPTION_MASK_ISA_XOP, CODE_FOR_xop_frczv8sf2, "__builtin_ia32_vfrczps256", IX86_BUILTIN_VFRCZPS256, UNKNOWN, (int)MULTI_ARG_1_SF2 }, @@ -29675,7 +29693,8 @@ rdrand_step: else op2 = gen_rtx_SUBREG (SImode, op0, 0); - if (target == 0) + if (target == 0 + || !register_operand (target, SImode)) target = gen_reg_rtx (SImode); pat = gen_rtx_GEU (VOIDmode, gen_rtx_REG (CCCmode, FLAGS_REG), @@ -29763,7 +29782,9 @@ rdrand_step: mode4 = insn_data[icode].operand[5].mode; if (target == NULL_RTX - || GET_MODE (target) != insn_data[icode].operand[0].mode) + || GET_MODE (target) != insn_data[icode].operand[0].mode + || !insn_data[icode].operand[0].predicate (target, + GET_MODE (target))) subtarget = gen_reg_rtx (insn_data[icode].operand[0].mode); else subtarget = target; @@ -32386,7 +32407,7 @@ x86_output_mi_thunk (FILE *file, { tmp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, fnaddr), UNSPEC_GOTPCREL); tmp = gen_rtx_CONST (Pmode, tmp); - fnaddr = gen_rtx_MEM (Pmode, tmp); + fnaddr = gen_const_mem (Pmode, tmp); } } else @@ -32406,8 +32427,9 @@ x86_output_mi_thunk (FILE *file, output_set_got (tmp, NULL_RTX); fnaddr = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, fnaddr), UNSPEC_GOT); - fnaddr = gen_rtx_PLUS (Pmode, fnaddr, tmp); - fnaddr = gen_rtx_MEM (Pmode, fnaddr); + fnaddr = gen_rtx_CONST (Pmode, fnaddr); + fnaddr = gen_rtx_PLUS (Pmode, tmp, fnaddr); + fnaddr = gen_const_mem (Pmode, fnaddr); } } @@ -36635,7 +36657,9 @@ expand_vec_perm_interleave2 (struct expand_vec_perm_d *d) else dfinal.perm[i] = e; } - dfinal.op0 = gen_reg_rtx (dfinal.vmode); + + if (!d->testing_p) + dfinal.op0 = gen_reg_rtx (dfinal.vmode); dfinal.op1 = dfinal.op0; dremap.target = dfinal.op0; @@ -36833,6 +36857,9 @@ expand_vec_perm_pshufb2 (struct expand_vec_perm_d *d) return false; gcc_assert (d->op0 != d->op1); + if (d->testing_p) + return true; + nelt = d->nelt; eltsz = GET_MODE_SIZE (GET_MODE_INNER (d->vmode)); @@ -37032,6 +37059,8 @@ expand_vec_perm_even_odd_1 (struct expand_vec_perm_d *d, unsigned odd) switch (d->vmode) { case V4DFmode: + if (d->testing_p) + break; t1 = gen_reg_rtx (V4DFmode); t2 = gen_reg_rtx (V4DFmode); @@ -37051,6 +37080,8 @@ expand_vec_perm_even_odd_1 (struct expand_vec_perm_d *d, unsigned odd) { int mask = odd ? 0xdd : 0x88; + if (d->testing_p) + break; t1 = gen_reg_rtx (V8SFmode); t2 = gen_reg_rtx (V8SFmode); t3 = gen_reg_rtx (V8SFmode); @@ -37092,6 +37123,8 @@ expand_vec_perm_even_odd_1 (struct expand_vec_perm_d *d, unsigned odd) return expand_vec_perm_pshufb2 (d); else { + if (d->testing_p) + break; /* We need 2*log2(N)-1 operations to achieve odd/even with interleave. */ t1 = gen_reg_rtx (V8HImode); @@ -37113,6 +37146,8 @@ expand_vec_perm_even_odd_1 (struct expand_vec_perm_d *d, unsigned odd) return expand_vec_perm_pshufb2 (d); else { + if (d->testing_p) + break; t1 = gen_reg_rtx (V16QImode); t2 = gen_reg_rtx (V16QImode); t3 = gen_reg_rtx (V16QImode); @@ -37145,6 +37180,9 @@ expand_vec_perm_even_odd_1 (struct expand_vec_perm_d *d, unsigned odd) return expand_vec_perm_even_odd_1 (&d_copy, odd); } + if (d->testing_p) + break; + t1 = gen_reg_rtx (V4DImode); t2 = gen_reg_rtx (V4DImode); @@ -37171,6 +37209,9 @@ expand_vec_perm_even_odd_1 (struct expand_vec_perm_d *d, unsigned odd) return expand_vec_perm_even_odd_1 (&d_copy, odd); } + if (d->testing_p) + break; + t1 = gen_reg_rtx (V8SImode); t2 = gen_reg_rtx (V8SImode); @@ -37263,6 +37304,8 @@ expand_vec_perm_broadcast_1 (struct expand_vec_perm_d *d) case V16QImode: /* These can be implemented via interleave. We save one insn by stopping once we have promoted to V4SImode and then use pshufd. */ + if (d->testing_p) + return true; do { rtx dest; diff --git a/contrib/gcc-4.7/gcc/config/i386/i386.md b/contrib/gcc-4.7/gcc/config/i386/i386.md index d462b76cbe..f09717d15a 100644 --- a/contrib/gcc-4.7/gcc/config/i386/i386.md +++ b/contrib/gcc-4.7/gcc/config/i386/i386.md @@ -109,6 +109,7 @@ UNSPEC_CALL_NEEDS_VZEROUPPER UNSPEC_PAUSE UNSPEC_LEA_ADDR + UNSPEC_STOS ;; For SSE/MMX support: UNSPEC_FIX_NOTRUNC @@ -201,7 +202,10 @@ ;; For RDRAND support UNSPECV_RDRAND -]) + + ;; Non-local goto. + UNSPECV_NLGR + ]) ;; Constants to represent rounding modes in the ROUND instruction (define_constants @@ -1644,7 +1648,7 @@ split_double_mode (DImode, &operands[1], 1, &operands[2], &operands[3]); operands[1] = gen_lowpart (DImode, operands[2]); - operands[2] = gen_rtx_MEM (SImode, gen_rtx_PLUS (DImode, stack_pointer_rtx, + operands[2] = gen_rtx_MEM (SImode, gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (4))); }) @@ -1661,7 +1665,7 @@ split_double_mode (DImode, &operands[1], 1, &operands[2], &operands[3]); operands[1] = gen_lowpart (DImode, operands[2]); - operands[2] = gen_rtx_MEM (SImode, gen_rtx_PLUS (DImode, stack_pointer_rtx, + operands[2] = gen_rtx_MEM (SImode, gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (4))); }) @@ -1855,18 +1859,16 @@ [(set_attr "type" "*,*,sselog1,ssemov,ssemov") (set_attr "prefix" "*,*,maybe_vex,maybe_vex,maybe_vex") (set (attr "mode") - (cond [(eq_attr "alternative" "2,3") - (if_then_else - (match_test "optimize_function_for_size_p (cfun)") - (const_string "V4SF") - (const_string "TI")) - (eq_attr "alternative" "4") - (if_then_else - (ior (match_test "TARGET_SSE_TYPELESS_STORES") - (match_test "optimize_function_for_size_p (cfun)")) - (const_string "V4SF") - (const_string "TI"))] - (const_string "DI")))]) + (cond [(eq_attr "alternative" "0,1") + (const_string "DI") + (ior (not (match_test "TARGET_SSE2")) + (match_test "optimize_function_for_size_p (cfun)")) + (const_string "V4SF") + (and (eq_attr "alternative" "4") + (match_test "TARGET_SSE_TYPELESS_STORES")) + (const_string "V4SF") + ] + (const_string "TI")))]) (define_split [(set (match_operand:TI 0 "nonimmediate_operand" "") @@ -2328,7 +2330,7 @@ "TARGET_LP64 && ix86_check_movabs (insn, 0)" "@ movabs{}\t{%1, %P0|[%P0], %1} - mov{}\t{%1, %a0|%a0, %1}" + mov{}\t{%1, %a0| PTR %a0, %1}" [(set_attr "type" "imov") (set_attr "modrm" "0,*") (set_attr "length_address" "8,0") @@ -2342,7 +2344,7 @@ "TARGET_LP64 && ix86_check_movabs (insn, 1)" "@ movabs{}\t{%P1, %0|%0, [%P1]} - mov{}\t{%a1, %0|%0, %a1}" + mov{}\t{%a1, %0|%0, PTR %a1}" [(set_attr "type" "imov") (set_attr "modrm" "0,*") (set_attr "length_address" "8,0") @@ -3444,9 +3446,9 @@ }) (define_insn "*zero_extendsidi2_rex64" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,?*Ym,?*y,?*Yi,*x") + [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,?*Ym,?!*y,?*Yi,*x") (zero_extend:DI - (match_operand:SI 1 "nonimmediate_operand" "rm,0,r ,m ,r ,m")))] + (match_operand:SI 1 "nonimmediate_operand" "rm,0,r ,m ,r ,m")))] "TARGET_64BIT" "@ mov{l}\t{%1, %k0|%k0, %1} @@ -3469,9 +3471,9 @@ ;; %%% Kill me once multi-word ops are sane. (define_insn "zero_extendsidi2_1" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,?r,?o,?*Ym,?*y,?*Yi,*x") + [(set (match_operand:DI 0 "nonimmediate_operand" "=r,?r,?o,?*Ym,?!*y,?*Yi,*x") (zero_extend:DI - (match_operand:SI 1 "nonimmediate_operand" "0,rm,r ,r ,m ,r ,m"))) + (match_operand:SI 1 "nonimmediate_operand" "0,rm,r ,r ,m ,r ,m"))) (clobber (reg:CC FLAGS_REG))] "!TARGET_64BIT" "@ @@ -6553,7 +6555,7 @@ (set_attr "pent_pair" "pu") (set_attr "mode" "SI")]) -;; Overflow setting add and subtract instructions +;; Overflow setting add instructions (define_insn "*add3_cconly_overflow" [(set (reg:CCC FLAGS_REG) @@ -6568,43 +6570,31 @@ [(set_attr "type" "alu") (set_attr "mode" "")]) -(define_insn "*sub3_cconly_overflow" +(define_insn "*add3_cc_overflow" [(set (reg:CCC FLAGS_REG) (compare:CCC - (minus:SWI - (match_operand:SWI 0 "nonimmediate_operand" "m,") - (match_operand:SWI 1 "" ",m")) - (match_dup 0)))] - "" - "cmp{}\t{%1, %0|%0, %1}" - [(set_attr "type" "icmp") - (set_attr "mode" "")]) - -(define_insn "*3_cc_overflow" - [(set (reg:CCC FLAGS_REG) - (compare:CCC - (plusminus:SWI - (match_operand:SWI 1 "nonimmediate_operand" "0,0") + (plus:SWI + (match_operand:SWI 1 "nonimmediate_operand" "%0,0") (match_operand:SWI 2 "" ",m")) (match_dup 1))) (set (match_operand:SWI 0 "nonimmediate_operand" "=m,") - (plusminus:SWI (match_dup 1) (match_dup 2)))] - "ix86_binary_operator_ok (, mode, operands)" - "{}\t{%2, %0|%0, %2}" + (plus:SWI (match_dup 1) (match_dup 2)))] + "ix86_binary_operator_ok (PLUS, mode, operands)" + "add{}\t{%2, %0|%0, %2}" [(set_attr "type" "alu") (set_attr "mode" "")]) -(define_insn "*si3_zext_cc_overflow" +(define_insn "*addsi3_zext_cc_overflow" [(set (reg:CCC FLAGS_REG) (compare:CCC - (plusminus:SI - (match_operand:SI 1 "nonimmediate_operand" "0") + (plus:SI + (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "x86_64_general_operand" "rme")) (match_dup 1))) (set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI (plusminus:SI (match_dup 1) (match_dup 2))))] - "TARGET_64BIT && ix86_binary_operator_ok (, SImode, operands)" - "{l}\t{%2, %k0|%k0, %2}" + (zero_extend:DI (plus:SI (match_dup 1) (match_dup 2))))] + "TARGET_64BIT && ix86_binary_operator_ok (PLUS, SImode, operands)" + "add{l}\t{%2, %k0|%k0, %2}" [(set_attr "type" "alu") (set_attr "mode" "SI")]) @@ -7933,7 +7923,18 @@ (const_int 0))) (set (match_operand:DI 0 "nonimmediate_operand" "=r,r,rm") (and:DI (match_dup 1) (match_dup 2)))] - "TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode) + "TARGET_64BIT + && ix86_match_ccmode + (insn, + /* If we are going to emit andl instead of andq, and the operands[2] + constant might have the SImode sign bit set, make sure the sign + flag isn't tested, because the instruction will set the sign flag + based on bit 31 rather than bit 63. If it isn't CONST_INT, + conservatively assume it might have bit 31 set. */ + (satisfies_constraint_Z (operands[2]) + && (!CONST_INT_P (operands[2]) + || val_signbit_known_set_p (SImode, INTVAL (operands[2])))) + ? CCZmode : CCNOmode) && ix86_binary_operator_ok (AND, DImode, operands)" "@ and{l}\t{%k2, %k0|%k0, %k2} @@ -12087,8 +12088,8 @@ (define_insn "bmi_bextr_" [(set (match_operand:SWI48 0 "register_operand" "=r") - (unspec:SWI48 [(match_operand:SWI48 1 "register_operand" "r") - (match_operand:SWI48 2 "nonimmediate_operand" "rm")] + (unspec:SWI48 [(match_operand:SWI48 1 "nonimmediate_operand" "rm") + (match_operand:SWI48 2 "register_operand" "r")] UNSPEC_BEXTR)) (clobber (reg:CC FLAGS_REG))] "TARGET_BMI" @@ -12137,9 +12138,9 @@ ;; BMI2 instructions. (define_insn "bmi2_bzhi_3" [(set (match_operand:SWI48 0 "register_operand" "=r") - (and:SWI48 (match_operand:SWI48 1 "register_operand" "r") - (lshiftrt:SWI48 (const_int -1) - (match_operand:SWI48 2 "nonimmediate_operand" "rm")))) + (and:SWI48 (lshiftrt:SWI48 (const_int -1) + (match_operand:SWI48 2 "register_operand" "r")) + (match_operand:SWI48 1 "nonimmediate_operand" "rm"))) (clobber (reg:CC FLAGS_REG))] "TARGET_BMI2" "bzhi\t{%2, %1, %0|%0, %1, %2}" @@ -15912,7 +15913,8 @@ [(parallel [(set (match_operand 1 "memory_operand" "") (match_operand 2 "register_operand" "")) (set (match_operand 0 "register_operand" "") - (match_operand 3 "" ""))])] + (match_operand 3 "" "")) + (unspec [(const_int 0)] UNSPEC_STOS)])] "" "ix86_current_function_needs_cld = 1;") @@ -15921,7 +15923,8 @@ (match_operand:DI 2 "register_operand" "a")) (set (match_operand:DI 0 "register_operand" "=D") (plus:DI (match_dup 1) - (const_int 8)))] + (const_int 8))) + (unspec [(const_int 0)] UNSPEC_STOS)] "TARGET_64BIT && !(fixed_regs[AX_REG] || fixed_regs[DI_REG])" "stosq" @@ -15934,7 +15937,8 @@ (match_operand:SI 2 "register_operand" "a")) (set (match_operand:P 0 "register_operand" "=D") (plus:P (match_dup 1) - (const_int 4)))] + (const_int 4))) + (unspec [(const_int 0)] UNSPEC_STOS)] "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])" "stos{l|d}" [(set_attr "type" "str") @@ -15946,7 +15950,8 @@ (match_operand:HI 2 "register_operand" "a")) (set (match_operand:P 0 "register_operand" "=D") (plus:P (match_dup 1) - (const_int 2)))] + (const_int 2))) + (unspec [(const_int 0)] UNSPEC_STOS)] "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])" "stosw" [(set_attr "type" "str") @@ -15958,7 +15963,8 @@ (match_operand:QI 2 "register_operand" "a")) (set (match_operand:P 0 "register_operand" "=D") (plus:P (match_dup 1) - (const_int 1)))] + (const_int 1))) + (unspec [(const_int 0)] UNSPEC_STOS)] "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])" "stosb" [(set_attr "type" "str") @@ -16797,7 +16803,37 @@ emit_insn (gen_set_got (pic_offset_table_rtx)); DONE; }) - + +(define_insn_and_split "nonlocal_goto_receiver" + [(unspec_volatile [(const_int 0)] UNSPECV_NLGR)] + "TARGET_MACHO && !TARGET_64BIT && flag_pic" + "#" + "&& reload_completed" + [(const_int 0)] +{ + if (crtl->uses_pic_offset_table) + { + rtx xops[3]; + rtx label_rtx = gen_label_rtx (); + rtx tmp; + + /* Get a new pic base. */ + emit_insn (gen_set_got_labelled (pic_offset_table_rtx, label_rtx)); + /* Correct this with the offset from the new to the old. */ + xops[0] = xops[1] = pic_offset_table_rtx; + label_rtx = gen_rtx_LABEL_REF (SImode, label_rtx); + tmp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, label_rtx), + UNSPEC_MACHOPIC_OFFSET); + xops[2] = gen_rtx_CONST (Pmode, tmp); + ix86_expand_binary_operator (MINUS, SImode, xops); + } + else + /* No pic reg restore needed. */ + emit_note (NOTE_INSN_DELETED); + + DONE; +}) + ;; Avoid redundant prefixes by splitting HImode arithmetic to SImode. (define_split @@ -17190,6 +17226,7 @@ "(TARGET_READ_MODIFY_WRITE || optimize_insn_for_size_p ()) && peep2_reg_dead_p (4, operands[0]) && !reg_overlap_mentioned_p (operands[0], operands[1]) + && !reg_overlap_mentioned_p (operands[0], operands[2]) && (mode != QImode || immediate_operand (operands[2], QImode) || q_regs_operand (operands[2], QImode)) @@ -17254,6 +17291,7 @@ || immediate_operand (operands[2], SImode) || q_regs_operand (operands[2], SImode)) && !reg_overlap_mentioned_p (operands[0], operands[1]) + && !reg_overlap_mentioned_p (operands[0], operands[2]) && ix86_match_ccmode (peep2_next_insn (3), (GET_CODE (operands[3]) == PLUS || GET_CODE (operands[3]) == MINUS) diff --git a/contrib/gcc-4.7/gcc/config/i386/predicates.md b/contrib/gcc-4.7/gcc/config/i386/predicates.md index 9e312915bf..ba835728d9 100644 --- a/contrib/gcc-4.7/gcc/config/i386/predicates.md +++ b/contrib/gcc-4.7/gcc/config/i386/predicates.md @@ -841,19 +841,28 @@ return false; /* VSIB addressing doesn't support (%rip). */ - if (parts.disp && GET_CODE (parts.disp) == CONST) + if (parts.disp) { - disp = XEXP (parts.disp, 0); - if (GET_CODE (disp) == PLUS) - disp = XEXP (disp, 0); - if (GET_CODE (disp) == UNSPEC) - switch (XINT (disp, 1)) - { - case UNSPEC_GOTPCREL: - case UNSPEC_PCREL: - case UNSPEC_GOTNTPOFF: - return false; - } + disp = parts.disp; + if (GET_CODE (disp) == CONST) + { + disp = XEXP (disp, 0); + if (GET_CODE (disp) == PLUS) + disp = XEXP (disp, 0); + if (GET_CODE (disp) == UNSPEC) + switch (XINT (disp, 1)) + { + case UNSPEC_GOTPCREL: + case UNSPEC_PCREL: + case UNSPEC_GOTNTPOFF: + return false; + } + } + if (TARGET_64BIT + && flag_pic + && (GET_CODE (disp) == SYMBOL_REF + || GET_CODE (disp) == LABEL_REF)) + return false; } return true; diff --git a/contrib/gcc-4.7/gcc/config/i386/sse.md b/contrib/gcc-4.7/gcc/config/i386/sse.md index 8fc267807a..ce70eb8cf2 100644 --- a/contrib/gcc-4.7/gcc/config/i386/sse.md +++ b/contrib/gcc-4.7/gcc/config/i386/sse.md @@ -3276,7 +3276,7 @@ (vec_select:V4SF (vec_concat:V8SF (match_operand:V4SF 1 "nonimmediate_operand" " 0,x,0,x,0") - (match_operand:V4SF 2 "nonimmediate_operand" " x,x,m,x,x")) + (match_operand:V4SF 2 "nonimmediate_operand" " x,x,m,m,x")) (parallel [(const_int 0) (const_int 1) (const_int 4) @@ -11167,7 +11167,8 @@ (match_operand:SI 2 "const_0_to__operand" "n")))] "TARGET_XOP" { - operands[3] = GEN_INT (( * 8) - INTVAL (operands[2])); + operands[3] + = GEN_INT (GET_MODE_BITSIZE (mode) - INTVAL (operands[2])); return \"vprot\t{%3, %1, %0|%0, %1, %3}\"; } [(set_attr "type" "sseishft") @@ -11455,21 +11456,18 @@ [(set_attr "type" "ssecvt1") (set_attr "mode" "")]) -;; scalar insns (define_expand "xop_vmfrcz2" [(set (match_operand:VF_128 0 "register_operand") (vec_merge:VF_128 (unspec:VF_128 [(match_operand:VF_128 1 "nonimmediate_operand")] UNSPEC_FRCZ) - (match_dup 3) + (match_dup 2) (const_int 1)))] "TARGET_XOP" -{ - operands[3] = CONST0_RTX (mode); -}) + "operands[2] = CONST0_RTX (mode);") -(define_insn "*xop_vmfrcz_" +(define_insn "*xop_vmfrcz2" [(set (match_operand:VF_128 0 "register_operand" "=x") (vec_merge:VF_128 (unspec:VF_128 diff --git a/contrib/gcc-4.7/gcc/config/i386/xopintrin.h b/contrib/gcc-4.7/gcc/config/i386/xopintrin.h index 3ebcb4b9f4..49aeed19d8 100644 --- a/contrib/gcc-4.7/gcc/config/i386/xopintrin.h +++ b/contrib/gcc-4.7/gcc/config/i386/xopintrin.h @@ -745,13 +745,17 @@ _mm_frcz_pd (__m128d __A) extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_frcz_ss (__m128 __A, __m128 __B) { - return (__m128) __builtin_ia32_vfrczss ((__v4sf)__A, (__v4sf)__B); + return (__m128) __builtin_ia32_movss ((__v4sf)__A, + (__v4sf) + __builtin_ia32_vfrczss ((__v4sf)__B)); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_frcz_sd (__m128d __A, __m128d __B) { - return (__m128d) __builtin_ia32_vfrczsd ((__v2df)__A, (__v2df)__B); + return (__m128d) __builtin_ia32_movsd ((__v2df)__A, + (__v2df) + __builtin_ia32_vfrczsd ((__v2df)__B)); } extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) diff --git a/contrib/gcc-4.7/gcc/coverage.c b/contrib/gcc-4.7/gcc/coverage.c index ce8b175d2f..8a113a50c2 100644 --- a/contrib/gcc-4.7/gcc/coverage.c +++ b/contrib/gcc-4.7/gcc/coverage.c @@ -988,6 +988,9 @@ coverage_obj_init (void) /* The function is not being emitted, remove from list. */ *fn_prev = fn->next; + if (functions_head == NULL) + return false; + for (ix = 0; ix != GCOV_COUNTERS; ix++) if ((1u << ix) & prg_ctr_mask) n_counters++; @@ -1099,6 +1102,9 @@ coverage_init (const char *filename) memcpy (da_file_name + prefix_len, filename, len); strcpy (da_file_name + prefix_len + len, GCOV_DATA_SUFFIX); + if (flag_branch_probabilities) + read_counts_file (); + /* Name of bbg file. */ if (flag_test_coverage && !flag_compare_debug) { @@ -1118,9 +1124,6 @@ coverage_init (const char *filename) gcov_write_unsigned (local_tick); } } - - if (flag_branch_probabilities) - read_counts_file (); } /* Performs file-level cleanup. Close graph file, generate coverage diff --git a/contrib/gcc-4.7/gcc/cp/call.c b/contrib/gcc-4.7/gcc/cp/call.c index f49851df4e..d655983bbc 100644 --- a/contrib/gcc-4.7/gcc/cp/call.c +++ b/contrib/gcc-4.7/gcc/cp/call.c @@ -894,6 +894,9 @@ build_aggr_conv (tree type, tree ctor, int flags) if (i < CONSTRUCTOR_NELTS (ctor)) val = CONSTRUCTOR_ELT (ctor, i)->value; + else if (TREE_CODE (ftype) == REFERENCE_TYPE) + /* Value-initialization of reference is ill-formed. */ + return NULL; else { if (empty_ctor == NULL_TREE) diff --git a/contrib/gcc-4.7/gcc/cp/cp-tree.h b/contrib/gcc-4.7/gcc/cp/cp-tree.h index 0c1601b474..b4fdda7999 100644 --- a/contrib/gcc-4.7/gcc/cp/cp-tree.h +++ b/contrib/gcc-4.7/gcc/cp/cp-tree.h @@ -1191,17 +1191,20 @@ enum languages { lang_c, lang_cplusplus, lang_java }; /* The _DECL for this _TYPE. */ #define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE))) -/* Nonzero if T is a class (or struct or union) type. Also nonzero - for template type parameters, typename types, and instantiated - template template parameters. Keep these checks in ascending code - order. */ -#define MAYBE_CLASS_TYPE_P(T) \ +/* Nonzero if T is a type that could resolve to any kind of concrete type + at instantiation time. */ +#define WILDCARD_TYPE_P(T) \ (TREE_CODE (T) == TEMPLATE_TYPE_PARM \ || TREE_CODE (T) == TYPENAME_TYPE \ || TREE_CODE (T) == TYPEOF_TYPE \ || TREE_CODE (T) == BOUND_TEMPLATE_TEMPLATE_PARM \ - || TREE_CODE (T) == DECLTYPE_TYPE \ - || CLASS_TYPE_P (T)) + || TREE_CODE (T) == DECLTYPE_TYPE) + +/* Nonzero if T is a class (or struct or union) type. Also nonzero + for template type parameters, typename types, and instantiated + template template parameters. Keep these checks in ascending code + order. */ +#define MAYBE_CLASS_TYPE_P(T) (WILDCARD_TYPE_P (T) || CLASS_TYPE_P (T)) /* Set CLASS_TYPE_P for T to VAL. T must be a class, struct, or union type. */ diff --git a/contrib/gcc-4.7/gcc/cp/cvt.c b/contrib/gcc-4.7/gcc/cp/cvt.c index c411a47f0a..fddba51cef 100644 --- a/contrib/gcc-4.7/gcc/cp/cvt.c +++ b/contrib/gcc-4.7/gcc/cp/cvt.c @@ -198,6 +198,8 @@ cp_convert_to_pointer (tree type, tree expr) if (null_ptr_cst_p (expr)) { + tree val; + if (c_inhibit_evaluation_warnings == 0 && !NULLPTR_TYPE_P (TREE_TYPE (expr))) warning (OPT_Wzero_as_null_pointer_constant, @@ -207,16 +209,14 @@ cp_convert_to_pointer (tree type, tree expr) return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0, /*c_cast_p=*/false, tf_warning_or_error); - if (TYPE_PTRMEM_P (type)) - { - /* A NULL pointer-to-member is represented by -1, not by - zero. */ - expr = build_int_cst_type (type, -1); - } - else - expr = build_int_cst (type, 0); + /* A NULL pointer-to-data-member is represented by -1, not by + zero. */ + val = (TYPE_PTRMEM_P (type) + ? build_int_cst_type (type, -1) + : build_int_cst (type, 0)); - return expr; + return (TREE_SIDE_EFFECTS (expr) + ? build2 (COMPOUND_EXPR, type, expr, val) : val); } else if (TYPE_PTR_TO_MEMBER_P (type) && INTEGRAL_CODE_P (form)) { @@ -1539,17 +1539,6 @@ build_expr_type_conversion (int desires, tree expr, bool complain) if (DECL_NONCONVERTING_P (cand)) continue; - if (TREE_CODE (cand) == TEMPLATE_DECL) - { - if (complain) - { - error ("ambiguous default type conversion from %qT", - basetype); - error (" candidate conversions include %qD", cand); - } - return error_mark_node; - } - candidate = non_reference (TREE_TYPE (TREE_TYPE (cand))); switch (TREE_CODE (candidate)) @@ -1583,11 +1572,23 @@ build_expr_type_conversion (int desires, tree expr, bool complain) break; default: + /* A wildcard could be instantiated to match any desired + type, but we can't deduce the template argument. */ + if (WILDCARD_TYPE_P (candidate)) + win = true; break; } if (win) { + if (TREE_CODE (cand) == TEMPLATE_DECL) + { + if (complain) + error ("default type conversion can't deduce template" + " argument for %qD", cand); + return error_mark_node; + } + if (winner) { if (complain) diff --git a/contrib/gcc-4.7/gcc/cp/decl.c b/contrib/gcc-4.7/gcc/cp/decl.c index db0c233b8e..955fd0f0d5 100644 --- a/contrib/gcc-4.7/gcc/cp/decl.c +++ b/contrib/gcc-4.7/gcc/cp/decl.c @@ -1815,9 +1815,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) /* Merge the data types specified in the two decls. */ newtype = merge_types (TREE_TYPE (newdecl), TREE_TYPE (olddecl)); - /* If merge_types produces a non-typedef type, just use the old type. */ - if (TREE_CODE (newdecl) == TYPE_DECL - && newtype == DECL_ORIGINAL_TYPE (newdecl)) + /* For typedefs use the old type, as the new type's DECL_NAME points + at newdecl, which will be ggc_freed. */ + if (TREE_CODE (newdecl) == TYPE_DECL) newtype = oldtype; if (TREE_CODE (newdecl) == VAR_DECL) diff --git a/contrib/gcc-4.7/gcc/cp/except.c b/contrib/gcc-4.7/gcc/cp/except.c index f7a1c7e511..fbc29d0d2f 100644 --- a/contrib/gcc-4.7/gcc/cp/except.c +++ b/contrib/gcc-4.7/gcc/cp/except.c @@ -383,6 +383,9 @@ build_must_not_throw_expr (tree body, tree cond) { tree type = body ? TREE_TYPE (body) : void_type_node; + if (!flag_exceptions) + return body; + if (cond && !value_dependent_expression_p (cond)) { cond = cxx_constant_value (cond); diff --git a/contrib/gcc-4.7/gcc/cp/init.c b/contrib/gcc-4.7/gcc/cp/init.c index bb0e618fbe..4e4b613dd5 100644 --- a/contrib/gcc-4.7/gcc/cp/init.c +++ b/contrib/gcc-4.7/gcc/cp/init.c @@ -3915,6 +3915,7 @@ build_vec_delete (tree base, tree maxindex, tree cookie_addr; tree size_ptr_type = build_pointer_type (sizetype); + base = mark_rvalue_use (base); if (TREE_SIDE_EFFECTS (base)) { base_init = get_target_expr (base); diff --git a/contrib/gcc-4.7/gcc/cp/mangle.c b/contrib/gcc-4.7/gcc/cp/mangle.c index 2d1cd95831..4f20af6533 100644 --- a/contrib/gcc-4.7/gcc/cp/mangle.c +++ b/contrib/gcc-4.7/gcc/cp/mangle.c @@ -3378,6 +3378,7 @@ mangle_decl (const tree decl) if (G.need_abi_warning /* Don't do this for a fake symbol we aren't going to emit anyway. */ + && TREE_CODE (decl) != TYPE_DECL && !DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl) && !DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (decl)) { diff --git a/contrib/gcc-4.7/gcc/cp/name-lookup.c b/contrib/gcc-4.7/gcc/cp/name-lookup.c index 565d3966ca..952903a7cd 100644 --- a/contrib/gcc-4.7/gcc/cp/name-lookup.c +++ b/contrib/gcc-4.7/gcc/cp/name-lookup.c @@ -399,7 +399,8 @@ pop_binding (tree id, tree decl) } } -/* Strip non dependent using declarations. */ +/* Strip non dependent using declarations. If DECL is dependent, + surreptitiously create a typename_type and return it. */ tree strip_using_decl (tree decl) @@ -409,6 +410,23 @@ strip_using_decl (tree decl) while (TREE_CODE (decl) == USING_DECL && !DECL_DEPENDENT_P (decl)) decl = USING_DECL_DECLS (decl); + + if (TREE_CODE (decl) == USING_DECL && DECL_DEPENDENT_P (decl) + && USING_DECL_TYPENAME_P (decl)) + { + /* We have found a type introduced by a using + declaration at class scope that refers to a dependent + type. + + using typename :: [opt] nested-name-specifier unqualified-id ; + */ + decl = make_typename_type (TREE_TYPE (decl), + DECL_NAME (decl), + typename_type, tf_error); + if (decl != error_mark_node) + decl = TYPE_NAME (decl); + } + return decl; } diff --git a/contrib/gcc-4.7/gcc/cp/parser.c b/contrib/gcc-4.7/gcc/cp/parser.c index f5c60d3c70..120360a4d9 100644 --- a/contrib/gcc-4.7/gcc/cp/parser.c +++ b/contrib/gcc-4.7/gcc/cp/parser.c @@ -6317,10 +6317,6 @@ cp_parser_pseudo_destructor_name (cp_parser* parser, /* Look for the `~'. */ cp_parser_require (parser, CPP_COMPL, RT_COMPL); - /* Once we see the ~, this has to be a pseudo-destructor. */ - if (!processing_template_decl && !cp_parser_error_occurred (parser)) - cp_parser_commit_to_tentative_parse (parser); - /* Look for the type-name again. We are not responsible for checking that it matches the first type-name. */ *type = cp_parser_nonclass_name (parser); @@ -13850,25 +13846,7 @@ cp_parser_nonclass_name (cp_parser* parser) /* Look up the type-name. */ type_decl = cp_parser_lookup_name_simple (parser, identifier, token->location); - if (TREE_CODE (type_decl) == USING_DECL) - { - if (!DECL_DEPENDENT_P (type_decl)) - type_decl = strip_using_decl (type_decl); - else if (USING_DECL_TYPENAME_P (type_decl)) - { - /* We have found a type introduced by a using - declaration at class scope that refers to a dependent - type. - - using typename :: [opt] nested-name-specifier unqualified-id ; - */ - type_decl = make_typename_type (TREE_TYPE (type_decl), - DECL_NAME (type_decl), - typename_type, tf_error); - if (type_decl != error_mark_node) - type_decl = TYPE_NAME (type_decl); - } - } + type_decl = strip_using_decl (type_decl); if (TREE_CODE (type_decl) != TYPE_DECL && (objc_is_id (identifier) || objc_is_class_name (identifier))) @@ -16691,7 +16669,7 @@ static tree cp_parser_late_return_type_opt (cp_parser* parser, cp_cv_quals quals) { cp_token *token; - tree type; + tree type, save_ccp, save_ccr; /* Peek at the next token. */ token = cp_lexer_peek_token (parser->lexer); @@ -16702,8 +16680,8 @@ cp_parser_late_return_type_opt (cp_parser* parser, cp_cv_quals quals) /* Consume the ->. */ cp_lexer_consume_token (parser->lexer); - tree save_ccp = current_class_ptr; - tree save_ccr = current_class_ref; + save_ccp = current_class_ptr; + save_ccr = current_class_ref; if (quals >= 0) { /* DR 1207: 'this' is in scope in the trailing return type. */ @@ -21423,6 +21401,9 @@ cp_parser_functional_cast (cp_parser* parser, tree type) tree cast; bool nonconst_p; + if (!type) + type = error_mark_node; + if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) { maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS); diff --git a/contrib/gcc-4.7/gcc/cp/pt.c b/contrib/gcc-4.7/gcc/cp/pt.c index 783a8ee54c..e1cc59d5e4 100644 --- a/contrib/gcc-4.7/gcc/cp/pt.c +++ b/contrib/gcc-4.7/gcc/cp/pt.c @@ -5521,6 +5521,10 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain) else return NULL_TREE; } + + /* Avoid typedef problems. */ + if (TREE_TYPE (expr) != type) + expr = fold_convert (type, expr); } /* [temp.arg.nontype]/5, bullet 2 @@ -12214,6 +12218,9 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) case TYPE_DECL: return tsubst (t, args, complain, in_decl); + case USING_DECL: + t = DECL_NAME (t); + /* Fall through. */ case IDENTIFIER_NODE: if (IDENTIFIER_TYPENAME_P (t)) { @@ -14706,8 +14713,11 @@ fn_type_unification (tree fn, /* If we're looking for an exact match, check that what we got is indeed an exact match. It might not be if some template - parameters are used in non-deduced contexts. */ - if (strict == DEDUCE_EXACT) + parameters are used in non-deduced contexts. But don't check + for an exact match if we have dependent template arguments; + in that case we're doing partial ordering, and we already know + that we have two candidates that will provide the actual type. */ + if (strict == DEDUCE_EXACT && !any_dependent_template_arguments_p (targs)) { unsigned int i; @@ -18083,6 +18093,10 @@ maybe_instantiate_noexcept (tree fn) { tree fntype, spec, noex, clone; + /* Don't instantiate a noexcept-specification from template context. */ + if (processing_template_decl) + return; + if (DECL_CLONED_FUNCTION_P (fn)) fn = DECL_CLONED_FUNCTION (fn); fntype = TREE_TYPE (fn); @@ -18177,6 +18191,7 @@ instantiate_decl (tree d, int defer_ok, if the variable has a constant value the referring expression can take advantage of that fact. */ if (TREE_CODE (d) == VAR_DECL + || decl_function_context (d) || DECL_DECLARED_CONSTEXPR_P (d)) defer_ok = 0; @@ -19545,7 +19560,7 @@ bool any_type_dependent_elements_p (const_tree list) { for (; list; list = TREE_CHAIN (list)) - if (value_dependent_expression_p (TREE_VALUE (list))) + if (type_dependent_expression_p (TREE_VALUE (list))) return true; return false; diff --git a/contrib/gcc-4.7/gcc/cp/semantics.c b/contrib/gcc-4.7/gcc/cp/semantics.c index 8735c8c799..e71f7d99f2 100644 --- a/contrib/gcc-4.7/gcc/cp/semantics.c +++ b/contrib/gcc-4.7/gcc/cp/semantics.c @@ -2430,7 +2430,8 @@ finish_fname (tree id) tree decl; decl = fname_decl (input_location, C_RID_CODE (id), id); - if (processing_template_decl && current_function_decl) + if (processing_template_decl && current_function_decl + && decl != error_mark_node) decl = DECL_NAME (decl); return decl; } @@ -4976,7 +4977,7 @@ finish_omp_atomic (enum tree_code code, enum tree_code opcode, tree lhs, } stmt = build2 (OMP_ATOMIC, void_type_node, integer_zero_node, stmt); } - add_stmt (stmt); + finish_expr_stmt (stmt); } void @@ -7412,15 +7413,17 @@ cxx_fold_indirect_ref (location_t loc, tree type, tree op0, bool *empty_base) } } } - /* *(foo *)fooarrptreturn> (*fooarrptr)[0] */ + /* *(foo *)fooarrptr => (*fooarrptr)[0] */ else if (TREE_CODE (TREE_TYPE (subtype)) == ARRAY_TYPE && (same_type_ignoring_top_level_qualifiers_p (type, TREE_TYPE (TREE_TYPE (subtype))))) { tree type_domain; tree min_val = size_zero_node; - sub = cxx_fold_indirect_ref (loc, TREE_TYPE (subtype), sub, NULL); - if (!sub) + tree newsub = cxx_fold_indirect_ref (loc, TREE_TYPE (subtype), sub, NULL); + if (newsub) + sub = newsub; + else sub = build1_loc (loc, INDIRECT_REF, TREE_TYPE (subtype), sub); type_domain = TYPE_DOMAIN (TREE_TYPE (sub)); if (type_domain && TYPE_MIN_VALUE (type_domain)) @@ -7457,11 +7460,6 @@ cxx_eval_indirect_ref (const constexpr_call *call, tree t, { tree sub = op0; STRIP_NOPS (sub); - if (TREE_CODE (sub) == POINTER_PLUS_EXPR) - { - sub = TREE_OPERAND (sub, 0); - STRIP_NOPS (sub); - } if (TREE_CODE (sub) == ADDR_EXPR) { /* We couldn't fold to a constant value. Make sure it's not @@ -8596,6 +8594,12 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags) } return false; + case OMP_ATOMIC: + case OMP_ATOMIC_READ: + case OMP_ATOMIC_CAPTURE_OLD: + case OMP_ATOMIC_CAPTURE_NEW: + return false; + default: sorry ("unexpected AST of kind %s", tree_code_name[TREE_CODE (t)]); gcc_unreachable(); @@ -8959,13 +8963,12 @@ void insert_capture_proxy (tree var) { cp_binding_level *b; - int skip; tree stmt_list; /* Put the capture proxy in the extra body block so that it won't clash with a later local variable. */ b = current_binding_level; - for (skip = 0; ; ++skip) + for (;;) { cp_binding_level *n = b->level_chain; if (n->kind == sk_function_parms) @@ -8976,8 +8979,7 @@ insert_capture_proxy (tree var) /* And put a DECL_EXPR in the STATEMENT_LIST for the same block. */ var = build_stmt (DECL_SOURCE_LOCATION (var), DECL_EXPR, var); - stmt_list = VEC_index (tree, stmt_list_stack, - VEC_length (tree, stmt_list_stack) - 1 - skip); + stmt_list = VEC_index (tree, stmt_list_stack, 1); gcc_assert (stmt_list); append_to_statement_list_force (var, &stmt_list); } diff --git a/contrib/gcc-4.7/gcc/cp/tree.c b/contrib/gcc-4.7/gcc/cp/tree.c index f5a43853b8..4a182e992f 100644 --- a/contrib/gcc-4.7/gcc/cp/tree.c +++ b/contrib/gcc-4.7/gcc/cp/tree.c @@ -816,10 +816,12 @@ build_cplus_array_type (tree elt_type, tree index_type) if (TYPE_MAIN_VARIANT (t) != m) { - if (COMPLETE_TYPE_P (t) && !COMPLETE_TYPE_P (m)) + if (COMPLETE_TYPE_P (TREE_TYPE (t)) && !COMPLETE_TYPE_P (m)) { /* m was built before the element type was complete, so we - also need to copy the layout info from t. */ + also need to copy the layout info from t. We might + end up doing this multiple times if t is an array of + unknown bound. */ tree size = TYPE_SIZE (t); tree size_unit = TYPE_SIZE_UNIT (t); unsigned int align = TYPE_ALIGN (t); diff --git a/contrib/gcc-4.7/gcc/cp/typeck.c b/contrib/gcc-4.7/gcc/cp/typeck.c index c404c81c5e..688946ab7c 100644 --- a/contrib/gcc-4.7/gcc/cp/typeck.c +++ b/contrib/gcc-4.7/gcc/cp/typeck.c @@ -7246,7 +7246,7 @@ build_ptrmemfunc (tree type, tree pfn, int force, bool c_cast_p, /* Handle null pointer to member function conversions. */ if (null_ptr_cst_p (pfn)) { - pfn = build_c_cast (input_location, type, nullptr_node); + pfn = build_c_cast (input_location, type, pfn); return build_ptrmemfunc1 (to_type, integer_zero_node, pfn); @@ -7929,7 +7929,8 @@ check_return_expr (tree retval, bool *no_warning) && TREE_CODE (retval) == VAR_DECL && DECL_CONTEXT (retval) == current_function_decl && ! TREE_STATIC (retval) - && ! DECL_ANON_UNION_VAR_P (retval) + /* And not a lambda or anonymous union proxy. */ + && !DECL_HAS_VALUE_EXPR_P (retval) && (DECL_ALIGN (retval) >= DECL_ALIGN (DECL_RESULT (current_function_decl))) /* The cv-unqualified type of the returned value must be the @@ -7978,7 +7979,8 @@ check_return_expr (tree retval, bool *no_warning) Note that these conditions are similar to, but not as strict as, the conditions for the named return value optimization. */ if ((cxx_dialect != cxx98) - && (TREE_CODE (retval) == VAR_DECL + && ((TREE_CODE (retval) == VAR_DECL + && !DECL_HAS_VALUE_EXPR_P (retval)) || TREE_CODE (retval) == PARM_DECL) && DECL_CONTEXT (retval) == current_function_decl && !TREE_STATIC (retval) diff --git a/contrib/gcc-4.7/gcc/doc/cpp.1 b/contrib/gcc-4.7/gcc/doc/cpp.1 index 5a06f94240..f81f77908e 100644 --- a/contrib/gcc-4.7/gcc/doc/cpp.1 +++ b/contrib/gcc-4.7/gcc/doc/cpp.1 @@ -132,7 +132,7 @@ .\" ======================================================================== .\" .IX Title "CPP 1" -.TH CPP 1 "2013-04-11" "gcc-4.7.3" "GNU" +.TH CPP 1 "2014-06-12" "gcc-4.7.4" "GNU" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/contrib/gcc-4.7/gcc/doc/extend.texi b/contrib/gcc-4.7/gcc/doc/extend.texi index 0887946a19..724d486275 100644 --- a/contrib/gcc-4.7/gcc/doc/extend.texi +++ b/contrib/gcc-4.7/gcc/doc/extend.texi @@ -375,6 +375,8 @@ goto *(&&foo + array[i]); This is more friendly to code living in shared libraries, as it reduces the number of dynamic relocations that are needed, and by consequence, allows the data to be read-only. +This alternative with label differences is not supported for the AVR target, +please use the first approach for AVR programs. The @code{&&foo} expressions for the same label might have different values if the containing function is inlined or cloned. If a program diff --git a/contrib/gcc-4.7/gcc/doc/g++.1 b/contrib/gcc-4.7/gcc/doc/g++.1 index e3ea0e6922..e387a88de3 100644 --- a/contrib/gcc-4.7/gcc/doc/g++.1 +++ b/contrib/gcc-4.7/gcc/doc/g++.1 @@ -132,7 +132,7 @@ .\" ======================================================================== .\" .IX Title "GCC 1" -.TH GCC 1 "2013-04-11" "gcc-4.7.3" "GNU" +.TH GCC 1 "2014-06-12" "gcc-4.7.4" "GNU" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -1432,8 +1432,7 @@ Define an argument called \fIkey\fR with a value of \fIvalue\fR for the plugin called \fIname\fR. .IP "\fB\-fdump\-ada\-spec\fR[\fB\-slim\fR]" 4 .IX Item "-fdump-ada-spec[-slim]" -For C and \*(C+ source and include files, generate corresponding Ada -specs. +For C and \*(C+ source and include files, generate corresponding Ada specs. .IP "\fB\-fdump\-go\-spec=\fR\fIfile\fR" 4 .IX Item "-fdump-go-spec=file" For input files in any language, generate corresponding Go @@ -9901,11 +9900,30 @@ order. That is, a byte order of the form \fB32107654\fR. Note: this option should only be used if you require compatibility with code for big-endian \s-1ARM\s0 processors generated by versions of the compiler prior to 2.8. This option is now deprecated. -.IP "\fB\-mcpu=\fR\fIname\fR" 4 -.IX Item "-mcpu=name" -This specifies the name of the target \s-1ARM\s0 processor. \s-1GCC\s0 uses this name -to determine what kind of instructions it can emit when generating -assembly code. Permissible names are: \fBarm2\fR, \fBarm250\fR, +.IP "\fB\-march=\fR\fIname\fR" 4 +.IX Item "-march=name" +This specifies the name of the target \s-1ARM\s0 architecture. \s-1GCC\s0 uses this +name to determine what kind of instructions it can emit when generating +assembly code. This option can be used in conjunction with or instead +of the \fB\-mcpu=\fR option. Permissible names are: \fBarmv2\fR, +\&\fBarmv2a\fR, \fBarmv3\fR, \fBarmv3m\fR, \fBarmv4\fR, \fBarmv4t\fR, +\&\fBarmv5\fR, \fBarmv5t\fR, \fBarmv5e\fR, \fBarmv5te\fR, +\&\fBarmv6\fR, \fBarmv6j\fR, +\&\fBarmv6t2\fR, \fBarmv6z\fR, \fBarmv6zk\fR, \fBarmv6\-m\fR, +\&\fBarmv7\fR, \fBarmv7\-a\fR, \fBarmv7\-r\fR, \fBarmv7\-m\fR, \fBarmv7e\-m\fR, +\&\fBiwmmxt\fR, \fBiwmmxt2\fR, \fBep9312\fR. +.Sp +\&\fB\-march=native\fR causes the compiler to auto-detect the architecture +of the build computer. At present, this feature is only supported on +Linux, and not all architectures are recognized. If the auto-detect is +unsuccessful the option has no effect. +.IP "\fB\-mtune=\fR\fIname\fR" 4 +.IX Item "-mtune=name" +This option specifies the name of the target \s-1ARM\s0 processor for +which \s-1GCC\s0 should tune the performance of the code. +For some \s-1ARM\s0 implementations better performance can be obtained by using +this option. +Permissible names are: \fBarm2\fR, \fBarm250\fR, \&\fBarm3\fR, \fBarm6\fR, \fBarm60\fR, \fBarm600\fR, \fBarm610\fR, \&\fBarm620\fR, \fBarm7\fR, \fBarm7m\fR, \fBarm7d\fR, \fBarm7dm\fR, \&\fBarm7di\fR, \fBarm7dmi\fR, \fBarm70\fR, \fBarm700\fR, @@ -9931,25 +9949,6 @@ assembly code. Permissible names are: \fBarm2\fR, \fBarm250\fR, \&\fBfa526\fR, \fBfa626\fR, \&\fBfa606te\fR, \fBfa626te\fR, \fBfmp626\fR, \fBfa726te\fR. .Sp -\&\fB\-mcpu=generic\-\fR\fIarch\fR is also permissible, and is -equivalent to \fB\-march=\fR\fIarch\fR \fB\-mtune=generic\-\fR\fIarch\fR. -See \fB\-mtune\fR for more information. -.Sp -\&\fB\-mcpu=native\fR causes the compiler to auto-detect the \s-1CPU\s0 -of the build computer. At present, this feature is only supported on -Linux, and not all architectures are recognized. If the auto-detect is -unsuccessful the option has no effect. -.IP "\fB\-mtune=\fR\fIname\fR" 4 -.IX Item "-mtune=name" -This option is very similar to the \fB\-mcpu=\fR option, except that -instead of specifying the actual target processor type, and hence -restricting which instructions can be used, it specifies that \s-1GCC\s0 should -tune the performance of the code as if the target were of the type -specified in this option, but still choosing the instructions that it -will generate based on the \s-1CPU\s0 specified by a \fB\-mcpu=\fR option. -For some \s-1ARM\s0 implementations better performance can be obtained by using -this option. -.Sp \&\fB\-mtune=generic\-\fR\fIarch\fR specifies that \s-1GCC\s0 should tune the performance for a blend of processors within architecture \fIarch\fR. The aim is to generate code that run well on the current most popular @@ -9961,20 +9960,23 @@ this option may change in future \s-1GCC\s0 versions as \s-1CPU\s0 models come a of the build computer. At present, this feature is only supported on Linux, and not all architectures are recognized. If the auto-detect is unsuccessful the option has no effect. -.IP "\fB\-march=\fR\fIname\fR" 4 -.IX Item "-march=name" -This specifies the name of the target \s-1ARM\s0 architecture. \s-1GCC\s0 uses this -name to determine what kind of instructions it can emit when generating -assembly code. This option can be used in conjunction with or instead -of the \fB\-mcpu=\fR option. Permissible names are: \fBarmv2\fR, -\&\fBarmv2a\fR, \fBarmv3\fR, \fBarmv3m\fR, \fBarmv4\fR, \fBarmv4t\fR, -\&\fBarmv5\fR, \fBarmv5t\fR, \fBarmv5e\fR, \fBarmv5te\fR, -\&\fBarmv6\fR, \fBarmv6j\fR, -\&\fBarmv6t2\fR, \fBarmv6z\fR, \fBarmv6zk\fR, \fBarmv6\-m\fR, -\&\fBarmv7\fR, \fBarmv7\-a\fR, \fBarmv7\-r\fR, \fBarmv7\-m\fR, -\&\fBiwmmxt\fR, \fBiwmmxt2\fR, \fBep9312\fR. +.IP "\fB\-mcpu=\fR\fIname\fR" 4 +.IX Item "-mcpu=name" +This specifies the name of the target \s-1ARM\s0 processor. \s-1GCC\s0 uses this name +to derive the name of the target \s-1ARM\s0 architecture (as if specified +by \fB\-march\fR) and the \s-1ARM\s0 processor type for which to tune for +performance (as if specified by \fB\-mtune\fR). Where this option +is used in conjunction with \fB\-march\fR or \fB\-mtune\fR, +those options take precedence over the appropriate part of this option. .Sp -\&\fB\-march=native\fR causes the compiler to auto-detect the architecture +Permissible names for this option are the same as those for +\&\fB\-mtune\fR. +.Sp +\&\fB\-mcpu=generic\-\fR\fIarch\fR is also permissible, and is +equivalent to \fB\-march=\fR\fIarch\fR \fB\-mtune=generic\-\fR\fIarch\fR. +See \fB\-mtune\fR for more information. +.Sp +\&\fB\-mcpu=native\fR causes the compiler to auto-detect the \s-1CPU\s0 of the build computer. At present, this feature is only supported on Linux, and not all architectures are recognized. If the auto-detect is unsuccessful the option has no effect. @@ -17239,8 +17241,9 @@ These \fB\-m\fR options are supported on the \s-1SPARC:\s0 .IX Item "-mapp-regs" .PD Specify \fB\-mapp\-regs\fR to generate output using the global registers -2 through 4, which the \s-1SPARC\s0 \s-1SVR4\s0 \s-1ABI\s0 reserves for applications. This -is the default. +2 through 4, which the \s-1SPARC\s0 \s-1SVR4\s0 \s-1ABI\s0 reserves for applications. Like the +global register 1, each global register 2 through 4 is then treated as an +allocable register that is clobbered by function calls. This is the default. .Sp To be fully \s-1SVR4\s0 \s-1ABI\s0 compliant at the cost of some performance loss, specify \fB\-mno\-app\-regs\fR. You should compile libraries and system diff --git a/contrib/gcc-4.7/gcc/doc/gcc.1 b/contrib/gcc-4.7/gcc/doc/gcc.1 index e3ea0e6922..e387a88de3 100644 --- a/contrib/gcc-4.7/gcc/doc/gcc.1 +++ b/contrib/gcc-4.7/gcc/doc/gcc.1 @@ -132,7 +132,7 @@ .\" ======================================================================== .\" .IX Title "GCC 1" -.TH GCC 1 "2013-04-11" "gcc-4.7.3" "GNU" +.TH GCC 1 "2014-06-12" "gcc-4.7.4" "GNU" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -1432,8 +1432,7 @@ Define an argument called \fIkey\fR with a value of \fIvalue\fR for the plugin called \fIname\fR. .IP "\fB\-fdump\-ada\-spec\fR[\fB\-slim\fR]" 4 .IX Item "-fdump-ada-spec[-slim]" -For C and \*(C+ source and include files, generate corresponding Ada -specs. +For C and \*(C+ source and include files, generate corresponding Ada specs. .IP "\fB\-fdump\-go\-spec=\fR\fIfile\fR" 4 .IX Item "-fdump-go-spec=file" For input files in any language, generate corresponding Go @@ -9901,11 +9900,30 @@ order. That is, a byte order of the form \fB32107654\fR. Note: this option should only be used if you require compatibility with code for big-endian \s-1ARM\s0 processors generated by versions of the compiler prior to 2.8. This option is now deprecated. -.IP "\fB\-mcpu=\fR\fIname\fR" 4 -.IX Item "-mcpu=name" -This specifies the name of the target \s-1ARM\s0 processor. \s-1GCC\s0 uses this name -to determine what kind of instructions it can emit when generating -assembly code. Permissible names are: \fBarm2\fR, \fBarm250\fR, +.IP "\fB\-march=\fR\fIname\fR" 4 +.IX Item "-march=name" +This specifies the name of the target \s-1ARM\s0 architecture. \s-1GCC\s0 uses this +name to determine what kind of instructions it can emit when generating +assembly code. This option can be used in conjunction with or instead +of the \fB\-mcpu=\fR option. Permissible names are: \fBarmv2\fR, +\&\fBarmv2a\fR, \fBarmv3\fR, \fBarmv3m\fR, \fBarmv4\fR, \fBarmv4t\fR, +\&\fBarmv5\fR, \fBarmv5t\fR, \fBarmv5e\fR, \fBarmv5te\fR, +\&\fBarmv6\fR, \fBarmv6j\fR, +\&\fBarmv6t2\fR, \fBarmv6z\fR, \fBarmv6zk\fR, \fBarmv6\-m\fR, +\&\fBarmv7\fR, \fBarmv7\-a\fR, \fBarmv7\-r\fR, \fBarmv7\-m\fR, \fBarmv7e\-m\fR, +\&\fBiwmmxt\fR, \fBiwmmxt2\fR, \fBep9312\fR. +.Sp +\&\fB\-march=native\fR causes the compiler to auto-detect the architecture +of the build computer. At present, this feature is only supported on +Linux, and not all architectures are recognized. If the auto-detect is +unsuccessful the option has no effect. +.IP "\fB\-mtune=\fR\fIname\fR" 4 +.IX Item "-mtune=name" +This option specifies the name of the target \s-1ARM\s0 processor for +which \s-1GCC\s0 should tune the performance of the code. +For some \s-1ARM\s0 implementations better performance can be obtained by using +this option. +Permissible names are: \fBarm2\fR, \fBarm250\fR, \&\fBarm3\fR, \fBarm6\fR, \fBarm60\fR, \fBarm600\fR, \fBarm610\fR, \&\fBarm620\fR, \fBarm7\fR, \fBarm7m\fR, \fBarm7d\fR, \fBarm7dm\fR, \&\fBarm7di\fR, \fBarm7dmi\fR, \fBarm70\fR, \fBarm700\fR, @@ -9931,25 +9949,6 @@ assembly code. Permissible names are: \fBarm2\fR, \fBarm250\fR, \&\fBfa526\fR, \fBfa626\fR, \&\fBfa606te\fR, \fBfa626te\fR, \fBfmp626\fR, \fBfa726te\fR. .Sp -\&\fB\-mcpu=generic\-\fR\fIarch\fR is also permissible, and is -equivalent to \fB\-march=\fR\fIarch\fR \fB\-mtune=generic\-\fR\fIarch\fR. -See \fB\-mtune\fR for more information. -.Sp -\&\fB\-mcpu=native\fR causes the compiler to auto-detect the \s-1CPU\s0 -of the build computer. At present, this feature is only supported on -Linux, and not all architectures are recognized. If the auto-detect is -unsuccessful the option has no effect. -.IP "\fB\-mtune=\fR\fIname\fR" 4 -.IX Item "-mtune=name" -This option is very similar to the \fB\-mcpu=\fR option, except that -instead of specifying the actual target processor type, and hence -restricting which instructions can be used, it specifies that \s-1GCC\s0 should -tune the performance of the code as if the target were of the type -specified in this option, but still choosing the instructions that it -will generate based on the \s-1CPU\s0 specified by a \fB\-mcpu=\fR option. -For some \s-1ARM\s0 implementations better performance can be obtained by using -this option. -.Sp \&\fB\-mtune=generic\-\fR\fIarch\fR specifies that \s-1GCC\s0 should tune the performance for a blend of processors within architecture \fIarch\fR. The aim is to generate code that run well on the current most popular @@ -9961,20 +9960,23 @@ this option may change in future \s-1GCC\s0 versions as \s-1CPU\s0 models come a of the build computer. At present, this feature is only supported on Linux, and not all architectures are recognized. If the auto-detect is unsuccessful the option has no effect. -.IP "\fB\-march=\fR\fIname\fR" 4 -.IX Item "-march=name" -This specifies the name of the target \s-1ARM\s0 architecture. \s-1GCC\s0 uses this -name to determine what kind of instructions it can emit when generating -assembly code. This option can be used in conjunction with or instead -of the \fB\-mcpu=\fR option. Permissible names are: \fBarmv2\fR, -\&\fBarmv2a\fR, \fBarmv3\fR, \fBarmv3m\fR, \fBarmv4\fR, \fBarmv4t\fR, -\&\fBarmv5\fR, \fBarmv5t\fR, \fBarmv5e\fR, \fBarmv5te\fR, -\&\fBarmv6\fR, \fBarmv6j\fR, -\&\fBarmv6t2\fR, \fBarmv6z\fR, \fBarmv6zk\fR, \fBarmv6\-m\fR, -\&\fBarmv7\fR, \fBarmv7\-a\fR, \fBarmv7\-r\fR, \fBarmv7\-m\fR, -\&\fBiwmmxt\fR, \fBiwmmxt2\fR, \fBep9312\fR. +.IP "\fB\-mcpu=\fR\fIname\fR" 4 +.IX Item "-mcpu=name" +This specifies the name of the target \s-1ARM\s0 processor. \s-1GCC\s0 uses this name +to derive the name of the target \s-1ARM\s0 architecture (as if specified +by \fB\-march\fR) and the \s-1ARM\s0 processor type for which to tune for +performance (as if specified by \fB\-mtune\fR). Where this option +is used in conjunction with \fB\-march\fR or \fB\-mtune\fR, +those options take precedence over the appropriate part of this option. .Sp -\&\fB\-march=native\fR causes the compiler to auto-detect the architecture +Permissible names for this option are the same as those for +\&\fB\-mtune\fR. +.Sp +\&\fB\-mcpu=generic\-\fR\fIarch\fR is also permissible, and is +equivalent to \fB\-march=\fR\fIarch\fR \fB\-mtune=generic\-\fR\fIarch\fR. +See \fB\-mtune\fR for more information. +.Sp +\&\fB\-mcpu=native\fR causes the compiler to auto-detect the \s-1CPU\s0 of the build computer. At present, this feature is only supported on Linux, and not all architectures are recognized. If the auto-detect is unsuccessful the option has no effect. @@ -17239,8 +17241,9 @@ These \fB\-m\fR options are supported on the \s-1SPARC:\s0 .IX Item "-mapp-regs" .PD Specify \fB\-mapp\-regs\fR to generate output using the global registers -2 through 4, which the \s-1SPARC\s0 \s-1SVR4\s0 \s-1ABI\s0 reserves for applications. This -is the default. +2 through 4, which the \s-1SPARC\s0 \s-1SVR4\s0 \s-1ABI\s0 reserves for applications. Like the +global register 1, each global register 2 through 4 is then treated as an +allocable register that is clobbered by function calls. This is the default. .Sp To be fully \s-1SVR4\s0 \s-1ABI\s0 compliant at the cost of some performance loss, specify \fB\-mno\-app\-regs\fR. You should compile libraries and system diff --git a/contrib/gcc-4.7/gcc/doc/gcov.1 b/contrib/gcc-4.7/gcc/doc/gcov.1 index b14b839d6c..f17cb875f3 100644 --- a/contrib/gcc-4.7/gcc/doc/gcov.1 +++ b/contrib/gcc-4.7/gcc/doc/gcov.1 @@ -132,7 +132,7 @@ .\" ======================================================================== .\" .IX Title "GCOV 1" -.TH GCOV 1 "2013-04-11" "gcc-4.7.3" "GNU" +.TH GCOV 1 "2014-06-12" "gcc-4.7.4" "GNU" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/contrib/gcc-4.7/gcc/doc/implement-cxx.texi b/contrib/gcc-4.7/gcc/doc/implement-cxx.texi index ac9a393da2..3d4752e5ff 100644 --- a/contrib/gcc-4.7/gcc/doc/implement-cxx.texi +++ b/contrib/gcc-4.7/gcc/doc/implement-cxx.texi @@ -10,8 +10,8 @@ A conforming implementation of ISO C++ is required to document its choice of behavior in each of the areas that are designated ``implementation defined''. The following lists all such areas, -along with the section numbers from the ISO/IEC 14822:1998 and ISO/IEC -14822:2003 standards. Some areas are only implementation-defined in +along with the section numbers from the ISO/IEC 14882:1998 and ISO/IEC +14882:2003 standards. Some areas are only implementation-defined in one version of the standard. Some choices depend on the externally determined ABI for the platform diff --git a/contrib/gcc-4.7/gcc/doc/invoke.texi b/contrib/gcc-4.7/gcc/doc/invoke.texi index f98995238a..625fef25a6 100644 --- a/contrib/gcc-4.7/gcc/doc/invoke.texi +++ b/contrib/gcc-4.7/gcc/doc/invoke.texi @@ -1429,11 +1429,13 @@ Define an argument called @var{key} with a value of @var{value} for the plugin called @var{name}. @item -fdump-ada-spec@r{[}-slim@r{]} -For C and C++ source and include files, generate corresponding Ada -specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn, +@opindex fdump-ada-spec +For C and C++ source and include files, generate corresponding Ada specs. +@xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn, GNAT User's Guide}, which provides detailed documentation on this feature. @item -fdump-go-spec=@var{file} +@opindex fdump-go-spec For input files in any language, generate corresponding Go declarations in @var{file}. This generates Go @code{const}, @code{type}, @code{var}, and @code{func} declarations which may be a @@ -10646,11 +10648,31 @@ option should only be used if you require compatibility with code for big-endian ARM processors generated by versions of the compiler prior to 2.8. This option is now deprecated. -@item -mcpu=@var{name} -@opindex mcpu -This specifies the name of the target ARM processor. GCC uses this name -to determine what kind of instructions it can emit when generating -assembly code. Permissible names are: @samp{arm2}, @samp{arm250}, +@item -march=@var{name} +@opindex march +This specifies the name of the target ARM architecture. GCC uses this +name to determine what kind of instructions it can emit when generating +assembly code. This option can be used in conjunction with or instead +of the @option{-mcpu=} option. Permissible names are: @samp{armv2}, +@samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t}, +@samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te}, +@samp{armv6}, @samp{armv6j}, +@samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m}, +@samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m}, @samp{armv7e-m}, +@samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}. + +@option{-march=native} causes the compiler to auto-detect the architecture +of the build computer. At present, this feature is only supported on +Linux, and not all architectures are recognized. If the auto-detect is +unsuccessful the option has no effect. + +@item -mtune=@var{name} +@opindex mtune +This option specifies the name of the target ARM processor for +which GCC should tune the performance of the code. +For some ARM implementations better performance can be obtained by using +this option. +Permissible names are: @samp{arm2}, @samp{arm250}, @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610}, @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm}, @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700}, @@ -10676,27 +10698,6 @@ assembly code. Permissible names are: @samp{arm2}, @samp{arm250}, @samp{fa526}, @samp{fa626}, @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}. - -@option{-mcpu=generic-@var{arch}} is also permissible, and is -equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}. -See @option{-mtune} for more information. - -@option{-mcpu=native} causes the compiler to auto-detect the CPU -of the build computer. At present, this feature is only supported on -Linux, and not all architectures are recognized. If the auto-detect is -unsuccessful the option has no effect. - -@item -mtune=@var{name} -@opindex mtune -This option is very similar to the @option{-mcpu=} option, except that -instead of specifying the actual target processor type, and hence -restricting which instructions can be used, it specifies that GCC should -tune the performance of the code as if the target were of the type -specified in this option, but still choosing the instructions that it -will generate based on the CPU specified by a @option{-mcpu=} option. -For some ARM implementations better performance can be obtained by using -this option. - @option{-mtune=generic-@var{arch}} specifies that GCC should tune the performance for a blend of processors within architecture @var{arch}. The aim is to generate code that run well on the current most popular @@ -10709,20 +10710,23 @@ of the build computer. At present, this feature is only supported on Linux, and not all architectures are recognized. If the auto-detect is unsuccessful the option has no effect. -@item -march=@var{name} -@opindex march -This specifies the name of the target ARM architecture. GCC uses this -name to determine what kind of instructions it can emit when generating -assembly code. This option can be used in conjunction with or instead -of the @option{-mcpu=} option. Permissible names are: @samp{armv2}, -@samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t}, -@samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te}, -@samp{armv6}, @samp{armv6j}, -@samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m}, -@samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m}, -@samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}. +@item -mcpu=@var{name} +@opindex mcpu +This specifies the name of the target ARM processor. GCC uses this name +to derive the name of the target ARM architecture (as if specified +by @option{-march}) and the ARM processor type for which to tune for +performance (as if specified by @option{-mtune}). Where this option +is used in conjunction with @option{-march} or @option{-mtune}, +those options take precedence over the appropriate part of this option. -@option{-march=native} causes the compiler to auto-detect the architecture +Permissible names for this option are the same as those for +@option{-mtune}. + +@option{-mcpu=generic-@var{arch}} is also permissible, and is +equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}. +See @option{-mtune} for more information. + +@option{-mcpu=native} causes the compiler to auto-detect the CPU of the build computer. At present, this feature is only supported on Linux, and not all architectures are recognized. If the auto-detect is unsuccessful the option has no effect. @@ -18305,8 +18309,9 @@ These @samp{-m} options are supported on the SPARC: @opindex mno-app-regs @opindex mapp-regs Specify @option{-mapp-regs} to generate output using the global registers -2 through 4, which the SPARC SVR4 ABI reserves for applications. This -is the default. +2 through 4, which the SPARC SVR4 ABI reserves for applications. Like the +global register 1, each global register 2 through 4 is then treated as an +allocable register that is clobbered by function calls. This is the default. To be fully SVR4 ABI compliant at the cost of some performance loss, specify @option{-mno-app-regs}. You should compile libraries and system diff --git a/contrib/gcc-4.7/gcc/doc/tm.texi b/contrib/gcc-4.7/gcc/doc/tm.texi index a76851a664..da9e839730 100644 --- a/contrib/gcc-4.7/gcc/doc/tm.texi +++ b/contrib/gcc-4.7/gcc/doc/tm.texi @@ -700,6 +700,14 @@ should use @code{TARGET_HANDLE_C_OPTION} instead. Targets may provide a string object type that can be used within and between C, C++ and their respective Objective-C dialects. A string object might, for example, embed encoding and length information. These objects are considered opaque to the compiler and handled as references. An ideal implementation makes the composition of the string object match that of the Objective-C @code{NSString} (@code{NXString} for GNUStep), allowing efficient interworking between C-only and Objective-C code. If a target implements string objects then this hook should return a reference to such an object constructed from the normal `C' string representation provided in @var{string}. At present, the hook is used by Objective-C only, to obtain a common-format string object when the target provides one. @end deftypefn +@deftypefn {C Target Hook} void TARGET_OBJC_DECLARE_UNRESOLVED_CLASS_REFERENCE (const char *@var{classname}) +Declare that Objective C class @var{classname} is referenced by the current TU. +@end deftypefn + +@deftypefn {C Target Hook} void TARGET_OBJC_DECLARE_CLASS_DEFINITION (const char *@var{classname}) +Declare that Objective C class @var{classname} is defined by the current TU. +@end deftypefn + @deftypefn {C Target Hook} bool TARGET_STRING_OBJECT_REF_TYPE_P (const_tree @var{stringref}) If a target implements string objects then this hook should return @code{true} if @var{stringref} is a valid reference to such an object. @end deftypefn @@ -8258,20 +8266,6 @@ On systems where the assembler can handle quoted names, you can use this macro to provide more human-readable names. @end defmac -@defmac ASM_DECLARE_CLASS_REFERENCE (@var{stream}, @var{name}) -A C statement (sans semicolon) to output to the stdio stream -@var{stream} commands to declare that the label @var{name} is an -Objective-C class reference. This is only needed for targets whose -linkers have special support for NeXT-style runtimes. -@end defmac - -@defmac ASM_DECLARE_UNRESOLVED_REFERENCE (@var{stream}, @var{name}) -A C statement (sans semicolon) to output to the stdio stream -@var{stream} commands to declare that the label @var{name} is an -unresolved Objective-C class reference. This is only needed for targets -whose linkers have special support for NeXT-style runtimes. -@end defmac - @node Initialization @subsection How Initialization Functions Are Handled @cindex initialization routines @@ -9495,6 +9489,10 @@ tables, and hence is desirable if it works. True if the @code{.debug_pubtypes} and @code{.debug_pubnames} sections should be emitted. These sections are not used on most platforms, and in particular GDB does not use them. @end deftypevr +@deftypevr {Target Hook} bool TARGET_FORCE_AT_COMP_DIR +True if the @code{DW_AT_comp_dir} attribute should be emitted for each compilation unit. This attribute is required for the darwin linker to emit debug information. +@end deftypevr + @deftypevr {Target Hook} bool TARGET_DELAY_SCHED2 True if sched2 is not to be run at its normal place. This usually means it will be run as part of machine-specific reorg. @end deftypevr diff --git a/contrib/gcc-4.7/gcc/doc/tm.texi.in b/contrib/gcc-4.7/gcc/doc/tm.texi.in index 0e4856f73c..28a6c36cb3 100644 --- a/contrib/gcc-4.7/gcc/doc/tm.texi.in +++ b/contrib/gcc-4.7/gcc/doc/tm.texi.in @@ -696,6 +696,10 @@ should use @code{TARGET_HANDLE_C_OPTION} instead. @hook TARGET_OBJC_CONSTRUCT_STRING_OBJECT +@hook TARGET_OBJC_DECLARE_UNRESOLVED_CLASS_REFERENCE + +@hook TARGET_OBJC_DECLARE_CLASS_DEFINITION + @hook TARGET_STRING_OBJECT_REF_TYPE_P @hook TARGET_CHECK_STRING_OBJECT_FORMAT_ARG @@ -8157,20 +8161,6 @@ On systems where the assembler can handle quoted names, you can use this macro to provide more human-readable names. @end defmac -@defmac ASM_DECLARE_CLASS_REFERENCE (@var{stream}, @var{name}) -A C statement (sans semicolon) to output to the stdio stream -@var{stream} commands to declare that the label @var{name} is an -Objective-C class reference. This is only needed for targets whose -linkers have special support for NeXT-style runtimes. -@end defmac - -@defmac ASM_DECLARE_UNRESOLVED_REFERENCE (@var{stream}, @var{name}) -A C statement (sans semicolon) to output to the stdio stream -@var{stream} commands to declare that the label @var{name} is an -unresolved Objective-C class reference. This is only needed for targets -whose linkers have special support for NeXT-style runtimes. -@end defmac - @node Initialization @subsection How Initialization Functions Are Handled @cindex initialization routines @@ -9388,6 +9378,8 @@ tables, and hence is desirable if it works. @hook TARGET_WANT_DEBUG_PUB_SECTIONS +@hook TARGET_FORCE_AT_COMP_DIR + @hook TARGET_DELAY_SCHED2 @hook TARGET_DELAY_VARTRACK diff --git a/contrib/gcc-4.7/gcc/dwarf2out.c b/contrib/gcc-4.7/gcc/dwarf2out.c index 4ac66f90d5..b99e45bc36 100644 --- a/contrib/gcc-4.7/gcc/dwarf2out.c +++ b/contrib/gcc-4.7/gcc/dwarf2out.c @@ -22538,7 +22538,7 @@ dwarf2out_finish (const char *filename) /* Add the name for the main input file now. We delayed this from dwarf2out_init to avoid complications with PCH. */ add_name_attribute (comp_unit_die (), remap_debug_filename (filename)); - if (!IS_ABSOLUTE_PATH (filename)) + if (!IS_ABSOLUTE_PATH (filename) || targetm.force_at_comp_dir) add_comp_dir_attribute (comp_unit_die ()); else if (get_AT (comp_unit_die (), DW_AT_comp_dir) == NULL) { diff --git a/contrib/gcc-4.7/gcc/fold-const.c b/contrib/gcc-4.7/gcc/fold-const.c index 1f864a78ce..c3c8f7e0ac 100644 --- a/contrib/gcc-4.7/gcc/fold-const.c +++ b/contrib/gcc-4.7/gcc/fold-const.c @@ -486,11 +486,24 @@ negate_expr_p (tree t) and actually traps on some architectures. But if overflow is undefined, we can negate, because - (INT_MIN / 1) is an overflow. */ - if (INTEGRAL_TYPE_P (TREE_TYPE (t)) - && !TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (t))) - break; - return negate_expr_p (TREE_OPERAND (t, 1)) - || negate_expr_p (TREE_OPERAND (t, 0)); + if (INTEGRAL_TYPE_P (TREE_TYPE (t))) + { + if (!TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (t))) + break; + /* If overflow is undefined then we have to be careful because + we ask whether it's ok to associate the negate with the + division which is not ok for example for + -((a - b) / c) where (-(a - b)) / c may invoke undefined + overflow because of negating INT_MIN. So do not use + negate_expr_p here but open-code the two important cases. */ + if (TREE_CODE (TREE_OPERAND (t, 0)) == NEGATE_EXPR + || (TREE_CODE (TREE_OPERAND (t, 0)) == INTEGER_CST + && may_negate_without_overflow_p (TREE_OPERAND (t, 0)))) + return true; + } + else if (negate_expr_p (TREE_OPERAND (t, 0))) + return true; + return negate_expr_p (TREE_OPERAND (t, 1)); case NOP_EXPR: /* Negate -((double)float) as (double)(-float). */ @@ -670,16 +683,20 @@ fold_negate_expr (location_t loc, tree t) return fold_build2_loc (loc, TREE_CODE (t), type, TREE_OPERAND (t, 0), negate_expr (tem)); } + /* If overflow is undefined then we have to be careful because + we ask whether it's ok to associate the negate with the + division which is not ok for example for + -((a - b) / c) where (-(a - b)) / c may invoke undefined + overflow because of negating INT_MIN. So do not use + negate_expr_p here but open-code the two important cases. */ tem = TREE_OPERAND (t, 0); - if (negate_expr_p (tem)) - { - if (INTEGRAL_TYPE_P (type) - && (TREE_CODE (tem) != INTEGER_CST - || tree_int_cst_equal (tem, TYPE_MIN_VALUE (type)))) - fold_overflow_warning (warnmsg, WARN_STRICT_OVERFLOW_MISC); - return fold_build2_loc (loc, TREE_CODE (t), type, - negate_expr (tem), TREE_OPERAND (t, 1)); - } + if ((INTEGRAL_TYPE_P (type) + && (TREE_CODE (tem) == NEGATE_EXPR + || (TREE_CODE (tem) == INTEGER_CST + && may_negate_without_overflow_p (tem)))) + || !INTEGRAL_TYPE_P (type)) + return fold_build2_loc (loc, TREE_CODE (t), type, + negate_expr (tem), TREE_OPERAND (t, 1)); } break; @@ -4862,12 +4879,16 @@ fold_range_test (location_t loc, enum tree_code code, tree type, int in0_p, in1_p, in_p; tree low0, low1, low, high0, high1, high; bool strict_overflow_p = false; - tree lhs = make_range (op0, &in0_p, &low0, &high0, &strict_overflow_p); - tree rhs = make_range (op1, &in1_p, &low1, &high1, &strict_overflow_p); - tree tem; + tree tem, lhs, rhs; const char * const warnmsg = G_("assuming signed overflow does not occur " "when simplifying range test"); + if (!INTEGRAL_TYPE_P (type)) + return 0; + + lhs = make_range (op0, &in0_p, &low0, &high0, &strict_overflow_p); + rhs = make_range (op1, &in1_p, &low1, &high1, &strict_overflow_p); + /* If this is an OR operation, invert both sides; we will invert again at the end. */ if (or_op) @@ -13832,14 +13853,29 @@ fold_ternary_loc (location_t loc, enum tree_code code, tree type, && integer_zerop (op2) && (tem = sign_bit_p (TREE_OPERAND (arg0, 0), arg1))) { + /* sign_bit_p looks through both zero and sign extensions, + but for this optimization only sign extensions are + usable. */ + tree tem2 = TREE_OPERAND (arg0, 0); + while (tem != tem2) + { + if (TREE_CODE (tem2) != NOP_EXPR + || TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (tem2, 0)))) + { + tem = NULL_TREE; + break; + } + tem2 = TREE_OPERAND (tem2, 0); + } /* sign_bit_p only checks ARG1 bits within A's precision. If has wider type than A, bits outside of A's precision in need to be checked. If they are all 0, this optimization needs to be done in unsigned A's type, if they are all 1 in signed A's type, otherwise this can't be done. */ - if (TYPE_PRECISION (TREE_TYPE (tem)) - < TYPE_PRECISION (TREE_TYPE (arg1)) + if (tem + && TYPE_PRECISION (TREE_TYPE (tem)) + < TYPE_PRECISION (TREE_TYPE (arg1)) && TYPE_PRECISION (TREE_TYPE (tem)) < TYPE_PRECISION (type)) { diff --git a/contrib/gcc-4.7/gcc/gengtype-lex.c b/contrib/gcc-4.7/gcc/gengtype-lex.c index a8820ead10..39d6357b8e 100644 --- a/contrib/gcc-4.7/gcc/gengtype-lex.c +++ b/contrib/gcc-4.7/gcc/gengtype-lex.c @@ -942,7 +942,7 @@ int yy_flex_debug = 0; #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 1 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" /* -*- indented-text -*- */ /* Process source files and output type information. Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 @@ -964,7 +964,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ #define YY_NO_INPUT 1 -#line 25 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 25 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" #ifdef GENERATOR_FILE #include "bconfig.h" #else @@ -1178,7 +1178,7 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 63 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 63 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" /* Do this on entry to yylex(): */ *yylval = 0; @@ -1275,7 +1275,7 @@ case 1: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 74 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 74 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { BEGIN(in_struct); return TYPEDEF; @@ -1287,7 +1287,7 @@ case 2: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 78 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 78 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { BEGIN(in_struct); return STRUCT; @@ -1299,7 +1299,7 @@ case 3: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 82 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 82 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { BEGIN(in_struct); return UNION; @@ -1311,7 +1311,7 @@ case 4: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 86 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 86 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { BEGIN(in_struct); return EXTERN; @@ -1323,7 +1323,7 @@ case 5: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 90 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 90 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { BEGIN(in_struct); return STATIC; @@ -1335,7 +1335,7 @@ case 6: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 95 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 95 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { BEGIN(in_struct); return DEFVEC_OP; @@ -1347,7 +1347,7 @@ case 7: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 99 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 99 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { BEGIN(in_struct); return DEFVEC_I; @@ -1359,7 +1359,7 @@ case 8: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 103 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 103 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { BEGIN(in_struct); return DEFVEC_ALLOC; @@ -1369,19 +1369,19 @@ YY_RULE_SETUP case 9: YY_RULE_SETUP -#line 111 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 111 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { BEGIN(in_struct_comment); } YY_BREAK case 10: /* rule 10 can match eol */ YY_RULE_SETUP -#line 113 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 113 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { update_lineno (yytext, yyleng); } YY_BREAK case 11: /* rule 11 can match eol */ YY_RULE_SETUP -#line 114 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 114 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { lexer_line.line++; } YY_BREAK case 12: @@ -1390,7 +1390,7 @@ case 12: (yy_c_buf_p) = yy_cp = yy_bp + 5; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 116 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 116 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" /* don't care */ YY_BREAK case 13: @@ -1399,7 +1399,7 @@ case 13: (yy_c_buf_p) = yy_cp = yy_bp + 3; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 117 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 117 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { return GTY_TOKEN; } YY_BREAK case 14: @@ -1408,7 +1408,7 @@ case 14: (yy_c_buf_p) = yy_cp = yy_bp + 3; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 118 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 118 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { return VEC_TOKEN; } YY_BREAK case 15: @@ -1417,7 +1417,7 @@ case 15: (yy_c_buf_p) = yy_cp = yy_bp + 5; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 119 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 119 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { return UNION; } YY_BREAK case 16: @@ -1426,7 +1426,7 @@ case 16: (yy_c_buf_p) = yy_cp = yy_bp + 6; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 120 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 120 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { return STRUCT; } YY_BREAK case 17: @@ -1435,7 +1435,7 @@ case 17: (yy_c_buf_p) = yy_cp = yy_bp + 4; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 121 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 121 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { return ENUM; } YY_BREAK case 18: @@ -1444,7 +1444,7 @@ case 18: (yy_c_buf_p) = yy_cp = yy_bp + 9; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 122 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 122 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { return PTR_ALIAS; } YY_BREAK case 19: @@ -1453,12 +1453,12 @@ case 19: (yy_c_buf_p) = yy_cp = yy_bp + 10; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 123 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 123 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { return NESTED_PTR; } YY_BREAK case 20: YY_RULE_SETUP -#line 124 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 124 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { return NUM; } YY_BREAK case 21: @@ -1467,7 +1467,7 @@ case 21: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 125 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 125 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { *yylval = XDUPVAR (const char, yytext, yyleng, yyleng+1); return PARAM_IS; @@ -1478,11 +1478,11 @@ case 22: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ -#line 131 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 131 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" case 23: /* rule 23 can match eol */ YY_RULE_SETUP -#line 131 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 131 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { size_t len; @@ -1500,7 +1500,7 @@ case 24: (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 143 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 143 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { *yylval = XDUPVAR (const char, yytext, yyleng, yyleng+1); return ID; @@ -1509,7 +1509,7 @@ YY_RULE_SETUP case 25: /* rule 25 can match eol */ YY_RULE_SETUP -#line 148 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 148 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { *yylval = XDUPVAR (const char, yytext+1, yyleng-2, yyleng-1); return STRING; @@ -1519,7 +1519,7 @@ YY_RULE_SETUP case 26: /* rule 26 can match eol */ YY_RULE_SETUP -#line 153 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 153 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { *yylval = XDUPVAR (const char, yytext+1, yyleng-2, yyleng-1); return ARRAY; @@ -1528,7 +1528,7 @@ YY_RULE_SETUP case 27: /* rule 27 can match eol */ YY_RULE_SETUP -#line 157 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 157 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { *yylval = XDUPVAR (const char, yytext+1, yyleng-2, yyleng); return CHAR; @@ -1536,24 +1536,24 @@ YY_RULE_SETUP YY_BREAK case 28: YY_RULE_SETUP -#line 162 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 162 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { return ELLIPSIS; } YY_BREAK case 29: YY_RULE_SETUP -#line 163 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 163 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { return yytext[0]; } YY_BREAK /* ignore pp-directives */ case 30: /* rule 30 can match eol */ YY_RULE_SETUP -#line 166 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 166 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" {lexer_line.line++;} YY_BREAK case 31: YY_RULE_SETUP -#line 168 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 168 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { error_at_line (&lexer_line, "unexpected character `%s'", yytext); } @@ -1561,30 +1561,30 @@ YY_RULE_SETUP case 32: YY_RULE_SETUP -#line 173 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 173 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { BEGIN(in_comment); } YY_BREAK case 33: /* rule 33 can match eol */ YY_RULE_SETUP -#line 174 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 174 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { lexer_line.line++; } YY_BREAK case 34: -#line 176 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 176 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" case 35: /* rule 35 can match eol */ -#line 177 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 177 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" case 36: /* rule 36 can match eol */ YY_RULE_SETUP -#line 177 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 177 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" /* do nothing */ YY_BREAK case 37: /* rule 37 can match eol */ YY_RULE_SETUP -#line 178 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 178 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { update_lineno (yytext, yyleng); } YY_BREAK case 38: @@ -1593,21 +1593,21 @@ case 38: (yy_c_buf_p) = yy_cp = yy_bp + 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 179 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 179 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" /* do nothing */ YY_BREAK case 39: /* rule 39 can match eol */ YY_RULE_SETUP -#line 182 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 182 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { lexer_line.line++; } YY_BREAK case 40: -#line 184 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 184 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" case 41: YY_RULE_SETUP -#line 184 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 184 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" /* do nothing */ YY_BREAK case 42: @@ -1616,25 +1616,25 @@ case 42: (yy_c_buf_p) = yy_cp = yy_bp + 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 185 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 185 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" /* do nothing */ YY_BREAK case 43: YY_RULE_SETUP -#line 187 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 187 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { BEGIN(INITIAL); } YY_BREAK case 44: YY_RULE_SETUP -#line 188 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 188 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { BEGIN(in_struct); } YY_BREAK case 45: -#line 191 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 191 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" case 46: YY_RULE_SETUP -#line 191 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 191 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" { error_at_line (&lexer_line, "unterminated comment or string; unexpected EOF"); @@ -1643,12 +1643,12 @@ YY_RULE_SETUP case 47: /* rule 47 can match eol */ YY_RULE_SETUP -#line 196 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 196 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" /* do nothing */ YY_BREAK case 48: YY_RULE_SETUP -#line 198 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 198 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK #line 1654 "gengtype-lex.c" @@ -2615,7 +2615,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 198 "/space/rguenther/gcc-4.7.3/gcc-4.7.3/gcc/gengtype-lex.l" +#line 198 "/space/rguenther/gcc-4.7.4/gcc-4.7.4/gcc/gengtype-lex.l" diff --git a/contrib/gcc-4.7/gcc/gimple-low.c b/contrib/gcc-4.7/gcc/gimple-low.c index 293d4d7b82..1f74512e7f 100644 --- a/contrib/gcc-4.7/gcc/gimple-low.c +++ b/contrib/gcc-4.7/gcc/gimple-low.c @@ -249,6 +249,7 @@ gimple_check_call_args (gimple stmt, tree fndecl) break; arg = gimple_call_arg (stmt, i); if (p == error_mark_node + || DECL_ARG_TYPE (p) == error_mark_node || arg == error_mark_node || (!types_compatible_p (DECL_ARG_TYPE (p), TREE_TYPE (arg)) && !fold_convertible_p (DECL_ARG_TYPE (p), arg))) diff --git a/contrib/gcc-4.7/gcc/gimple.h b/contrib/gcc-4.7/gcc/gimple.h index 97eec59fcb..4a16820714 100644 --- a/contrib/gcc-4.7/gcc/gimple.h +++ b/contrib/gcc-4.7/gcc/gimple.h @@ -305,6 +305,9 @@ struct GTY(()) gimple_statement_base { /* Nonzero if this statement contains volatile operands. */ unsigned has_volatile_ops : 1; + /* Padding to get subcode to 16 bit alignment. */ + unsigned pad : 1; + /* The SUBCODE field can be used for tuple-specific flags for tuples that do not require subcodes. Note that SUBCODE should be at least as wide as tree codes, as several tuples store tree codes diff --git a/contrib/gcc-4.7/gcc/gimplify.c b/contrib/gcc-4.7/gcc/gimplify.c index 531565e649..abb580f895 100644 --- a/contrib/gcc-4.7/gcc/gimplify.c +++ b/contrib/gcc-4.7/gcc/gimplify.c @@ -1922,6 +1922,9 @@ gimplify_conversion (tree *expr_p) /* Nonlocal VLAs seen in the current function. */ static struct pointer_set_t *nonlocal_vlas; +/* The VAR_DECLs created for nonlocal VLAs for debug info purposes. */ +static tree nonlocal_vla_vars; + /* Gimplify a VAR_DECL or PARM_DECL. Return GS_OK if we expanded a DECL_VALUE_EXPR, and it's worth re-examining things. */ @@ -1968,14 +1971,13 @@ gimplify_var_or_parm_decl (tree *expr_p) ctx = ctx->outer_context; if (!ctx && !pointer_set_insert (nonlocal_vlas, decl)) { - tree copy = copy_node (decl), block; + tree copy = copy_node (decl); lang_hooks.dup_lang_specific_decl (copy); SET_DECL_RTL (copy, 0); TREE_USED (copy) = 1; - block = DECL_INITIAL (current_function_decl); - DECL_CHAIN (copy) = BLOCK_VARS (block); - BLOCK_VARS (block) = copy; + DECL_CHAIN (copy) = nonlocal_vla_vars; + nonlocal_vla_vars = copy; SET_DECL_VALUE_EXPR (copy, unshare_expr (value_expr)); DECL_HAS_VALUE_EXPR_P (copy) = 1; } @@ -8057,6 +8059,21 @@ gimplify_body (tree fndecl, bool do_parms) if (nonlocal_vlas) { + if (nonlocal_vla_vars) + { + /* tree-nested.c may later on call declare_vars (..., true); + which relies on BLOCK_VARS chain to be the tail of the + gimple_bind_vars chain. Ensure we don't violate that + assumption. */ + if (gimple_bind_block (outer_bind) + == DECL_INITIAL (current_function_decl)) + declare_vars (nonlocal_vla_vars, outer_bind, true); + else + BLOCK_VARS (DECL_INITIAL (current_function_decl)) + = chainon (BLOCK_VARS (DECL_INITIAL (current_function_decl)), + nonlocal_vla_vars); + nonlocal_vla_vars = NULL_TREE; + } pointer_set_destroy (nonlocal_vlas); nonlocal_vlas = NULL; } diff --git a/contrib/gcc-4.7/gcc/ipa-cp.c b/contrib/gcc-4.7/gcc/ipa-cp.c index 454283aabb..ddf6605b2d 100644 --- a/contrib/gcc-4.7/gcc/ipa-cp.c +++ b/contrib/gcc-4.7/gcc/ipa-cp.c @@ -1063,21 +1063,21 @@ propagate_constants_accross_call (struct cgraph_edge *cs) args_count = ipa_get_cs_argument_count (args); parms_count = ipa_get_param_count (callee_info); - /* If this call goes through a thunk we must not propagate to the first (0th) - parameter. However, we might need to uncover a thunk from below a series - of aliases first. */ + /* If this call goes through a thunk we should not propagate because we + cannot redirect edges to thunks. However, we might need to uncover a + thunk from below a series of aliases first. */ alias_or_thunk = cs->callee; while (alias_or_thunk->alias) alias_or_thunk = cgraph_alias_aliased_node (alias_or_thunk); if (alias_or_thunk->thunk.thunk_p) { - ret |= set_lattice_contains_variable (ipa_get_lattice (callee_info, 0)); - i = 1; + for (i = 0; i < parms_count; i++) + ret |= set_lattice_contains_variable (ipa_get_lattice (callee_info, i)); + + return ret; } - else - i = 0; - for (; (i < args_count) && (i < parms_count); i++) + for (i = 0; (i < args_count) && (i < parms_count); i++) { struct ipa_jump_func *jump_func = ipa_get_ith_jump_func (args, i); struct ipcp_lattice *dest_lat = ipa_get_lattice (callee_info, i); diff --git a/contrib/gcc-4.7/gcc/ipa-prop.c b/contrib/gcc-4.7/gcc/ipa-prop.c index 00642295f9..bc6e907816 100644 --- a/contrib/gcc-4.7/gcc/ipa-prop.c +++ b/contrib/gcc-4.7/gcc/ipa-prop.c @@ -812,7 +812,8 @@ compute_complex_ancestor_jump_func (struct ipa_node_params *info, return; parm = TREE_OPERAND (expr, 0); index = ipa_get_param_decl_index (info, SSA_NAME_VAR (parm)); - gcc_assert (index >= 0); + if (index < 0) + return; cond_bb = single_pred (assign_bb); cond = last_stmt (cond_bb); diff --git a/contrib/gcc-4.7/gcc/ira.c b/contrib/gcc-4.7/gcc/ira.c index 41a2928d0c..66a8a28880 100644 --- a/contrib/gcc-4.7/gcc/ira.c +++ b/contrib/gcc-4.7/gcc/ira.c @@ -3788,6 +3788,18 @@ do_reload (void) if (need_dce && optimize) run_fast_dce (); + /* Diagnose uses of the hard frame pointer when it is used as a global + register. Often we can get away with letting the user appropriate + the frame pointer, but we should let them know when code generation + makes that impossible. */ + if (global_regs[HARD_FRAME_POINTER_REGNUM] && frame_pointer_needed) + { + tree decl = global_regs_decl[HARD_FRAME_POINTER_REGNUM]; + error_at (DECL_SOURCE_LOCATION (current_function_decl), + "frame pointer required, but reserved"); + inform (DECL_SOURCE_LOCATION (decl), "for %qD", decl); + } + timevar_pop (TV_IRA); } diff --git a/contrib/gcc-4.7/gcc/objc/objc-next-runtime-abi-01.c b/contrib/gcc-4.7/gcc/objc/objc-next-runtime-abi-01.c index 7d6a212563..699ed8ee82 100644 --- a/contrib/gcc-4.7/gcc/objc/objc-next-runtime-abi-01.c +++ b/contrib/gcc-4.7/gcc/objc/objc-next-runtime-abi-01.c @@ -26,7 +26,6 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #include "system.h" #include "coretypes.h" -#include "tm.h" #include "tree.h" #ifdef OBJCPLUS @@ -49,7 +48,7 @@ along with GCC; see the file COPYING3. If not see #include "ggc.h" #include "target.h" -#include "output.h" +#include "c-family/c-target.h" #include "tree-iterator.h" #include "objc-runtime-hooks.h" @@ -2268,47 +2267,50 @@ generate_objc_symtab_decl (void) init_objc_symtab (TREE_TYPE (UOBJC_SYMBOLS_decl))); } +/* Any target implementing NeXT ObjC m32 ABI has to ensure that objects + refer to, and define, symbols that enforce linkage of classes into the + executable image, preserving unix archive semantics. + + At present (4.8), the only targets implementing this are Darwin; these + use top level asms to implement a scheme (see config/darwin-c.c). The + latter method is a hack, but compatible with LTO see also PR48109 for + further discussion and other possible methods. */ static void -handle_next_class_ref (tree chain) +handle_next_class_ref (tree chain ATTRIBUTE_UNUSED) { - const char *name = IDENTIFIER_POINTER (TREE_VALUE (chain)); - char *string = (char *) alloca (strlen (name) + 30); - - sprintf (string, ".objc_class_name_%s", name); - -#ifdef ASM_DECLARE_UNRESOLVED_REFERENCE - ASM_DECLARE_UNRESOLVED_REFERENCE (asm_out_file, string); -#else - return ; /* NULL build for targets other than Darwin. */ -#endif + if (targetcm.objc_declare_unresolved_class_reference) + { + const char *name = IDENTIFIER_POINTER (TREE_VALUE (chain)); + char *string = (char *) alloca (strlen (name) + 30); + sprintf (string, ".objc_class_name_%s", name); + targetcm.objc_declare_unresolved_class_reference (string); + } } static void -handle_next_impent (struct imp_entry *impent) +handle_next_impent (struct imp_entry *impent ATTRIBUTE_UNUSED) { - char buf[BUFSIZE]; - - switch (TREE_CODE (impent->imp_context)) + if (targetcm.objc_declare_class_definition) { - case CLASS_IMPLEMENTATION_TYPE: - snprintf (buf, BUFSIZE, ".objc_class_name_%s", - IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context))); - break; - case CATEGORY_IMPLEMENTATION_TYPE: - snprintf (buf, BUFSIZE, "*.objc_category_name_%s_%s", - IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context)), - IDENTIFIER_POINTER (CLASS_SUPER_NAME (impent->imp_context))); - break; - default: - return; - } + char buf[BUFSIZE]; -#ifdef ASM_DECLARE_CLASS_REFERENCE - ASM_DECLARE_CLASS_REFERENCE (asm_out_file, buf); -#else - return ; /* NULL build for targets other than Darwin. */ -#endif + switch (TREE_CODE (impent->imp_context)) + { + case CLASS_IMPLEMENTATION_TYPE: + snprintf (buf, BUFSIZE, ".objc_class_name_%s", + IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context))); + break; + case CATEGORY_IMPLEMENTATION_TYPE: + snprintf (buf, BUFSIZE, "*.objc_category_name_%s_%s", + IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context)), + IDENTIFIER_POINTER (CLASS_SUPER_NAME (impent->imp_context))); + break; + default: + return; + } + targetcm.objc_declare_class_definition (buf); + } } static void @@ -2331,35 +2333,6 @@ generate_classref_translation_entry (tree chain) } -/* The Fix-and-Continue functionality available in Mac OS X 10.3 and - later requires that ObjC translation units participating in F&C be - specially marked. The following routine accomplishes this. */ - -/* static int _OBJC_IMAGE_INFO[2] = { 0, 1 }; */ - -static void -generate_objc_image_info (void) -{ - tree decl; - int flags - = ((flag_replace_objc_classes && imp_count ? 1 : 0) - | (flag_objc_gc ? 2 : 0)); - VEC(constructor_elt,gc) *v = NULL; - tree array_type; - - array_type = build_sized_array_type (integer_type_node, 2); - - decl = start_var_decl (array_type, "_OBJC_ImageInfo"); - - CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, integer_zero_node); - CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (integer_type_node, flags)); - /* The runtime wants this and refers to it in a manner hidden from the compiler. - So we must force the output. */ - DECL_PRESERVE_P (decl) = 1; - OBJCMETA (decl, objc_meta, meta_info); - finish_var_decl (decl, objc_build_constructor (TREE_TYPE (decl), v)); -} - static void objc_generate_v1_next_metadata (void) { @@ -2410,13 +2383,9 @@ objc_generate_v1_next_metadata (void) attr = build_tree_list (objc_meta, meta_modules); build_module_descriptor (vers, attr); - /* This conveys information on GC usage and zero-link. */ - generate_objc_image_info (); - /* Dump the class references. This forces the appropriate classes to be linked into the executable image, preserving unix archive - semantics. This can be removed when we move to a more dynamically - linked environment. */ + semantics. */ for (chain = cls_ref_chain; chain; chain = TREE_CHAIN (chain)) { diff --git a/contrib/gcc-4.7/gcc/objc/objc-next-runtime-abi-02.c b/contrib/gcc-4.7/gcc/objc/objc-next-runtime-abi-02.c index 4512c846cc..678633a91b 100644 --- a/contrib/gcc-4.7/gcc/objc/objc-next-runtime-abi-02.c +++ b/contrib/gcc-4.7/gcc/objc/objc-next-runtime-abi-02.c @@ -3341,31 +3341,6 @@ build_v2_ivar_offset_ref_table (void) finish_var_decl (ref->decl, ref->offset); } -/* static int _OBJC_IMAGE_INFO[2] = { 0, 16 | flags }; */ - -static void -generate_v2_objc_image_info (void) -{ - tree decl, array_type; - VEC(constructor_elt,gc) *v = NULL; - int flags = - ((flag_replace_objc_classes && imp_count ? 1 : 0) - | (flag_objc_gc ? 2 : 0)); - - flags |= 16; - - array_type = build_sized_array_type (integer_type_node, 2); - - decl = start_var_decl (array_type, "_OBJC_ImageInfo"); - - CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, integer_zero_node); - CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (integer_type_node, flags)); - /* The Runtime wants this. */ - DECL_PRESERVE_P (decl) = 1; - OBJCMETA (decl, objc_meta, meta_info); - finish_var_decl (decl, objc_build_constructor (TREE_TYPE (decl), v)); -} - static void objc_generate_v2_next_metadata (void) { @@ -3417,9 +3392,6 @@ objc_generate_v2_next_metadata (void) build_v2_address_table (nonlazy_category_list, "_OBJC_NonLazyCategoryList$", meta_label_nonlazy_categorylist); - /* This conveys information on GC usage and zero-link. */ - generate_v2_objc_image_info (); - /* Generate catch objects for eh, if any are needed. */ build_v2_eh_catch_objects (); diff --git a/contrib/gcc-4.7/gcc/optabs.c b/contrib/gcc-4.7/gcc/optabs.c index 91b4661090..aa6a59eb6a 100644 --- a/contrib/gcc-4.7/gcc/optabs.c +++ b/contrib/gcc-4.7/gcc/optabs.c @@ -7212,8 +7212,7 @@ maybe_emit_atomic_exchange (rtx target, rtx mem, rtx val, enum memmodel model) create_output_operand (&ops[0], target, mode); create_fixed_operand (&ops[1], mem); - /* VAL may have been promoted to a wider mode. Shrink it if so. */ - create_convert_operand_to (&ops[2], val, mode, true); + create_input_operand (&ops[2], val, mode); create_integer_operand (&ops[3], model); if (maybe_expand_insn (icode, 4, ops)) return ops[0].value; @@ -7252,8 +7251,7 @@ maybe_emit_sync_lock_test_and_set (rtx target, rtx mem, rtx val, struct expand_operand ops[3]; create_output_operand (&ops[0], target, mode); create_fixed_operand (&ops[1], mem); - /* VAL may have been promoted to a wider mode. Shrink it if so. */ - create_convert_operand_to (&ops[2], val, mode, true); + create_input_operand (&ops[2], val, mode); if (maybe_expand_insn (icode, 3, ops)) return ops[0].value; } @@ -7295,8 +7293,6 @@ maybe_emit_compare_and_swap_exchange_loop (rtx target, rtx mem, rtx val) { if (!target || !register_operand (target, mode)) target = gen_reg_rtx (mode); - if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode) - val = convert_modes (mode, GET_MODE (val), val, 1); if (expand_compare_and_swap_loop (mem, target, val, NULL_RTX)) return target; } @@ -7508,8 +7504,8 @@ expand_atomic_compare_and_swap (rtx *ptarget_bool, rtx *ptarget_oval, create_output_operand (&ops[0], target_bool, bool_mode); create_output_operand (&ops[1], target_oval, mode); create_fixed_operand (&ops[2], mem); - create_convert_operand_to (&ops[3], expected, mode, true); - create_convert_operand_to (&ops[4], desired, mode, true); + create_input_operand (&ops[3], expected, mode); + create_input_operand (&ops[4], desired, mode); create_integer_operand (&ops[5], is_weak); create_integer_operand (&ops[6], succ_model); create_integer_operand (&ops[7], fail_model); @@ -7530,8 +7526,8 @@ expand_atomic_compare_and_swap (rtx *ptarget_bool, rtx *ptarget_oval, create_output_operand (&ops[0], target_oval, mode); create_fixed_operand (&ops[1], mem); - create_convert_operand_to (&ops[2], expected, mode, true); - create_convert_operand_to (&ops[3], desired, mode, true); + create_input_operand (&ops[2], expected, mode); + create_input_operand (&ops[3], desired, mode); if (!maybe_expand_insn (icode, 4, ops)) return false; diff --git a/contrib/gcc-4.7/gcc/predict.c b/contrib/gcc-4.7/gcc/predict.c index c12b45f12d..2f550e74e1 100644 --- a/contrib/gcc-4.7/gcc/predict.c +++ b/contrib/gcc-4.7/gcc/predict.c @@ -983,7 +983,8 @@ predict_loops (void) if (TREE_CODE (niter) == INTEGER_CST) { if (host_integerp (niter, 1) - && compare_tree_int (niter, max-1) == -1) + && max + && compare_tree_int (niter, max - 1) == -1) nitercst = tree_low_cst (niter, 1) + 1; else nitercst = max; @@ -1005,6 +1006,11 @@ predict_loops (void) else continue; + /* If the prediction for number of iterations is zero, do not + predict the exit edges. */ + if (nitercst == 0) + continue; + probability = ((REG_BR_PROB_BASE + nitercst / 2) / nitercst); predict_edge (ex, predictor, probability); } diff --git a/contrib/gcc-4.7/gcc/recog.c b/contrib/gcc-4.7/gcc/recog.c index 43711620aa..32ed021bb9 100644 --- a/contrib/gcc-4.7/gcc/recog.c +++ b/contrib/gcc-4.7/gcc/recog.c @@ -3030,6 +3030,9 @@ peep2_reg_dead_p (int ofs, rtx reg) return 1; } +/* Regno offset to be used in the register search. */ +static int search_ofs; + /* Try to find a hard register of mode MODE, matching the register class in CLASS_STR, which is available at the beginning of insn CURRENT_INSN and remains available until the end of LAST_INSN. LAST_INSN may be NULL_RTX, @@ -3045,7 +3048,6 @@ rtx peep2_find_free_register (int from, int to, const char *class_str, enum machine_mode mode, HARD_REG_SET *reg_set) { - static int search_ofs; enum reg_class cl; HARD_REG_SET live; df_ref *def_rec; @@ -3488,6 +3490,7 @@ peephole2_optimize (void) /* Initialize the regsets we're going to use. */ for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i) peep2_insn_data[i].live_before = BITMAP_ALLOC (®_obstack); + search_ofs = 0; live = BITMAP_ALLOC (®_obstack); FOR_EACH_BB_REVERSE (bb) diff --git a/contrib/gcc-4.7/gcc/regcprop.c b/contrib/gcc-4.7/gcc/regcprop.c index ceb4635535..e5a7a48a12 100644 --- a/contrib/gcc-4.7/gcc/regcprop.c +++ b/contrib/gcc-4.7/gcc/regcprop.c @@ -741,6 +741,7 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd) int n_ops, i, alt, predicated; bool is_asm, any_replacements; rtx set; + rtx link; bool replaced[MAX_RECOG_OPERANDS]; bool changed = false; @@ -808,6 +809,23 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd) if (recog_op_alt[i][alt].earlyclobber) kill_value (recog_data.operand[i], vd); + /* If we have dead sets in the insn, then we need to note these as we + would clobbers. */ + for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) + { + if (REG_NOTE_KIND (link) == REG_UNUSED) + { + kill_value (XEXP (link, 0), vd); + /* Furthermore, if the insn looked like a single-set, + but the dead store kills the source value of that + set, then we can no-longer use the plain move + special case below. */ + if (set + && reg_overlap_mentioned_p (XEXP (link, 0), SET_SRC (set))) + set = NULL; + } + } + /* Special-case plain move instructions, since we may well be able to do the move from a different register class. */ if (set && REG_P (SET_SRC (set))) diff --git a/contrib/gcc-4.7/gcc/reginfo.c b/contrib/gcc-4.7/gcc/reginfo.c index 635312655b..d2c4b6e306 100644 --- a/contrib/gcc-4.7/gcc/reginfo.c +++ b/contrib/gcc-4.7/gcc/reginfo.c @@ -88,7 +88,7 @@ static const char initial_call_really_used_regs[] = CALL_REALLY_USED_REGISTERS; char global_regs[FIRST_PSEUDO_REGISTER]; /* Declaration for the global register. */ -static tree GTY(()) global_regs_decl[FIRST_PSEUDO_REGISTER]; +tree global_regs_decl[FIRST_PSEUDO_REGISTER]; /* Same information as REGS_INVALIDATED_BY_CALL but in regset form to be used in dataflow more conveniently. */ diff --git a/contrib/gcc-4.7/gcc/rtl.h b/contrib/gcc-4.7/gcc/rtl.h index b1b681be56..fbd7e421af 100644 --- a/contrib/gcc-4.7/gcc/rtl.h +++ b/contrib/gcc-4.7/gcc/rtl.h @@ -2681,6 +2681,8 @@ extern void _fatal_insn (const char *, const_rtx, const char *, int, const char #define fatal_insn_not_found(insn) \ _fatal_insn_not_found (insn, __FILE__, __LINE__, __FUNCTION__) +/* reginfo.c */ +extern tree GTY(()) global_regs_decl[FIRST_PSEUDO_REGISTER]; #endif /* ! GCC_RTL_H */ diff --git a/contrib/gcc-4.7/gcc/sched-deps.c b/contrib/gcc-4.7/gcc/sched-deps.c index 33a6996fe4..e4aa520024 100644 --- a/contrib/gcc-4.7/gcc/sched-deps.c +++ b/contrib/gcc-4.7/gcc/sched-deps.c @@ -1563,24 +1563,15 @@ static void add_dependence_list_and_free (struct deps_desc *deps, rtx insn, rtx *listp, int uncond, enum reg_note dep_type) { - rtx list, next; + add_dependence_list (insn, *listp, uncond, dep_type); /* We don't want to short-circuit dependencies involving debug insns, because they may cause actual dependencies to be disregarded. */ if (deps->readonly || DEBUG_INSN_P (insn)) - { - add_dependence_list (insn, *listp, uncond, dep_type); - return; - } + return; - for (list = *listp, *listp = NULL; list ; list = next) - { - next = XEXP (list, 1); - if (uncond || ! sched_insns_conditions_mutex_p (insn, XEXP (list, 0))) - add_dependence (insn, XEXP (list, 0), dep_type); - free_INSN_LIST_node (list); - } + free_INSN_LIST_list (listp); } /* Remove all occurences of INSN from LIST. Return the number of @@ -1764,6 +1755,15 @@ flush_pending_lists (struct deps_desc *deps, rtx insn, int for_read, add_dependence_list_and_free (deps, insn, &deps->pending_jump_insns, 1, REG_DEP_ANTI); + if (DEBUG_INSN_P (insn)) + { + if (for_write) + free_INSN_LIST_list (&deps->pending_read_insns); + free_INSN_LIST_list (&deps->pending_write_insns); + free_INSN_LIST_list (&deps->last_pending_memory_flush); + free_INSN_LIST_list (&deps->pending_jump_insns); + } + if (!deps->readonly) { free_EXPR_LIST_list (&deps->pending_write_mems); @@ -3262,9 +3262,9 @@ sched_analyze_insn (struct deps_desc *deps, rtx x, rtx insn) SET_REGNO_REG_SET (&deps->reg_last_in_use, i); } - /* Flush pending lists on jumps, but not on speculative checks. */ - if (JUMP_P (insn) && !(sel_sched_p () - && sel_insn_is_speculation_check (insn))) + /* Don't flush pending lists on speculative checks for + selective scheduling. */ + if (!sel_sched_p () || !sel_insn_is_speculation_check (insn)) flush_pending_lists (deps, insn, true, true); reg_pending_barrier = NOT_A_BARRIER; diff --git a/contrib/gcc-4.7/gcc/sdbout.c b/contrib/gcc-4.7/gcc/sdbout.c index 255c68e7b0..4d42da9221 100644 --- a/contrib/gcc-4.7/gcc/sdbout.c +++ b/contrib/gcc-4.7/gcc/sdbout.c @@ -1264,7 +1264,10 @@ static void sdbout_parms (tree parms) { for (; parms; parms = TREE_CHAIN (parms)) - if (DECL_NAME (parms)) + if (DECL_NAME (parms) + && TREE_TYPE (parms) != error_mark_node + && DECL_RTL_SET_P (parms) + && DECL_INCOMING_RTL (parms)) { int current_sym_value = 0; const char *name = IDENTIFIER_POINTER (DECL_NAME (parms)); @@ -1396,7 +1399,10 @@ static void sdbout_reg_parms (tree parms) { for (; parms; parms = TREE_CHAIN (parms)) - if (DECL_NAME (parms)) + if (DECL_NAME (parms) + && TREE_TYPE (parms) != error_mark_node + && DECL_RTL_SET_P (parms) + && DECL_INCOMING_RTL (parms)) { const char *name = IDENTIFIER_POINTER (DECL_NAME (parms)); diff --git a/contrib/gcc-4.7/gcc/sel-sched.c b/contrib/gcc-4.7/gcc/sel-sched.c index 6b44893c89..43e0d51b80 100644 --- a/contrib/gcc-4.7/gcc/sel-sched.c +++ b/contrib/gcc-4.7/gcc/sel-sched.c @@ -1263,7 +1263,7 @@ mark_unavailable_hard_regs (def_t def, struct reg_rename *reg_rename_p, if (!HARD_FRAME_POINTER_IS_FRAME_POINTER) add_to_hard_reg_set (®_rename_p->unavailable_hard_regs, - Pmode, HARD_FRAME_POINTER_IS_FRAME_POINTER); + Pmode, HARD_FRAME_POINTER_REGNUM); } #ifdef STACK_REGS diff --git a/contrib/gcc-4.7/gcc/simplify-rtx.c b/contrib/gcc-4.7/gcc/simplify-rtx.c index 550759af7e..a0c4395f11 100644 --- a/contrib/gcc-4.7/gcc/simplify-rtx.c +++ b/contrib/gcc-4.7/gcc/simplify-rtx.c @@ -2558,6 +2558,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode, HOST_WIDE_INT mask = INTVAL (trueop1) << count; if (mask >> count == INTVAL (trueop1) + && trunc_int_for_mode (mask, mode) == mask && (mask & nonzero_bits (XEXP (op0, 0), mode)) == 0) return simplify_gen_binary (ASHIFTRT, mode, plus_constant (XEXP (op0, 0), mask), diff --git a/contrib/gcc-4.7/gcc/target.def b/contrib/gcc-4.7/gcc/target.def index fd107fb6d8..338c531cac 100644 --- a/contrib/gcc-4.7/gcc/target.def +++ b/contrib/gcc-4.7/gcc/target.def @@ -2757,6 +2757,13 @@ DEFHOOKPOD in particular GDB does not use them.", bool, false) +DEFHOOKPOD +(force_at_comp_dir, + "True if the @code{DW_AT_comp_dir} attribute should be emitted for each \ + compilation unit. This attribute is required for the darwin linker \ + to emit debug information.", + bool, false) + DEFHOOKPOD (delay_sched2, "True if sched2 is not to be run at its normal place. \ This usually means it will be run as part of machine-specific reorg.", diff --git a/contrib/gcc-4.7/gcc/tlink.c b/contrib/gcc-4.7/gcc/tlink.c index 67c7086ceb..0dac167018 100644 --- a/contrib/gcc-4.7/gcc/tlink.c +++ b/contrib/gcc-4.7/gcc/tlink.c @@ -2,7 +2,7 @@ them. Copyright (C) 1995, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008, - 2009, 2010, 2011 Free Software Foundation, Inc. + 2009, 2010, 2011, 2013 Free Software Foundation, Inc. Contributed by Jason Merrill (jason@cygnus.com). This file is part of GCC. @@ -820,18 +820,18 @@ scan_linker_output (const char *fname) void do_tlink (char **ld_argv, char **object_lst ATTRIBUTE_UNUSED) { - int exit = tlink_execute ("ld", ld_argv, ldout, lderrout); + int ret = tlink_execute ("ld", ld_argv, ldout, lderrout); tlink_init (); - if (exit) + if (ret) { int i = 0; /* Until collect does a better job of figuring out which are object files, assume that everything on the command line could be. */ if (read_repo_files (ld_argv)) - while (exit && i++ < MAX_ITERATIONS) + while (ret && i++ < MAX_ITERATIONS) { if (tlink_verbose >= 3) { @@ -846,7 +846,7 @@ do_tlink (char **ld_argv, char **object_lst ATTRIBUTE_UNUSED) break; if (tlink_verbose) fprintf (stderr, _("collect: relinking\n")); - exit = tlink_execute ("ld", ld_argv, ldout, lderrout); + ret = tlink_execute ("ld", ld_argv, ldout, lderrout); } } @@ -854,9 +854,9 @@ do_tlink (char **ld_argv, char **object_lst ATTRIBUTE_UNUSED) unlink (ldout); dump_file (lderrout, stderr); unlink (lderrout); - if (exit) + if (ret) { - error ("ld returned %d exit status", exit); - collect_exit (exit); + error ("ld returned %d exit status", ret); + exit (ret); } } diff --git a/contrib/gcc-4.7/gcc/tree-cfg.c b/contrib/gcc-4.7/gcc/tree-cfg.c index c4a1ffa4ef..cfdf7aa4dc 100644 --- a/contrib/gcc-4.7/gcc/tree-cfg.c +++ b/contrib/gcc-4.7/gcc/tree-cfg.c @@ -109,7 +109,6 @@ static int locus_map_eq (const void *, const void *); static void assign_discriminator (location_t, basic_block); static edge gimple_redirect_edge_and_branch (edge, basic_block); static edge gimple_try_redirect_by_replacing_jump (edge, basic_block); -static unsigned int split_critical_edges (void); /* Various helpers. */ static inline bool stmt_starts_bb_p (gimple, gimple); @@ -7399,7 +7398,7 @@ struct cfg_hooks gimple_cfg_hooks = { /* Split all critical edges. */ -static unsigned int +unsigned int split_critical_edges (void) { basic_block bb; diff --git a/contrib/gcc-4.7/gcc/tree-dfa.c b/contrib/gcc-4.7/gcc/tree-dfa.c index 0ecec816b6..3bcca2b31f 100644 --- a/contrib/gcc-4.7/gcc/tree-dfa.c +++ b/contrib/gcc-4.7/gcc/tree-dfa.c @@ -713,9 +713,9 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset, HOST_WIDE_INT bitsize = -1; HOST_WIDE_INT maxsize = -1; tree size_tree = NULL_TREE; - HOST_WIDE_INT bit_offset = 0; + double_int bit_offset = double_int_zero; + HOST_WIDE_INT hbit_offset; bool seen_variable_array_ref = false; - tree base_type; /* First get the final access size from just the outermost expression. */ if (TREE_CODE (exp) == COMPONENT_REF) @@ -746,12 +746,12 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset, and find the ultimate containing object. */ while (1) { - base_type = TREE_TYPE (exp); - switch (TREE_CODE (exp)) { case BIT_FIELD_REF: - bit_offset += TREE_INT_CST_LOW (TREE_OPERAND (exp, 2)); + bit_offset + = double_int_add (bit_offset, + tree_to_double_int (TREE_OPERAND (exp, 2))); break; case COMPONENT_REF: @@ -759,22 +759,23 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset, tree field = TREE_OPERAND (exp, 1); tree this_offset = component_ref_field_offset (exp); - if (this_offset - && TREE_CODE (this_offset) == INTEGER_CST - && host_integerp (this_offset, 0)) + if (this_offset && TREE_CODE (this_offset) == INTEGER_CST) { - HOST_WIDE_INT hthis_offset = TREE_INT_CST_LOW (this_offset); - hthis_offset *= BITS_PER_UNIT; - hthis_offset - += TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (field)); - bit_offset += hthis_offset; + double_int doffset = tree_to_double_int (this_offset); + doffset = double_int_lshift (doffset, + BITS_PER_UNIT == 8 + ? 3 : exact_log2 (BITS_PER_UNIT), + HOST_BITS_PER_DOUBLE_INT, true); + doffset = double_int_add (doffset, + tree_to_double_int + (DECL_FIELD_BIT_OFFSET (field))); + bit_offset = double_int_add (bit_offset, doffset); /* If we had seen a variable array ref already and we just referenced the last field of a struct or a union member then we have to adjust maxsize by the padding at the end of our field. */ - if (seen_variable_array_ref - && maxsize != -1) + if (seen_variable_array_ref && maxsize != -1) { tree stype = TREE_TYPE (TREE_OPERAND (exp, 0)); tree next = DECL_CHAIN (field); @@ -786,10 +787,12 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset, tree fsize = DECL_SIZE_UNIT (field); tree ssize = TYPE_SIZE_UNIT (stype); if (host_integerp (fsize, 0) - && host_integerp (ssize, 0)) + && host_integerp (ssize, 0) + && double_int_fits_in_shwi_p (doffset)) maxsize += ((TREE_INT_CST_LOW (ssize) - TREE_INT_CST_LOW (fsize)) - * BITS_PER_UNIT - hthis_offset); + * BITS_PER_UNIT + - double_int_to_shwi (doffset)); else maxsize = -1; } @@ -801,8 +804,12 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset, /* We need to adjust maxsize to the whole structure bitsize. But we can subtract any constant offset seen so far, because that would get us out of the structure otherwise. */ - if (maxsize != -1 && csize && host_integerp (csize, 1)) - maxsize = TREE_INT_CST_LOW (csize) - bit_offset; + if (maxsize != -1 + && csize + && host_integerp (csize, 1) + && double_int_fits_in_shwi_p (bit_offset)) + maxsize = TREE_INT_CST_LOW (csize) + - double_int_to_shwi (bit_offset); else maxsize = -1; } @@ -817,18 +824,23 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset, /* If the resulting bit-offset is constant, track it. */ if (TREE_CODE (index) == INTEGER_CST - && host_integerp (index, 0) && (low_bound = array_ref_low_bound (exp), - host_integerp (low_bound, 0)) + TREE_CODE (low_bound) == INTEGER_CST) && (unit_size = array_ref_element_size (exp), - host_integerp (unit_size, 1))) + TREE_CODE (unit_size) == INTEGER_CST)) { - HOST_WIDE_INT hindex = TREE_INT_CST_LOW (index); - - hindex -= TREE_INT_CST_LOW (low_bound); - hindex *= TREE_INT_CST_LOW (unit_size); - hindex *= BITS_PER_UNIT; - bit_offset += hindex; + double_int doffset + = double_int_sext + (double_int_sub (TREE_INT_CST (index), + TREE_INT_CST (low_bound)), + TYPE_PRECISION (TREE_TYPE (index))); + doffset = double_int_mul (doffset, + tree_to_double_int (unit_size)); + doffset = double_int_lshift (doffset, + BITS_PER_UNIT == 8 + ? 3 : exact_log2 (BITS_PER_UNIT), + HOST_BITS_PER_DOUBLE_INT, true); + bit_offset = double_int_add (bit_offset, doffset); /* An array ref with a constant index up in the structure hierarchy will constrain the size of any variable array ref @@ -841,8 +853,12 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset, /* We need to adjust maxsize to the whole array bitsize. But we can subtract any constant offset seen so far, because that would get us outside of the array otherwise. */ - if (maxsize != -1 && asize && host_integerp (asize, 1)) - maxsize = TREE_INT_CST_LOW (asize) - bit_offset; + if (maxsize != -1 + && asize + && host_integerp (asize, 1) + && double_int_fits_in_shwi_p (bit_offset)) + maxsize = TREE_INT_CST_LOW (asize) + - double_int_to_shwi (bit_offset); else maxsize = -1; @@ -857,13 +873,45 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset, break; case IMAGPART_EXPR: - bit_offset += bitsize; + bit_offset + = double_int_add (bit_offset, uhwi_to_double_int (bitsize)); break; case VIEW_CONVERT_EXPR: break; + case TARGET_MEM_REF: + /* Via the variable index or index2 we can reach the + whole object. Still hand back the decl here. */ + if (TREE_CODE (TMR_BASE (exp)) == ADDR_EXPR + && (TMR_INDEX (exp) || TMR_INDEX2 (exp))) + { + exp = TREE_OPERAND (TMR_BASE (exp), 0); + bit_offset = double_int_zero; + maxsize = -1; + goto done; + } + /* Fallthru. */ case MEM_REF: + /* We need to deal with variable arrays ending structures such as + struct { int length; int a[1]; } x; x.a[d] + struct { struct { int a; int b; } a[1]; } x; x.a[d].a + struct { struct { int a[1]; } a[1]; } x; x.a[0][d], x.a[d][0] + struct { int len; union { int a[1]; struct X x; } u; } x; x.u.a[d] + where we do not know maxsize for variable index accesses to + the array. The simplest way to conservatively deal with this + is to punt in the case that offset + maxsize reaches the + base type boundary. This needs to include possible trailing + padding that is there for alignment purposes. */ + if (seen_variable_array_ref + && maxsize != -1 + && (!double_int_fits_in_shwi_p (bit_offset) + || !host_integerp (TYPE_SIZE (TREE_TYPE (exp)), 1) + || (double_int_to_shwi (bit_offset) + maxsize + == (HOST_WIDE_INT) TREE_INT_CST_LOW + (TYPE_SIZE (TREE_TYPE (exp)))))) + maxsize = -1; + /* Hand back the decl for MEM[&decl, off]. */ if (TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR) { @@ -876,74 +924,45 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset, BITS_PER_UNIT == 8 ? 3 : exact_log2 (BITS_PER_UNIT), HOST_BITS_PER_DOUBLE_INT, true); - off = double_int_add (off, shwi_to_double_int (bit_offset)); + off = double_int_add (off, bit_offset); if (double_int_fits_in_shwi_p (off)) { - bit_offset = double_int_to_shwi (off); + bit_offset = off; exp = TREE_OPERAND (TREE_OPERAND (exp, 0), 0); } } } goto done; - case TARGET_MEM_REF: - /* Hand back the decl for MEM[&decl, off]. */ - if (TREE_CODE (TMR_BASE (exp)) == ADDR_EXPR) - { - /* Via the variable index or index2 we can reach the - whole object. */ - if (TMR_INDEX (exp) || TMR_INDEX2 (exp)) - { - exp = TREE_OPERAND (TMR_BASE (exp), 0); - bit_offset = 0; - maxsize = -1; - goto done; - } - if (integer_zerop (TMR_OFFSET (exp))) - exp = TREE_OPERAND (TMR_BASE (exp), 0); - else - { - double_int off = mem_ref_offset (exp); - off = double_int_lshift (off, - BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - HOST_BITS_PER_DOUBLE_INT, true); - off = double_int_add (off, shwi_to_double_int (bit_offset)); - if (double_int_fits_in_shwi_p (off)) - { - bit_offset = double_int_to_shwi (off); - exp = TREE_OPERAND (TMR_BASE (exp), 0); - } - } - } - goto done; - default: goto done; } exp = TREE_OPERAND (exp, 0); } - done: - - /* We need to deal with variable arrays ending structures such as - struct { int length; int a[1]; } x; x.a[d] - struct { struct { int a; int b; } a[1]; } x; x.a[d].a - struct { struct { int a[1]; } a[1]; } x; x.a[0][d], x.a[d][0] - struct { int len; union { int a[1]; struct X x; } u; } x; x.u.a[d] - where we do not know maxsize for variable index accesses to - the array. The simplest way to conservatively deal with this - is to punt in the case that offset + maxsize reaches the - base type boundary. This needs to include possible trailing padding - that is there for alignment purposes. */ + /* We need to deal with variable arrays ending structures. */ if (seen_variable_array_ref && maxsize != -1 - && (!host_integerp (TYPE_SIZE (base_type), 1) - || (bit_offset + maxsize - == (signed) TREE_INT_CST_LOW (TYPE_SIZE (base_type))))) + && (!double_int_fits_in_shwi_p (bit_offset) + || !host_integerp (TYPE_SIZE (TREE_TYPE (exp)), 1) + || (double_int_to_shwi (bit_offset) + maxsize + == (HOST_WIDE_INT) + TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (exp)))))) maxsize = -1; + done: + if (!double_int_fits_in_shwi_p (bit_offset)) + { + *poffset = 0; + *psize = bitsize; + *pmax_size = -1; + + return exp; + } + + hbit_offset = double_int_to_shwi (bit_offset); + /* In case of a decl or constant base object we can do better. */ if (DECL_P (exp)) @@ -952,7 +971,7 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset, base decl. */ if (maxsize == -1 && host_integerp (DECL_SIZE (exp), 1)) - maxsize = TREE_INT_CST_LOW (DECL_SIZE (exp)) - bit_offset; + maxsize = TREE_INT_CST_LOW (DECL_SIZE (exp)) - hbit_offset; } else if (CONSTANT_CLASS_P (exp)) { @@ -960,13 +979,13 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset, base type constant. */ if (maxsize == -1 && host_integerp (TYPE_SIZE (TREE_TYPE (exp)), 1)) - maxsize = TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (exp))) - bit_offset; + maxsize = TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (exp))) - hbit_offset; } /* ??? Due to negative offsets in ARRAY_REF we can end up with negative bit_offset here. We might want to store a zero offset in this case. */ - *poffset = bit_offset; + *poffset = hbit_offset; *psize = bitsize; *pmax_size = maxsize; diff --git a/contrib/gcc-4.7/gcc/tree-eh.c b/contrib/gcc-4.7/gcc/tree-eh.c index 2da170dded..26724dc7e3 100644 --- a/contrib/gcc-4.7/gcc/tree-eh.c +++ b/contrib/gcc-4.7/gcc/tree-eh.c @@ -1328,9 +1328,6 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf) x = gimple_seq_last_stmt (finally); finally_loc = x ? gimple_location (x) : tf_loc; - /* Lower the finally block itself. */ - lower_eh_constructs_1 (state, finally); - /* Prepare for switch statement generation. */ nlabels = VEC_length (tree, tf->dest_array); return_index = nlabels; @@ -1414,6 +1411,7 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf) x = gimple_build_label (finally_label); gimple_seq_add_stmt (&tf->top_p_seq, x); + lower_eh_constructs_1 (state, finally); gimple_seq_add_seq (&tf->top_p_seq, finally); /* Redirect each incoming goto edge. */ diff --git a/contrib/gcc-4.7/gcc/tree-flow.h b/contrib/gcc-4.7/gcc/tree-flow.h index 319be2bb61..d39abbe5f7 100644 --- a/contrib/gcc-4.7/gcc/tree-flow.h +++ b/contrib/gcc-4.7/gcc/tree-flow.h @@ -466,6 +466,7 @@ extern basic_block move_sese_region_to_fn (struct function *, basic_block, basic_block, tree); void remove_edge_and_dominated_blocks (edge); bool tree_node_can_be_shared (tree); +extern unsigned int split_critical_edges (void); /* In tree-cfgcleanup.c */ extern bitmap cfgcleanup_altered_bbs; diff --git a/contrib/gcc-4.7/gcc/tree-if-conv.c b/contrib/gcc-4.7/gcc/tree-if-conv.c index 9d09f0f4d2..316b4e2d57 100644 --- a/contrib/gcc-4.7/gcc/tree-if-conv.c +++ b/contrib/gcc-4.7/gcc/tree-if-conv.c @@ -758,20 +758,6 @@ if_convertible_stmt_p (gimple stmt, VEC (data_reference_p, heap) *refs) return true; } -/* Return true when BB post-dominates all its predecessors. */ - -static bool -bb_postdominates_preds (basic_block bb) -{ - unsigned i; - - for (i = 0; i < EDGE_COUNT (bb->preds); i++) - if (!dominated_by_p (CDI_POST_DOMINATORS, EDGE_PRED (bb, i)->src, bb)) - return false; - - return true; -} - /* Return true when BB is if-convertible. This routine does not check basic block's statements and phis. @@ -830,10 +816,23 @@ if_convertible_bb_p (struct loop *loop, basic_block bb, basic_block exit_bb) return false; } - if (EDGE_COUNT (bb->preds) == 2 - && bb != loop->header - && !bb_postdominates_preds (bb)) - return false; + /* At least one incoming edge has to be non-critical as otherwise edge + predicates are not equal to basic-block predicates of the edge + source. */ + if (EDGE_COUNT (bb->preds) > 1 + && bb != loop->header) + { + bool found = false; + FOR_EACH_EDGE (e, ei, bb->preds) + if (EDGE_COUNT (e->src->succs) == 1) + found = true; + if (!found) + { + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, "only critical predecessors\n"); + return false; + } + } return true; } @@ -1048,7 +1047,6 @@ if_convertible_loop_p_1 (struct loop *loop, return false; calculate_dominance_info (CDI_DOMINATORS); - calculate_dominance_info (CDI_POST_DOMINATORS); /* Allow statements that can be handled during if-conversion. */ ifc_bbs = get_loop_body_in_if_conv_order (loop); @@ -1184,8 +1182,7 @@ if_convertible_loop_p (struct loop *loop) if-conversion. */ static basic_block -find_phi_replacement_condition (struct loop *loop, - basic_block bb, tree *cond, +find_phi_replacement_condition (basic_block bb, tree *cond, gimple_stmt_iterator *gsi) { edge first_edge, second_edge; @@ -1195,34 +1192,10 @@ find_phi_replacement_condition (struct loop *loop, first_edge = EDGE_PRED (bb, 0); second_edge = EDGE_PRED (bb, 1); - /* Use condition based on following criteria: - 1) - S1: x = !c ? a : b; - - S2: x = c ? b : a; - - S2 is preferred over S1. Make 'b' first_bb and use its condition. - - 2) Do not make loop header first_bb. - - 3) - S1: x = !(c == d)? a : b; - - S21: t1 = c == d; - S22: x = t1 ? b : a; - - S3: x = (c == d) ? b : a; - - S3 is preferred over S1 and S2*, Make 'b' first_bb and use - its condition. - - 4) If pred B is dominated by pred A then use pred B's condition. - See PR23115. */ - - /* Select condition that is not TRUTH_NOT_EXPR. */ + /* Prefer an edge with a not negated predicate. + ??? That's a very weak cost model. */ tmp_cond = bb_predicate (first_edge->src); gcc_assert (tmp_cond); - if (TREE_CODE (tmp_cond) == TRUTH_NOT_EXPR) { edge tmp_edge; @@ -1232,11 +1205,9 @@ find_phi_replacement_condition (struct loop *loop, second_edge = tmp_edge; } - /* Check if FIRST_BB is loop header or not and make sure that - FIRST_BB does not dominate SECOND_BB. */ - if (first_edge->src == loop->header - || dominated_by_p (CDI_DOMINATORS, - second_edge->src, first_edge->src)) + /* Check if the edge we take the condition from is not critical. + We know that at least one non-critical edge exists. */ + if (EDGE_COUNT (first_edge->src->succs) > 1) { *cond = bb_predicate (second_edge->src); @@ -1311,9 +1282,6 @@ predicate_scalar_phi (gimple phi, tree cond, arg_1 = gimple_phi_arg_def (phi, 1); } - gcc_checking_assert (bb == bb->loop_father->header - || bb_postdominates_preds (bb)); - /* Build new RHS using selected condition and arguments. */ rhs = build3 (COND_EXPR, TREE_TYPE (res), unshare_expr (cond), arg_0, arg_1); @@ -1359,7 +1327,7 @@ predicate_all_scalar_phis (struct loop *loop) /* BB has two predecessors. Using predecessor's aux field, set appropriate condition for the PHI node replacement. */ gsi = gsi_after_labels (bb); - true_bb = find_phi_replacement_condition (loop, bb, &cond, &gsi); + true_bb = find_phi_replacement_condition (bb, &cond, &gsi); while (!gsi_end_p (phi_gsi)) { @@ -1791,8 +1759,6 @@ main_tree_if_conversion (void) if (changed && flag_tree_loop_if_convert_stores) todo |= TODO_update_ssa_only_virtuals; - free_dominance_info (CDI_POST_DOMINATORS); - return todo; } diff --git a/contrib/gcc-4.7/gcc/tree-predcom.c b/contrib/gcc-4.7/gcc/tree-predcom.c index 1566902e3d..61a1c741d1 100644 --- a/contrib/gcc-4.7/gcc/tree-predcom.c +++ b/contrib/gcc-4.7/gcc/tree-predcom.c @@ -2117,7 +2117,11 @@ combinable_refs_p (dref r1, dref r2, stmt = find_common_use_stmt (&name1, &name2); - if (!stmt) + if (!stmt + /* A simple post-dominance check - make sure the combination + is executed under the same condition as the references. */ + || (gimple_bb (stmt) != gimple_bb (r1->stmt) + && gimple_bb (stmt) != gimple_bb (r2->stmt))) return false; acode = gimple_assign_rhs_code (stmt); diff --git a/contrib/gcc-4.7/gcc/tree-ssa-ccp.c b/contrib/gcc-4.7/gcc/tree-ssa-ccp.c index 105c36038e..ac544d3e2b 100644 --- a/contrib/gcc-4.7/gcc/tree-ssa-ccp.c +++ b/contrib/gcc-4.7/gcc/tree-ssa-ccp.c @@ -1744,6 +1744,9 @@ insert_clobber_before_stack_restore (tree saved_val, tree var, htab_t *visited) insert_clobber_before_stack_restore (gimple_phi_result (stmt), var, visited); } + else if (gimple_assign_ssa_name_copy_p (stmt)) + insert_clobber_before_stack_restore (gimple_assign_lhs (stmt), var, + visited); else gcc_assert (is_gimple_debug (stmt)); } diff --git a/contrib/gcc-4.7/gcc/tree-ssa-dce.c b/contrib/gcc-4.7/gcc/tree-ssa-dce.c index ace9ef9972..bb1ef08ece 100644 --- a/contrib/gcc-4.7/gcc/tree-ssa-dce.c +++ b/contrib/gcc-4.7/gcc/tree-ssa-dce.c @@ -576,6 +576,11 @@ mark_aliased_reaching_defs_necessary_1 (ao_ref *ref, tree vdef, void *data) in the references (gcc.c-torture/execute/pr42142.c). The simplest way is to check if the kill dominates the use. */ + /* But when both are in the same block we cannot + easily tell whether we came from a backedge + unless we decide to compute stmt UIDs + (see PR58246). */ + && (basic_block) data != gimple_bb (def_stmt) && dominated_by_p (CDI_DOMINATORS, (basic_block) data, gimple_bb (def_stmt)) && operand_equal_p (ref->ref, lhs, 0)) @@ -1305,26 +1310,19 @@ eliminate_unnecessary_stmts (void) stats.total++; /* We can mark a call to free as not necessary if the - defining statement of its argument is an allocation - function and that is not necessary itself. */ - if (gimple_call_builtin_p (stmt, BUILT_IN_FREE)) + defining statement of its argument is not necessary + (and thus is getting removed). */ + if (gimple_plf (stmt, STMT_NECESSARY) + && gimple_call_builtin_p (stmt, BUILT_IN_FREE)) { tree ptr = gimple_call_arg (stmt, 0); - tree callee2; - gimple def_stmt; - if (TREE_CODE (ptr) != SSA_NAME) - continue; - def_stmt = SSA_NAME_DEF_STMT (ptr); - if (!is_gimple_call (def_stmt) - || gimple_plf (def_stmt, STMT_NECESSARY)) - continue; - callee2 = gimple_call_fndecl (def_stmt); - if (callee2 == NULL_TREE - || DECL_BUILT_IN_CLASS (callee2) != BUILT_IN_NORMAL - || (DECL_FUNCTION_CODE (callee2) != BUILT_IN_MALLOC - && DECL_FUNCTION_CODE (callee2) != BUILT_IN_CALLOC)) - continue; - gimple_set_plf (stmt, STMT_NECESSARY, false); + if (TREE_CODE (ptr) == SSA_NAME) + { + gimple def_stmt = SSA_NAME_DEF_STMT (ptr); + if (!gimple_nop_p (def_stmt) + && !gimple_plf (def_stmt, STMT_NECESSARY)) + gimple_set_plf (stmt, STMT_NECESSARY, false); + } } /* If GSI is not necessary then remove it. */ diff --git a/contrib/gcc-4.7/gcc/tree-ssa-loop-niter.c b/contrib/gcc-4.7/gcc/tree-ssa-loop-niter.c index 15ea06b8b9..9c02122295 100644 --- a/contrib/gcc-4.7/gcc/tree-ssa-loop-niter.c +++ b/contrib/gcc-4.7/gcc/tree-ssa-loop-niter.c @@ -2068,7 +2068,8 @@ chain_of_csts_start (struct loop *loop, tree x) return NULL; } - if (gimple_code (stmt) != GIMPLE_ASSIGN) + if (gimple_code (stmt) != GIMPLE_ASSIGN + || gimple_assign_rhs_class (stmt) == GIMPLE_TERNARY_RHS) return NULL; code = gimple_assign_rhs_code (stmt); @@ -2136,7 +2137,7 @@ get_val_for (tree x, tree base) { gimple stmt; - gcc_assert (is_gimple_min_invariant (base)); + gcc_checking_assert (is_gimple_min_invariant (base)); if (!x) return base; @@ -2145,7 +2146,7 @@ get_val_for (tree x, tree base) if (gimple_code (stmt) == GIMPLE_PHI) return base; - gcc_assert (is_gimple_assign (stmt)); + gcc_checking_assert (is_gimple_assign (stmt)); /* STMT must be either an assignment of a single SSA name or an expression involving an SSA name and a constant. Try to fold that diff --git a/contrib/gcc-4.7/gcc/tree-ssa-phiprop.c b/contrib/gcc-4.7/gcc/tree-ssa-phiprop.c index 3064437256..7dd94a4f56 100644 --- a/contrib/gcc-4.7/gcc/tree-ssa-phiprop.c +++ b/contrib/gcc-4.7/gcc/tree-ssa-phiprop.c @@ -314,6 +314,12 @@ propagate_with_phi (basic_block bb, gimple phi, struct phiprop_d *phivn, gimple def_stmt; tree vuse; + /* Only replace loads in blocks that post-dominate the PHI node. That + makes sure we don't end up speculating loads. */ + if (!dominated_by_p (CDI_POST_DOMINATORS, + bb, gimple_bb (use_stmt))) + continue; + /* Check whether this is a load of *ptr. */ if (!(is_gimple_assign (use_stmt) && TREE_CODE (gimple_assign_lhs (use_stmt)) == SSA_NAME @@ -385,6 +391,7 @@ tree_ssa_phiprop (void) size_t n; calculate_dominance_info (CDI_DOMINATORS); + calculate_dominance_info (CDI_POST_DOMINATORS); n = num_ssa_names; phivn = XCNEWVEC (struct phiprop_d, n); @@ -402,6 +409,8 @@ tree_ssa_phiprop (void) VEC_free (basic_block, heap, bbs); free (phivn); + free_dominance_info (CDI_POST_DOMINATORS); + return 0; } diff --git a/contrib/gcc-4.7/gcc/tree-ssa-pre.c b/contrib/gcc-4.7/gcc/tree-ssa-pre.c index 727614a421..4f710515a0 100644 --- a/contrib/gcc-4.7/gcc/tree-ssa-pre.c +++ b/contrib/gcc-4.7/gcc/tree-ssa-pre.c @@ -1756,39 +1756,26 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2, case NAME: { - gimple phi = NULL; - edge e; - gimple def_stmt; tree name = PRE_EXPR_NAME (expr); - - def_stmt = SSA_NAME_DEF_STMT (name); + gimple def_stmt = SSA_NAME_DEF_STMT (name); + /* If the SSA name is defined by a PHI node in this block, + translate it. */ if (gimple_code (def_stmt) == GIMPLE_PHI && gimple_bb (def_stmt) == phiblock) - phi = def_stmt; - else - return expr; - - e = find_edge (pred, gimple_bb (phi)); - if (e) { - tree def = PHI_ARG_DEF (phi, e->dest_idx); - pre_expr newexpr; - - if (TREE_CODE (def) == SSA_NAME) - def = VN_INFO (def)->valnum; + edge e = find_edge (pred, gimple_bb (def_stmt)); + tree def = PHI_ARG_DEF (def_stmt, e->dest_idx); /* Handle constant. */ if (is_gimple_min_invariant (def)) return get_or_alloc_expr_for_constant (def); - if (TREE_CODE (def) == SSA_NAME && ssa_undefined_value_p (def)) - return NULL; - - newexpr = get_or_alloc_expr_for_name (def); - return newexpr; + return get_or_alloc_expr_for_name (def); } + /* Otherwise return it unchanged - it will get cleaned if its + value is not available in PREDs AVAIL_OUT set of expressions. */ + return expr; } - return expr; default: gcc_unreachable (); diff --git a/contrib/gcc-4.7/gcc/tree-ssa-sccvn.c b/contrib/gcc-4.7/gcc/tree-ssa-sccvn.c index c2bd59d641..1e4dc14434 100644 --- a/contrib/gcc-4.7/gcc/tree-ssa-sccvn.c +++ b/contrib/gcc-4.7/gcc/tree-ssa-sccvn.c @@ -2483,6 +2483,7 @@ static inline bool set_ssa_val_to (tree from, tree to) { tree currval = SSA_VAL (from); + HOST_WIDE_INT toff, coff; if (from != to) { @@ -2518,7 +2519,17 @@ set_ssa_val_to (tree from, tree to) print_generic_expr (dump_file, to, 0); } - if (currval != to && !operand_equal_p (currval, to, OEP_PURE_SAME)) + if (currval != to + && !operand_equal_p (currval, to, OEP_PURE_SAME) + /* ??? For addresses involving volatile objects or types operand_equal_p + does not reliably detect ADDR_EXPRs as equal. We know we are only + getting invariant gimple addresses here, so can use + get_addr_base_and_unit_offset to do this comparison. */ + && !(TREE_CODE (currval) == ADDR_EXPR + && TREE_CODE (to) == ADDR_EXPR + && (get_addr_base_and_unit_offset (TREE_OPERAND (currval, 0), &coff) + == get_addr_base_and_unit_offset (TREE_OPERAND (to, 0), &toff)) + && coff == toff)) { VN_INFO (from)->valnum = to; if (dump_file && (dump_flags & TDF_DETAILS)) diff --git a/contrib/gcc-4.7/gcc/tree-ssa-sink.c b/contrib/gcc-4.7/gcc/tree-ssa-sink.c index d42b46a180..0222dac1a4 100644 --- a/contrib/gcc-4.7/gcc/tree-ssa-sink.c +++ b/contrib/gcc-4.7/gcc/tree-ssa-sink.c @@ -412,7 +412,15 @@ statement_sink_location (gimple stmt, basic_block frombb, && gimple_vdef (use_stmt) && operand_equal_p (gimple_assign_lhs (stmt), gimple_assign_lhs (use_stmt), 0)) - continue; + { + /* If use_stmt is or might be a nop assignment then USE_STMT + acts as a use as well as definition. */ + if (stmt != use_stmt + && ref_maybe_used_by_stmt_p (use_stmt, + gimple_assign_lhs (stmt))) + return false; + continue; + } if (gimple_code (use_stmt) != GIMPLE_PHI) return false; @@ -628,7 +636,7 @@ static void execute_sink_code (void) { loop_optimizer_init (LOOPS_NORMAL); - + split_critical_edges (); connect_infinite_loops_to_exit (); memset (&sink_stats, 0, sizeof (sink_stats)); calculate_dominance_info (CDI_DOMINATORS); diff --git a/contrib/gcc-4.7/gcc/tree-ssa-strlen.c b/contrib/gcc-4.7/gcc/tree-ssa-strlen.c index 304c294057..532bdac3fa 100644 --- a/contrib/gcc-4.7/gcc/tree-ssa-strlen.c +++ b/contrib/gcc-4.7/gcc/tree-ssa-strlen.c @@ -1693,7 +1693,7 @@ handle_char_store (gimple_stmt_iterator *gsi) its length may be decreased. */ adjust_last_stmt (si, stmt, false); } - else if (si != NULL) + else if (si != NULL && integer_zerop (gimple_assign_rhs1 (stmt))) { si = unshare_strinfo (si); si->length = build_int_cst (size_type_node, 0); @@ -1896,6 +1896,29 @@ strlen_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED, int count_vdef = 100; do_invalidate (dombb, phi, visited, &count_vdef); BITMAP_FREE (visited); + if (count_vdef == 0) + { + /* If there were too many vdefs in between immediate + dominator and current bb, invalidate everything. + If stridx_to_strinfo has been unshared, we need + to free it, otherwise just set it to NULL. */ + if (!strinfo_shared ()) + { + unsigned int i; + strinfo si; + + for (i = 1; + VEC_iterate (strinfo, stridx_to_strinfo, i, si); + ++i) + { + free_strinfo (si); + VEC_replace (strinfo, stridx_to_strinfo, + i, NULL); + } + } + else + stridx_to_strinfo = NULL; + } break; } } diff --git a/contrib/gcc-4.7/gcc/tree-ssanames.c b/contrib/gcc-4.7/gcc/tree-ssanames.c index 42eb924325..f14ee43957 100644 --- a/contrib/gcc-4.7/gcc/tree-ssanames.c +++ b/contrib/gcc-4.7/gcc/tree-ssanames.c @@ -133,7 +133,7 @@ make_ssa_name_fn (struct function *fn, tree var, gimple stmt) /* The node was cleared out when we put it on the free list, so there is no need to do so again here. */ - gcc_assert (ssa_name (SSA_NAME_VERSION (t)) == NULL); + gcc_assert (VEC_index (tree, SSANAMES (fn), SSA_NAME_VERSION (t)) == NULL); VEC_replace (tree, SSANAMES (fn), SSA_NAME_VERSION (t), t); } else diff --git a/contrib/gcc-4.7/gcc/tree-streamer-in.c b/contrib/gcc-4.7/gcc/tree-streamer-in.c index 840f4c2cb6..f2b12243b1 100644 --- a/contrib/gcc-4.7/gcc/tree-streamer-in.c +++ b/contrib/gcc-4.7/gcc/tree-streamer-in.c @@ -172,12 +172,11 @@ unpack_ts_real_cst_value_fields (struct bitpack_d *bp, tree expr) static void unpack_ts_fixed_cst_value_fields (struct bitpack_d *bp, tree expr) { - struct fixed_value fv; - - fv.mode = bp_unpack_enum (bp, machine_mode, MAX_MACHINE_MODE); - fv.data.low = bp_unpack_var_len_int (bp); - fv.data.high = bp_unpack_var_len_int (bp); - TREE_FIXED_CST (expr) = fv; + FIXED_VALUE_TYPE *fp = ggc_alloc_fixed_value (); + fp->mode = bp_unpack_enum (bp, machine_mode, MAX_MACHINE_MODE); + fp->data.low = bp_unpack_var_len_int (bp); + fp->data.high = bp_unpack_var_len_int (bp); + TREE_FIXED_CST_PTR (expr) = fp; } diff --git a/contrib/gcc-4.7/gcc/tree-tailcall.c b/contrib/gcc-4.7/gcc/tree-tailcall.c index 66fb89252c..e5387008b8 100644 --- a/contrib/gcc-4.7/gcc/tree-tailcall.c +++ b/contrib/gcc-4.7/gcc/tree-tailcall.c @@ -329,8 +329,10 @@ process_assignment (gimple stmt, gimple_stmt_iterator call, tree *m, case NEGATE_EXPR: if (FLOAT_TYPE_P (TREE_TYPE (op0))) *m = build_real (TREE_TYPE (op0), dconstm1); - else + else if (INTEGRAL_TYPE_P (TREE_TYPE (op0))) *m = build_int_cst (TREE_TYPE (op0), -1); + else + return false; *ass_var = dest; return true; @@ -342,8 +344,10 @@ process_assignment (gimple stmt, gimple_stmt_iterator call, tree *m, { if (FLOAT_TYPE_P (TREE_TYPE (non_ass_var))) *m = build_real (TREE_TYPE (non_ass_var), dconstm1); - else + else if (INTEGRAL_TYPE_P (TREE_TYPE (non_ass_var))) *m = build_int_cst (TREE_TYPE (non_ass_var), -1); + else + return false; *a = fold_build1 (NEGATE_EXPR, TREE_TYPE (non_ass_var), non_ass_var); } @@ -572,6 +576,11 @@ find_tail_calls (basic_block bb, struct tailcall **ret) if (!tail_recursion && (m || a)) return; + /* For pointers don't allow additions or multiplications. */ + if ((m || a) + && POINTER_TYPE_P (TREE_TYPE (DECL_RESULT (current_function_decl)))) + return; + nw = XNEW (struct tailcall); nw->call_gsi = gsi; diff --git a/contrib/gcc-4.7/gcc/tree-vect-data-refs.c b/contrib/gcc-4.7/gcc/tree-vect-data-refs.c index 0faf1a93c9..07253ec011 100644 --- a/contrib/gcc-4.7/gcc/tree-vect-data-refs.c +++ b/contrib/gcc-4.7/gcc/tree-vect-data-refs.c @@ -2332,6 +2332,12 @@ vect_analyze_data_ref_access (struct data_reference *dr) if (loop_vinfo && dr_step == 0) { GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) = NULL; + if (nested_in_vect_loop_p (loop, stmt)) + { + if (vect_print_dump_info (REPORT_DETAILS)) + fprintf (vect_dump, "zero step in inner loop of nest"); + return false; + } return DR_IS_READ (dr); } diff --git a/contrib/gcc-4.7/gcc/tree-vect-loop.c b/contrib/gcc-4.7/gcc/tree-vect-loop.c index b6f85d8e19..8dea3cfbd6 100644 --- a/contrib/gcc-4.7/gcc/tree-vect-loop.c +++ b/contrib/gcc-4.7/gcc/tree-vect-loop.c @@ -1466,7 +1466,7 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo, bool slp) if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo) || LOOP_VINFO_INT_NITERS (loop_vinfo) % vectorization_factor != 0 - || LOOP_PEELING_FOR_ALIGNMENT (loop_vinfo)) + || LOOP_VINFO_PEELING_FOR_GAPS (loop_vinfo)) { if (vect_print_dump_info (REPORT_DETAILS)) fprintf (vect_dump, "epilog loop required."); @@ -2009,6 +2009,12 @@ vect_is_simple_reduction_1 (loop_vec_info loop_info, gimple phi, || (!check_reduction && flow_loop_nested_p (vect_loop, loop))); name = PHI_RESULT (phi); + /* ??? If there are no uses of the PHI result the inner loop reduction + won't be detected as possibly double-reduction by vectorizable_reduction + because that tries to walk the PHI arg from the preheader edge which + can be constant. See PR60382. */ + if (has_zero_uses (name)) + return NULL; nloop_uses = 0; FOR_EACH_IMM_USE_FAST (use_p, imm_iter, name) { @@ -4158,7 +4164,8 @@ vect_finalize_reduction: result. (The reduction result is expected to have two immediate uses - one at the latch block, and one at the loop exit). */ FOR_EACH_IMM_USE_FAST (use_p, imm_iter, scalar_dest) - if (!flow_bb_inside_loop_p (loop, gimple_bb (USE_STMT (use_p)))) + if (!flow_bb_inside_loop_p (loop, gimple_bb (USE_STMT (use_p))) + && !is_gimple_debug (USE_STMT (use_p))) VEC_safe_push (gimple, heap, phis, USE_STMT (use_p)); /* We expect to have found an exit_phi because of loop-closed-ssa @@ -4286,7 +4293,10 @@ vect_finalize_reduction: FOR_EACH_IMM_USE_FAST (use_p, imm_iter, scalar_dest) { if (!flow_bb_inside_loop_p (loop, gimple_bb (USE_STMT (use_p)))) - VEC_safe_push (gimple, heap, phis, USE_STMT (use_p)); + { + if (!is_gimple_debug (USE_STMT (use_p))) + VEC_safe_push (gimple, heap, phis, USE_STMT (use_p)); + } else { if (double_reduc && gimple_code (USE_STMT (use_p)) == GIMPLE_PHI) @@ -4296,7 +4306,8 @@ vect_finalize_reduction: FOR_EACH_IMM_USE_FAST (phi_use_p, phi_imm_iter, phi_res) { if (!flow_bb_inside_loop_p (loop, - gimple_bb (USE_STMT (phi_use_p)))) + gimple_bb (USE_STMT (phi_use_p))) + && !is_gimple_debug (USE_STMT (phi_use_p))) VEC_safe_push (gimple, heap, phis, USE_STMT (phi_use_p)); } diff --git a/contrib/gcc-4.7/gcc/tree-vrp.c b/contrib/gcc-4.7/gcc/tree-vrp.c index a65266c27f..1bb1775f69 100644 --- a/contrib/gcc-4.7/gcc/tree-vrp.c +++ b/contrib/gcc-4.7/gcc/tree-vrp.c @@ -4536,9 +4536,13 @@ register_edge_assert_for_1 (tree op, enum tree_code code, } else if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (op_def))) { - /* Recurse through the type conversion. */ - retval |= register_edge_assert_for_1 (gimple_assign_rhs1 (op_def), - code, e, bsi); + /* Recurse through the type conversion, unless it is a narrowing + conversion or conversion from non-integral type. */ + tree rhs = gimple_assign_rhs1 (op_def); + if (INTEGRAL_TYPE_P (TREE_TYPE (rhs)) + && (TYPE_PRECISION (TREE_TYPE (rhs)) + <= TYPE_PRECISION (TREE_TYPE (op)))) + retval |= register_edge_assert_for_1 (rhs, code, e, bsi); } return retval; diff --git a/contrib/gcc-4.7/libgcc/Makefile.in b/contrib/gcc-4.7/libgcc/Makefile.in index e1cac49b38..c301ff03ca 100644 --- a/contrib/gcc-4.7/libgcc/Makefile.in +++ b/contrib/gcc-4.7/libgcc/Makefile.in @@ -121,7 +121,8 @@ installcheck: .PHONY: all clean clean: - -rm -f config.h libgcc_tm.h stamp-h stmp-ldirs libgcc.map + -rm -f config.h libgcc_tm.h libgcc.map + -rm -f libgcc_tm.stamp stamp-h stmp-ldirs -rm -f *$(objext) -rm -f *.dep -rm -f *.a diff --git a/contrib/gcc-4.7/libgcc/config.host b/contrib/gcc-4.7/libgcc/config.host index 66b4724b8b..b64da4a26d 100644 --- a/contrib/gcc-4.7/libgcc/config.host +++ b/contrib/gcc-4.7/libgcc/config.host @@ -315,7 +315,7 @@ alpha*-dec-*vms*) md_unwind_header=alpha/vms-unwind.h ;; arm-wrs-vxworks) - tmake_file="$tmake_file arm/t-arm arm/t-vxworks t-fdpbit" + tmake_file="$tmake_file arm/t-arm arm/t-vxworks t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp" extra_parts="$extra_parts crti.o crtn.o" ;; arm*-*-freebsd*) @@ -1110,7 +1110,7 @@ tilepro-*-linux*) md_unwind_header=tilepro/linux-unwind.h ;; v850*-*-*) - tmake_file="v850/t-v850 t-fdpbit" + tmake_file="${tmake_file} v850/t-v850 t-fdpbit" ;; vax-*-linux*) tmake_file="$tmake_file vax/t-linux" @@ -1127,7 +1127,7 @@ xtensa*-*-elf*) extra_parts="$extra_parts crti.o crtn.o" ;; xtensa*-*-linux*) - tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux" + tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc" md_unwind_header=xtensa/linux-unwind.h ;; am33_2.0-*-linux*) diff --git a/contrib/gcc-4.7/libgcc/config/i386/32/sfp-machine.h b/contrib/gcc-4.7/libgcc/config/i386/32/sfp-machine.h index 131b2c453f..7e7952908d 100644 --- a/contrib/gcc-4.7/libgcc/config/i386/32/sfp-machine.h +++ b/contrib/gcc-4.7/libgcc/config/i386/32/sfp-machine.h @@ -140,6 +140,14 @@ struct fenv __asm__ __volatile__ ("fdiv {%y0, %0|%0, %y0}" : "+t" (f)); \ __asm__ __volatile__ ("fwait"); \ } \ + if (_fex & FP_EX_DENORM) \ + { \ + struct fenv temp; \ + __asm__ __volatile__ ("fnstenv %0" : "=m" (temp)); \ + temp.__status_word |= FP_EX_DENORM; \ + __asm__ __volatile__ ("fldenv %0" : : "m" (temp)); \ + __asm__ __volatile__ ("fwait"); \ + } \ if (_fex & FP_EX_DIVZERO) \ { \ float f = 1.0, g = 0.0; \ diff --git a/contrib/gcc-4.7/libgcc/config/i386/64/sfp-machine.h b/contrib/gcc-4.7/libgcc/config/i386/64/sfp-machine.h index f90305a764..57cc873ca9 100644 --- a/contrib/gcc-4.7/libgcc/config/i386/64/sfp-machine.h +++ b/contrib/gcc-4.7/libgcc/config/i386/64/sfp-machine.h @@ -89,6 +89,14 @@ struct fenv float f = 0.0; \ __asm__ __volatile__ (ASM_INVALID : : "x" (f)); \ } \ + if (_fex & FP_EX_DENORM) \ + { \ + struct fenv temp; \ + __asm__ __volatile__ ("fnstenv %0" : "=m" (temp)); \ + temp.__status_word |= FP_EX_DENORM; \ + __asm__ __volatile__ ("fldenv %0" : : "m" (temp)); \ + __asm__ __volatile__ ("fwait"); \ + } \ if (_fex & FP_EX_DIVZERO) \ { \ float f = 1.0, g = 0.0; \ diff --git a/contrib/gcc-4.7/libstdc++-v3/include/bits/atomic_base.h b/contrib/gcc-4.7/libstdc++-v3/include/bits/atomic_base.h index 191db7b5f0..8995b1b402 100644 --- a/contrib/gcc-4.7/libstdc++-v3/include/bits/atomic_base.h +++ b/contrib/gcc-4.7/libstdc++-v3/include/bits/atomic_base.h @@ -722,11 +722,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION bool is_lock_free() const noexcept - { return __atomic_is_lock_free(_M_type_size(1), &_M_p); } + { return __atomic_is_lock_free(sizeof(__pointer_type), &_M_p); } bool is_lock_free() const volatile noexcept - { return __atomic_is_lock_free(_M_type_size(1), &_M_p); } + { return __atomic_is_lock_free(sizeof(__pointer_type), &_M_p); } void store(__pointer_type __p, diff --git a/contrib/gcc-4.7/libstdc++-v3/include/bits/basic_string.h b/contrib/gcc-4.7/libstdc++-v3/include/bits/basic_string.h index 169daf5861..d4d35e8d82 100644 --- a/contrib/gcc-4.7/libstdc++-v3/include/bits/basic_string.h +++ b/contrib/gcc-4.7/libstdc++-v3/include/bits/basic_string.h @@ -2764,10 +2764,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * Stores characters from @a __is into @a __str until @a __delim is * found, the end of the stream is encountered, or str.max_size() - * is reached. If is.width() is non-zero, that is the limit on the - * number of characters stored into @a __str. Any previous - * contents of @a __str are erased. If @a __delim was encountered, - * it is extracted but not stored into @a __str. + * is reached. Any previous contents of @a __str are erased. If + * @a __delim is encountered, it is extracted but not stored into + * @a __str. */ template basic_istream<_CharT, _Traits>& @@ -2782,10 +2781,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * Stores characters from is into @a __str until '\n' is * found, the end of the stream is encountered, or str.max_size() - * is reached. If __is.width() is non-zero, that is the limit on - * the number of characters stored into @a __str. Any previous - * contents of @a __str are erased. If end of line was - * encountered, it is extracted but not stored into @a __str. + * is reached. Any previous contents of @a __str are erased. If + * end of line is encountered, it is extracted but not stored into + * @a __str. */ template inline basic_istream<_CharT, _Traits>& diff --git a/contrib/gcc-4.7/libstdc++-v3/include/bits/random.tcc b/contrib/gcc-4.7/libstdc++-v3/include/bits/random.tcc index a182dfb838..db1bd04ced 100644 --- a/contrib/gcc-4.7/libstdc++-v3/include/bits/random.tcc +++ b/contrib/gcc-4.7/libstdc++-v3/include/bits/random.tcc @@ -1125,7 +1125,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator()(_UniformRandomNumberGenerator& __urng, const param_type& __p) { - typedef typename std::gamma_distribution::param_type + typedef typename std::gamma_distribution::param_type param_type; const double __y = diff --git a/contrib/gcc-4.7/libstdc++-v3/include/bits/shared_ptr_base.h b/contrib/gcc-4.7/libstdc++-v3/include/bits/shared_ptr_base.h index 0d60eeffa5..3d4d12ba31 100644 --- a/contrib/gcc-4.7/libstdc++-v3/include/bits/shared_ptr_base.h +++ b/contrib/gcc-4.7/libstdc++-v3/include/bits/shared_ptr_base.h @@ -394,7 +394,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION public: template _Sp_counted_ptr_inplace(_Alloc __a, _Args&&... __args) - : _M_impl(__a), _M_storage() + : _M_impl(__a) { _M_impl._M_ptr = static_cast<_Tp*>(static_cast(&_M_storage)); // _GLIBCXX_RESOLVE_LIB_DEFECTS diff --git a/contrib/gcc-4.7/libstdc++-v3/include/bits/stl_algo.h b/contrib/gcc-4.7/libstdc++-v3/include/bits/stl_algo.h index f337e0c07a..a2921509b1 100644 --- a/contrib/gcc-4.7/libstdc++-v3/include/bits/stl_algo.h +++ b/contrib/gcc-4.7/libstdc++-v3/include/bits/stl_algo.h @@ -74,10 +74,11 @@ namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION - /// Swaps the median value of *__a, *__b and *__c to *__a + /// Swaps the median value of *__a, *__b and *__c to *__result template void - __move_median_first(_Iterator __a, _Iterator __b, _Iterator __c) + __move_median_to_first(_Iterator __result, _Iterator __a, + _Iterator __b, _Iterator __c) { // concept requirements __glibcxx_function_requires(_LessThanComparableConcept< @@ -86,23 +87,26 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if (*__a < *__b) { if (*__b < *__c) - std::iter_swap(__a, __b); + std::iter_swap(__result, __b); else if (*__a < *__c) - std::iter_swap(__a, __c); + std::iter_swap(__result, __c); + else + std::iter_swap(__result, __a); } else if (*__a < *__c) - return; + std::iter_swap(__result, __a); else if (*__b < *__c) - std::iter_swap(__a, __c); + std::iter_swap(__result, __c); else - std::iter_swap(__a, __b); + std::iter_swap(__result, __b); } - /// Swaps the median value of *__a, *__b and *__c under __comp to *__a + /// Swaps the median value of *__a, *__b and *__c under __comp to *__result template void - __move_median_first(_Iterator __a, _Iterator __b, _Iterator __c, - _Compare __comp) + __move_median_to_first(_Iterator __result, _Iterator __a, + _Iterator __b, _Iterator __c, + _Compare __comp) { // concept requirements __glibcxx_function_requires(_BinaryFunctionConcept<_Compare, bool, @@ -112,16 +116,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if (__comp(*__a, *__b)) { if (__comp(*__b, *__c)) - std::iter_swap(__a, __b); + std::iter_swap(__result, __b); else if (__comp(*__a, *__c)) - std::iter_swap(__a, __c); + std::iter_swap(__result, __c); + else + std::iter_swap(__result, __a); } else if (__comp(*__a, *__c)) - return; + std::iter_swap(__result, __a); else if (__comp(*__b, *__c)) - std::iter_swap(__a, __c); + std::iter_swap(__result, __c); else - std::iter_swap(__a, __b); + std::iter_swap(__result, __b); } // for_each @@ -2305,7 +2311,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _RandomAccessIterator __last) { _RandomAccessIterator __mid = __first + (__last - __first) / 2; - std::__move_median_first(__first, __mid, (__last - 1)); + std::__move_median_to_first(__first, __first + 1, __mid, __last - 1); return std::__unguarded_partition(__first + 1, __last, *__first); } @@ -2317,7 +2323,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _RandomAccessIterator __last, _Compare __comp) { _RandomAccessIterator __mid = __first + (__last - __first) / 2; - std::__move_median_first(__first, __mid, (__last - 1), __comp); + std::__move_median_to_first(__first, __first + 1, __mid, __last - 1, + __comp); return std::__unguarded_partition(__first + 1, __last, *__first, __comp); } diff --git a/contrib/gcc-4.7/libstdc++-v3/include/std/future b/contrib/gcc-4.7/libstdc++-v3/include/std/future index 98c7b84381..150c1afbc4 100644 --- a/contrib/gcc-4.7/libstdc++-v3/include/std/future +++ b/contrib/gcc-4.7/libstdc++-v3/include/std/future @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +// Copyright (C) 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -456,7 +456,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __setter(promise* __prom); template - static bool + static void _S_check(const shared_ptr<_Tp>& __p) { if (!static_cast(__p)) diff --git a/contrib/gcc-4.7/libstdc++-v3/include/tr2/bool_set b/contrib/gcc-4.7/libstdc++-v3/include/tr2/bool_set index f577ed0c76..7252a8067e 100644 --- a/contrib/gcc-4.7/libstdc++-v3/include/tr2/bool_set +++ b/contrib/gcc-4.7/libstdc++-v3/include/tr2/bool_set @@ -44,7 +44,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * bool_set * * See N2136, Bool_set: multi-valued logic - * by Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion. + * by Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion. * * The implicit conversion to bool is slippery! I may use the new * explicit conversion. This has been specialized in the language diff --git a/contrib/gcc-4.7/libstdc++-v3/libsupc++/eh_alloc.cc b/contrib/gcc-4.7/libstdc++-v3/libsupc++/eh_alloc.cc index 74474d82ec..9f4a52e1ee 100644 --- a/contrib/gcc-4.7/libstdc++-v3/libsupc++/eh_alloc.cc +++ b/contrib/gcc-4.7/libstdc++-v3/libsupc++/eh_alloc.cc @@ -126,12 +126,6 @@ __cxxabiv1::__cxa_allocate_exception(std::size_t thrown_size) _GLIBCXX_NOTHROW std::terminate (); } - // We have an uncaught exception as soon as we allocate memory. This - // yields uncaught_exception() true during the copy-constructor that - // initializes the exception object. See Issue 475. - __cxa_eh_globals *globals = __cxa_get_globals (); - globals->uncaughtExceptions += 1; - memset (ret, 0, sizeof (__cxa_refcounted_exception)); return (void *)((char *)ret + sizeof (__cxa_refcounted_exception)); @@ -188,12 +182,6 @@ __cxxabiv1::__cxa_allocate_dependent_exception() _GLIBCXX_NOTHROW std::terminate (); } - // We have an uncaught exception as soon as we allocate memory. This - // yields uncaught_exception() true during the copy-constructor that - // initializes the exception object. See Issue 475. - __cxa_eh_globals *globals = __cxa_get_globals (); - globals->uncaughtExceptions += 1; - memset (ret, 0, sizeof (__cxa_dependent_exception)); return ret; diff --git a/contrib/gcc-4.7/libstdc++-v3/libsupc++/eh_throw.cc b/contrib/gcc-4.7/libstdc++-v3/libsupc++/eh_throw.cc index de00602cde..5875948837 100644 --- a/contrib/gcc-4.7/libstdc++-v3/libsupc++/eh_throw.cc +++ b/contrib/gcc-4.7/libstdc++-v3/libsupc++/eh_throw.cc @@ -61,6 +61,9 @@ extern "C" void __cxxabiv1::__cxa_throw (void *obj, std::type_info *tinfo, void (_GLIBCXX_CDTOR_CALLABI *dest) (void *)) { + __cxa_eh_globals *globals = __cxa_get_globals (); + globals->uncaughtExceptions += 1; + // Definitely a primary. __cxa_refcounted_exception *header = __get_refcounted_exception_header_from_obj (obj); diff --git a/contrib/gcc-4.7/libstdc++-v3/src/c++11/future.cc b/contrib/gcc-4.7/libstdc++-v3/src/c++11/future.cc index 0552537261..61ae04d496 100644 --- a/contrib/gcc-4.7/libstdc++-v3/src/c++11/future.cc +++ b/contrib/gcc-4.7/libstdc++-v3/src/c++11/future.cc @@ -60,7 +60,7 @@ namespace const future_error_category& __future_category_instance() noexcept { - static const future_error_category __fec; + static const future_error_category __fec{}; return __fec; } } diff --git a/contrib/gcc-4.7/libstdc++-v3/src/c++11/system_error.cc b/contrib/gcc-4.7/libstdc++-v3/src/c++11/system_error.cc index 3ee1d9b0b0..fb0a0241c4 100644 --- a/contrib/gcc-4.7/libstdc++-v3/src/c++11/system_error.cc +++ b/contrib/gcc-4.7/libstdc++-v3/src/c++11/system_error.cc @@ -62,8 +62,8 @@ namespace } }; - const generic_error_category generic_category_instance; - const system_error_category system_category_instance; + const generic_error_category generic_category_instance{}; + const system_error_category system_category_instance{}; } namespace std _GLIBCXX_VISIBILITY(default) diff --git a/contrib/gcc-4.7/libstdc++-v3/src/c++98/compatibility.cc b/contrib/gcc-4.7/libstdc++-v3/src/c++98/compatibility.cc index 9f423d0e82..5ab8945a47 100644 --- a/contrib/gcc-4.7/libstdc++-v3/src/c++98/compatibility.cc +++ b/contrib/gcc-4.7/libstdc++-v3/src/c++98/compatibility.cc @@ -518,14 +518,21 @@ extern __attribute__((used, weak)) const char _ZTSe[2] = "e"; extern __attribute__((used, weak)) const char _ZTSPe[3] = "Pe"; extern __attribute__((used, weak)) const char _ZTSPKe[4] = "PKe"; extern __attribute__((used, weak)) const void * const _ZTIe[2] - = { (void *) &_ZTVN10__cxxabiv123__fundamental_type_infoE[2], - (void *) _ZTSe }; + = { reinterpret_cast + (&_ZTVN10__cxxabiv123__fundamental_type_infoE[2]), + reinterpret_cast(_ZTSe) }; extern __attribute__((used, weak)) const void * const _ZTIPe[4] - = { (void *) &_ZTVN10__cxxabiv119__pointer_type_infoE[2], - (void *) _ZTSPe, (void *) 0L, (void *) _ZTIe }; + = { reinterpret_cast + (&_ZTVN10__cxxabiv119__pointer_type_infoE[2]), + reinterpret_cast(_ZTSPe), + reinterpret_cast(0L), + reinterpret_cast(_ZTIe) }; extern __attribute__((used, weak)) const void * const _ZTIPKe[4] - = { (void *) &_ZTVN10__cxxabiv119__pointer_type_infoE[2], - (void *) _ZTSPKe, (void *) 1L, (void *) _ZTIe }; + = { reinterpret_cast + (&_ZTVN10__cxxabiv119__pointer_type_infoE[2]), + reinterpret_cast(_ZTSPKe), + reinterpret_cast(1L), + reinterpret_cast(_ZTIe) }; #endif // _GLIBCXX_LONG_DOUBLE_COMPAT #ifdef _GLIBCXX_SYMVER_DARWIN -- 2.41.0