summaryrefslogtreecommitdiffstats
path: root/contrib/gcc
diff options
context:
space:
mode:
authorray <ray@FreeBSD.org>2013-12-05 00:57:53 +0000
committerray <ray@FreeBSD.org>2013-12-05 00:57:53 +0000
commit1af064917e022f18acbf9fc2942cd40f1b26fbe5 (patch)
treeef10954b063bcd6939eabdcc7ecba95432634f70 /contrib/gcc
parent40d47a9dd8116c90080a010ab3483d8917bd0524 (diff)
parent6e411c7e1916ef76b0aa51ded38fa235d3313371 (diff)
downloadFreeBSD-src-1af064917e022f18acbf9fc2942cd40f1b26fbe5.zip
FreeBSD-src-1af064917e022f18acbf9fc2942cd40f1b26fbe5.tar.gz
MFC @r258947.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/ChangeLog.gcc43292
-rw-r--r--contrib/gcc/Makefile.in3
-rw-r--r--contrib/gcc/builtin-types.def7
-rw-r--r--contrib/gcc/builtins.c101
-rw-r--r--contrib/gcc/builtins.def2
-rw-r--r--contrib/gcc/c-common.c294
-rw-r--r--contrib/gcc/c-common.h2
-rw-r--r--contrib/gcc/c-decl.c78
-rw-r--r--contrib/gcc/c-opts.c33
-rw-r--r--contrib/gcc/c-ppoutput.c25
-rw-r--r--contrib/gcc/c-typeck.c31
-rw-r--r--contrib/gcc/c.opt20
-rw-r--r--contrib/gcc/cgraphunit.c2
-rw-r--r--contrib/gcc/collect2.c10
-rw-r--r--contrib/gcc/common.opt14
-rw-r--r--contrib/gcc/config/i386/beos-elf.h4
-rw-r--r--contrib/gcc/config/i386/cygwin.h2
-rw-r--r--contrib/gcc/config/i386/i386.c2
-rw-r--r--contrib/gcc/config/i386/i386.h2
-rw-r--r--contrib/gcc/config/i386/i386.md556
-rw-r--r--contrib/gcc/config/i386/nto.h2
-rw-r--r--contrib/gcc/config/rs6000/aix.h4
-rw-r--r--contrib/gcc/config/rs6000/rs6000.c223
-rw-r--r--contrib/gcc/config/rs6000/sysv4.h2
-rw-r--r--contrib/gcc/config/svr4.h6
-rwxr-xr-xcontrib/gcc/configure5
-rw-r--r--contrib/gcc/configure.ac5
-rw-r--r--contrib/gcc/coverage.c102
-rw-r--r--contrib/gcc/cp/ChangeLog.gcc4350
-rw-r--r--contrib/gcc/cp/cp-lang.c2
-rw-r--r--contrib/gcc/cp/cp-tree.h1
-rw-r--r--contrib/gcc/cp/decl.c35
-rw-r--r--contrib/gcc/cp/decl2.c13
-rw-r--r--contrib/gcc/cp/mangle.c18
-rw-r--r--contrib/gcc/cp/name-lookup.c24
-rw-r--r--contrib/gcc/cp/semantics.c4
-rw-r--r--contrib/gcc/cp/tree.c8
-rw-r--r--contrib/gcc/cp/typeck.c27
-rw-r--r--contrib/gcc/cppdefault.c2
-rw-r--r--contrib/gcc/doc/cppopts.texi16
-rw-r--r--contrib/gcc/doc/extend.texi35
-rw-r--r--contrib/gcc/doc/invoke.texi161
-rw-r--r--contrib/gcc/doc/libgcc.texi6
-rw-r--r--contrib/gcc/doc/rtl.texi5
-rw-r--r--contrib/gcc/dwarf2out.c46
-rw-r--r--contrib/gcc/expr.c145
-rw-r--r--contrib/gcc/final.c10
-rw-r--r--contrib/gcc/flags.h43
-rw-r--r--contrib/gcc/fold-const.c2
-rw-r--r--contrib/gcc/gcc.c4
-rw-r--r--contrib/gcc/genattrtab.c1
-rw-r--r--contrib/gcc/genopinit.c1
-rw-r--r--contrib/gcc/gimplify.c3
-rw-r--r--contrib/gcc/langhooks-def.h2
-rw-r--r--contrib/gcc/langhooks.h4
-rw-r--r--contrib/gcc/libgcc-std.ver7
-rw-r--r--contrib/gcc/libgcc2.c26
-rw-r--r--contrib/gcc/libgcc2.h2
-rw-r--r--contrib/gcc/mips-tdump.c4
-rw-r--r--contrib/gcc/mips-tfile.c4
-rw-r--r--contrib/gcc/mklibgcc.in2
-rw-r--r--contrib/gcc/optabs.c10
-rw-r--r--contrib/gcc/optabs.h3
-rw-r--r--contrib/gcc/opts.c381
-rw-r--r--contrib/gcc/postreload-gcse.c141
-rw-r--r--contrib/gcc/print-tree.c20
-rw-r--r--contrib/gcc/regs.h36
-rw-r--r--contrib/gcc/reload1.c2
-rw-r--r--contrib/gcc/rtl.def3
-rw-r--r--contrib/gcc/rtlanal.c4
-rw-r--r--contrib/gcc/simplify-rtx.c4
-rw-r--r--contrib/gcc/toplev.c4
-rw-r--r--contrib/gcc/tree-flow.h2
-rw-r--r--contrib/gcc/tree-ssa-alias-warnings.c1036
-rw-r--r--contrib/gcc/tree-ssa-alias.c5
-rw-r--r--contrib/gcc/tree-ssa-propagate.c22
-rw-r--r--contrib/gcc/tree-vrp.c10
-rw-r--r--contrib/gcc/tree.c88
-rw-r--r--contrib/gcc/tree.h53
-rw-r--r--contrib/gcc/varasm.c13
80 files changed, 3458 insertions, 921 deletions
diff --git a/contrib/gcc/ChangeLog.gcc43 b/contrib/gcc/ChangeLog.gcc43
index a3046ac..5c6701a 100644
--- a/contrib/gcc/ChangeLog.gcc43
+++ b/contrib/gcc/ChangeLog.gcc43
@@ -1,9 +1,96 @@
-2007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de> (r23479)
+2007-08-08 Andrew Haley <aph@redhat.com> (r128087)
+
+ * config/arm/libunwind.S (UNWIND_WRAPPER _Unwind_Backtrace): New.
+ * config/arm/unwind-arm.h (__gnu_Unwind_Backtrace): New.
+ * config/arm/unwind-arm.c (__gnu_Unwind_Backtrace): New.
+
+2007-07-12 Geoffrey Keating <geoffk@apple.com> (r126588)
+
+ * builtins.c (get_pointer_alignment): Honor DECL_ALIGN on a
+ FUNCTION_DECL.
+ * tree.c (build_decl_stat): Move code from here...
+ (make_node_stat): ... to here. Don't uselessly clear DECL_USER_ALIGN.
+ (expr_align): Honor DECL_ALIGN on a FUNCTION_DECL. Add comment
+ about using DECL_ALIGN of LABEL_DECL and CONST_DECL.
+ * tree.h (DECL_USER_ALIGN): Fix misplaced comment.
+ * varasm.c (assemble_start_function): Use DECL_ALIGN instead of
+ FUNCTION_BOUNDARY.
+
+2007-07-09 Geoffrey Keating <geoffk@apple.com> (r126529)
+
+ PR 32617
+ * c-common.c (c_alignof_expr): Look at DECL_ALIGN of
+ FUNCTION_DECLs.
+ (handle_aligned_attribute): Allow use on FUNCTION_DECLs.
+ * varasm.c (assemble_start_function): Honor DECL_ALIGN
+ for FUNCTION_DECLs. Don't use align_functions_log if
+ DECL_USER_ALIGN.
+ * print-tree.c (print_node): Print DECL_ALIGN and DECL_USER_ALIGN
+ even for FUNCTION_DECLs.
+ * c-decl.c (merge_decls): Propagate DECL_ALIGN even for
+ FUNCTION_DECLs.
+ * tree.h (DECL_ALIGN): Update for new location of 'align'.
+ (DECL_FUNCTION_CODE): Update for new location and name of
+ 'function_code'.
+ (DECL_OFFSET_ALIGN): Update for new location of 'off_align'.
+ (struct tree_decl_common): Move 'align' and 'off_align' out
+ of union, ensure they're still on a 32-bit boundary. Remove
+ other fields in union 'u1'.
+ (struct tree_function_decl): Add field 'function_code' replacing
+ 'u1.f' in tree_decl_common.
+ * tree.c (build_decl_stat): Set initial value of DECL_ALIGN.
+ * doc/extend.texi (Function Attributes): Add 'aligned' attribute.
+ (Variable Attributes): Cross-reference 'aligned' attribute
+ to Function Attributes.
+ * flags.h (force_align_functions_log): Delete.
+ * toplev.c (force_align_functions_log): Delete.
+
+2007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de> (r125346)
PR preprocessor/23479
* doc/extend.texi: Document the 0b-prefixed binary integer
constant extension.
+2007-05-31 Eric Christopher <echristo@apple.com> (r125246)
+
+ * expr.c (convert_move): Assert that we don't have a BLKmode
+ operand.
+ (store_expr): Handle BLKmode moves by calling emit_block_move.
+
+2007-05-27 Eric Christopher <echristo@apple.com> (r125116)
+
+ * config/rs6000/rs6000.c (rs6000_emit_prologue): Update
+ sp_offset depending on stack size. Save r12 depending
+ on registers we're saving later.
+ (rs6000_emit_epilogue): Update sp_offset depending only
+ on stack size.
+
+2007-05-24 Richard Sandiford <rsandifo@nildram.co.uk> (r125037)
+
+ * postreload-gcse.c (reg_changed_after_insn_p): New function.
+ (oprs_unchanged_p): Use it to check all registers in a REG.
+ (record_opr_changes): Look for clobbers in CALL_INSN_FUNCTION_USAGE.
+ (reg_set_between_after_reload_p): Delete.
+ (reg_used_between_after_reload_p): Likewise.
+ (reg_set_or_used_since_bb_start): Likewise.
+ (eliminate_partially_redundant_load): Use reg_changed_after_insn_p
+ and reg_used_between_p instead of reg_set_or_used_since_bb_start.
+ Use reg_set_between_p instead of reg_set_between_after_reload_p.
+ * rtlanal.c (reg_set_p): Check whether REG overlaps
+ regs_invalidated_by_call, rather than just checking the
+ membership of REGNO (REG).
+
+2007-05-16 Eric Christopher <echristo@apple.com> (r124763)
+
+ * config/rs6000/rs6000.c (rs6000_emit_prologue): Move altivec register
+ saving after stack push. Set sp_offset whenever we push.
+ (rs6000_emit_epilogue): Move altivec register restore before stack push.
+
+2007-05-03 Ian Lance Taylor <iant@google.com> (r124381)
+
+ * config/rs6000/rs6000.c (rs6000_override_options): Don't set
+ MASK_PPC_GFXOPT for 8540 or 8548.
+
2007-05-01 Dwarakanath Rajagopal <dwarak.rajagopal@amd.com> (r124341)
* doc/invoke.texi: Fix typo, 'AMD Family 10h core' instead of
@@ -22,6 +109,63 @@
alignment for amdfam10 architecture. Increasing the max loop
alignment to 24 bytes.
+2007-04-16 Lawrence Crowl <crowl@google.com> (r123909)
+
+ * doc/invoke.texi (Debugging Options): Add documentation for the
+ -femit-struct-debug options -femit-struct-debug-baseonly,
+ -femit-struct-debug-reduced, and
+ -femit-struct-debug-detailed[=...].
+
+ * c-opts.c (c_common_handle_option): Add
+ OPT_femit_struct_debug_baseonly, OPT_femit_struct_debug_reduced,
+ and OPT_femit_struct_debug_detailed_.
+ * c.opt: Add specifications for
+ -femit-struct-debug-baseonly, -femit-struct-debug-reduced,
+ and -femit-struct-debug-detailed[=...].
+ * opts.c (set_struct_debug_option): Parse the
+ -femit-struct-debug-... options.
+ * opts.c (matches_main_base, main_input_basename,
+ main_input_baselength, base_of_path, matches_main_base): Add
+ variables and functions to compare header base name to compilation
+ unit base name.
+ * opts.c (should_emit_struct_debug): Add to determine to emit a
+ structure based on the option.
+ (dump_struct_debug) Also disabled function to debug this
+ function.
+ * opts.c (handle_options): Save the base name of the
+ compilation unit.
+
+ * langhooks-def.h (LANG_HOOKS_GENERIC_TYPE_P): Define.
+ (LANG_HOOKS_FOR_TYPES_INITIALIZER): Add.
+ This hook indicates if a type is generic. Set it by default
+ to "never generic".
+ * langhooks.h (struct lang_hooks_for_types): Add a new hook
+ to determine if a struct type is generic or not.
+ * cp/cp-tree.h (class_tmpl_impl_spec_p): Declare a C++ hook.
+ * cp/tree.c (class_tmpl_impl_spec_p): Implement the C++ hook.
+ * cp/cp-lang.c (LANG_HOOKS_GENERIC_TYPE_P): Override null C hook
+ with live C++ hook.
+
+ * flags.h (enum debug_info_usage): Add an enumeration to describe
+ a program's use of a structure type.
+ * dwarf2out.c (gen_struct_or_union_type_die): Add a new parameter
+ to indicate the program's usage of the type. Filter structs based
+ on the -femit-struct-debug-... specification.
+ (gen_type_die): Split into two routines, gen_type_die and
+ gen_type_die_with_usage. gen_type_die is now a wrapper
+ that assumes direct usage.
+ (gen_type_die_with_usage): Replace calls to gen_type_die
+ with gen_type_die_with_usage adding the program usage of
+ the referenced type.
+ (dwarf2out_imported_module_or_decl): Suppress struct debug
+ information using should_emit_struct_debug when appropriate.
+
+2007-04-16 Ian Lance Taylor <iant@google.com> (r123906)
+
+ * tree-ssa-propagate.c (cfg_blocks_add): Insert blocks with fewer
+ predecessors at head rather than tail.
+
+
2007-04-12 Richard Guenther <rguenther@suse.de> (r123736)
PR tree-optimization/24689
@@ -44,6 +188,19 @@
* config/i386/i386.c (override_options): Likewise.
* doc/invoke.texi: Likewise.
+2007-03-12 Seongbae Park <seongbae.park@gmail.com> (r122851)
+
+ * c-decl.c (warn_variable_length_array): New function.
+ Refactored from grokdeclarator to handle warn_vla
+ and handle unnamed array case.
+ (grokdeclarator): Refactored VLA warning case.
+ * c.opt (Wvla): New flag.
+
+2007-03-11 Ian Lance Taylor <iant@google.com> (r122831 - partial)
+
+ * tree-vrp.c (vrp_int_const_binop): Handle PLUS_EXPR and
+ the *_DIV_EXPR codes correctly with overflow infinities.
+
2007-02-09 Dwarakanath Rajagopal <dwarak.rajagopal@amd.com> (r121763)
* config/i386/driver-i386.c: Turn on -mtune=native for AMDFAM10.
@@ -232,6 +389,16 @@
* config.gcc: Support core2 processor.
+2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org> (r120505)
+
+ PR c/19978
+ * tree.h (TREE_OVERFLOW_P): New.
+ * c-typeck.c (parser_build_unary_op): Warn only if result
+ overflowed and operands did not.
+ (parser_build_binary_op): Likewise.
+ (convert_for_assignment): Remove redundant overflow_warning.
+ * c-common.c (overflow_warning): Don't check or set TREE_OVERFLOW.
+
2006-12-13 Ian Lance Taylor <iant@google.com> (r119855)
PR c++/19564
@@ -243,6 +410,28 @@
* doc/invoke.texi (Warning Options): Update -Wparentheses
description.
+2006-12-12 Geoffrey Keating <geoffk@apple.com> (r119820)
+
+ * mips-tdump.c: Replace CROSS_COMPILE with
+ CROSS_DIRECTORY_STRUCTURE.
+ * mips-tfile.c: Likewise.
+ * gcc.c: Likewise.
+ * configure.ac: Likewise.
+ * cppdefault.c: Likewise.
+ * Makefile.in: Likewise.
+ * config/alpha/osf.h: Likewise.
+ * config/i386/cygwin.h: Likewise.
+ * config/i386/beos-elf.h: Likewise.
+ * config/i386/nto.h: Likewise.
+ * config/svr4.h: Likewise.
+ * config/rs6000/aix.h: Likewise.
+ * config/rs6000/sysv4.h: Likewise.
+ * collect2.c: Likewise.
+ * configure: Regenerate.
+
+ * doc/tm.texi (Alignment Output): Document that ASM_OUTPUT_SKIP
+ actually takes an unsigned HOST_WIDE_INT for its second parameter.
+
2006-12-02 H.J. Lu <hongjiu.lu@intel.com> (r119454 - partial)
PR target/30040
@@ -281,6 +470,59 @@
(override_options): Add entries for Core2.
(ix86_issue_rate): Add case for Core2.
+2006-11-07 Eric Christopher <echristo@apple.com> (r118576)
+
+ * libgcc2.c (__bswapdi2): Rename from bswapDI2.
+ (__bswapsi2): Ditto.
+ * libgcc2.h: Remove transformation of bswap routines.
+ * config/i386/i386.md (bswapsi2): New.
+ (bswapdi2): Ditto.
+
+2006-10-31 Geoffrey Keating <geoffk@apple.com> (r118360)
+
+ * coverage.c (coverage_checksum_string): Update comment.
+ * dwarf2out.c (switch_to_eh_frame_section): Update for removal
+ of get_file_function_name.
+ * cgraphunit.c (cgraph_build_static_cdtor): Update for rename
+ of get_file_function_name_long.
+ * tree.c (get_file_function_name): Rename from
+ get_file_function_name_long; improve comment; handle 'I' and 'D'
+ specially when the target has ctor/dtor support; remove special
+ handling for 'F'.
+ (get_file_function_name): Remove.
+ * tree.h (get_file_function_name): Rename from
+ get_file_function_name_long.
+ (get_file_function_name): Remove prototype.
+
+2006-10-31 Geoffrey Keating <geoffk@apple.com> (r118356)
+
+ * c-decl.c (grokdeclarator): Don't set DECL_EXTERNAL on
+ inline static functions in c99 mode.
+
+ PR 16622
+ * doc/extend.texi (Inline): Update.
+ * c-tree.h (struct language_function): Remove field 'extern_inline'.
+ * c-decl.c (current_extern_inline): Delete.
+ (pop_scope): Adjust test for an undefined nested function.
+ Add warning about undeclared inline function.
+ (diagnose_mismatched_decls): Update comments. Disallow overriding
+ of inline functions in a translation unit in C99. Allow inline
+ declarations in C99 at any time.
+ (merge_decls): Boolize variables. Handle C99 'extern inline'
+ semantics.
+ (grokdeclarator): Set DECL_EXTERNAL here for functions. Handle
+ C99 inline semantics.
+ (start_function): Don't clear current_extern_inline. Don't set
+ DECL_EXTERNAL.
+ (c_push_function_context): Don't push current_extern_inline.
+ (c_pop_function_context): Don't restore current_extern_inline.
+
+ PR 11377
+ * c-typeck.c (build_external_ref): Warn about static variables
+ used in extern inline functions.
+ * c-decl.c (start_decl): Warn about static variables declared
+ in extern inline functions.
+
2006-10-27 Vladimir Makarov <vmakarov@redhat.com> (r118090)
* config/i386/i386.h (TARGET_GEODE):
@@ -402,3 +644,51 @@
* builtins.c (fold_builtin_classify): Fix typo.
+2006-09-07 Eric Christopher <echristo@apple.com> (r118361)
+ Falk Hueffner <falk@debian.org>
+
+ * doc/extend.texi (__builtin_bswap32): Document.
+ (__builtin_bswap64): Ditto.
+ * doc/libgcc.texi (bswapsi2): Document.
+ (bswapdi2): Ditto.
+ * doc/rtl.texi (bswap): Document.
+ * optabs.c (expand_unop): Don't widen a bswap.
+ (init_optabs): Init bswap. Set libfuncs explicitly
+ for bswapsi2 and bswapdi2.
+ * optabs.h (OTI_bswap): New.
+ (bswap_optab): Ditto.
+ * genopinit.c (optabs): Handle bswap_optab.
+ * tree.h (tree_index): Add TI_UINT32_TYPE and
+ TI_UINT64_TYPE.
+ (uint32_type_node): New.
+ (uint64_type_node): Ditto.
+ * tree.c (build_common_tree_nodes_2): Initialize
+ uint32_type_node and uint64_type_node.
+ * builtins.c (expand_builtin_bswap): New.
+ (expand_builtin): Call.
+ (fold_builtin_bswap): New.
+ (fold_builtin_1): Call.
+ * fold-const.c (tree_expr_nonnegative_p): Return true
+ for bswap.
+ * builtin-types.def (BT_UINT32): New.
+ (BT_UINT64): Ditto.
+ (BT_FN_UINT32_UINT32): Ditto.
+ (BT_FN_UINT64_UINT64): Ditto.
+ * builtins.def (BUILT_IN_BSWAP32): New.
+ (BUILT_IN_BSWAP64): Ditto.
+ * rtl.def (BSWAP): New.
+ * genattrtab.c (check_attr_value): New.
+ * libgcc2.c (__bswapSI2): New.
+ (__bswapDI2): Ditto.
+ * libgcc2.h (__bswapSI2): Declare.
+ (__bswapDI2): Ditto.
+ * mklibgcc.in (lib2funcs): Add _bswapsi2 and _bswapdi2.
+ * simplify-rtx.c (simplify_const_unary_operation): Return
+ 0 for BSWAP.
+ * libgcc-std.ver (__bwapsi2): Add.
+ (__bswapdi2): Ditto.
+ * reload1.c (eliminate_regs_1): Add bswap.
+ (elimination_effects): Ditto.
+ * config/i386/i386.h (x86_bswap): New.
+ (TARGET_BSWAP): Use.
+ * config/i386/i386.c (x86_bswap): Set.
diff --git a/contrib/gcc/Makefile.in b/contrib/gcc/Makefile.in
index 0f0ce9b..eb19c2d 100644
--- a/contrib/gcc/Makefile.in
+++ b/contrib/gcc/Makefile.in
@@ -822,7 +822,8 @@ REAL_H = real.h $(MACHMODE_H)
# IN_GCC distinguishes between code compiled into GCC itself and other
# programs built during a bootstrap.
-# autoconf inserts -DCROSS_COMPILE if we are building a cross compiler.
+# autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a
+# cross compiler which does not use the native headers and libraries.
INTERNAL_CFLAGS = -DIN_GCC @CROSS@
# This is the variable actually used when we compile. If you change this,
diff --git a/contrib/gcc/builtin-types.def b/contrib/gcc/builtin-types.def
index d6330b1..5d42b2e 100644
--- a/contrib/gcc/builtin-types.def
+++ b/contrib/gcc/builtin-types.def
@@ -75,6 +75,8 @@ DEF_PRIMITIVE_TYPE (BT_LONGLONG, long_long_integer_type_node)
DEF_PRIMITIVE_TYPE (BT_ULONGLONG, long_long_unsigned_type_node)
DEF_PRIMITIVE_TYPE (BT_INTMAX, intmax_type_node)
DEF_PRIMITIVE_TYPE (BT_UINTMAX, uintmax_type_node)
+DEF_PRIMITIVE_TYPE (BT_UINT32, uint32_type_node)
+DEF_PRIMITIVE_TYPE (BT_UINT64, uint64_type_node)
DEF_PRIMITIVE_TYPE (BT_WORD, (*lang_hooks.types.type_for_mode) (word_mode, 0))
DEF_PRIMITIVE_TYPE (BT_FLOAT, float_type_node)
DEF_PRIMITIVE_TYPE (BT_DOUBLE, double_type_node)
@@ -204,6 +206,10 @@ DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT128_DFLOAT128, BT_DFLOAT128, BT_DFLOAT128)
DEF_FUNCTION_TYPE_1 (BT_FN_VOID_VPTR, BT_VOID, BT_VOLATILE_PTR)
DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTRPTR, BT_VOID, BT_PTR_PTR)
DEF_FUNCTION_TYPE_1 (BT_FN_UINT_UINT, BT_UINT, BT_UINT)
+DEF_FUNCTION_TYPE_1 (BT_FN_ULONG_ULONG, BT_ULONG, BT_ULONG)
+DEF_FUNCTION_TYPE_1 (BT_FN_ULONGLONG_ULONGLONG, BT_ULONGLONG, BT_ULONGLONG)
+DEF_FUNCTION_TYPE_1 (BT_FN_UINT32_UINT32, BT_UINT32, BT_UINT32)
+DEF_FUNCTION_TYPE_1 (BT_FN_UINT64_UINT64, BT_UINT64, BT_UINT64)
DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR, BT_FN_VOID_PTR)
@@ -435,4 +441,3 @@ DEF_FUNCTION_TYPE_VAR_5 (BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VAR,
DEF_POINTER_TYPE (BT_PTR_FN_VOID_VAR, BT_FN_VOID_VAR)
DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE,
BT_PTR, BT_PTR_FN_VOID_VAR, BT_PTR, BT_SIZE)
-
diff --git a/contrib/gcc/builtins.c b/contrib/gcc/builtins.c
index a65d725..88c4668 100644
--- a/contrib/gcc/builtins.c
+++ b/contrib/gcc/builtins.c
@@ -315,9 +315,7 @@ get_pointer_alignment (tree exp, unsigned int max_align)
else if (offset)
inner = MIN (inner, BITS_PER_UNIT);
}
- if (TREE_CODE (exp) == FUNCTION_DECL)
- align = FUNCTION_BOUNDARY;
- else if (DECL_P (exp))
+ if (DECL_P (exp))
align = MIN (inner, DECL_ALIGN (exp));
#ifdef CONSTANT_ALIGNMENT
else if (CONSTANT_CLASS_P (exp))
@@ -4589,6 +4587,30 @@ expand_builtin_alloca (tree arglist, rtx target)
return result;
}
+/* Expand a call to a bswap builtin. The arguments are in ARGLIST. MODE
+ is the mode to expand with. */
+
+static rtx
+expand_builtin_bswap (tree arglist, rtx target, rtx subtarget)
+{
+ enum machine_mode mode;
+ tree arg;
+ rtx op0;
+
+ if (!validate_arglist (arglist, INTEGER_TYPE, VOID_TYPE))
+ return 0;
+
+ arg = TREE_VALUE (arglist);
+ mode = TYPE_MODE (TREE_TYPE (arg));
+ op0 = expand_expr (arg, subtarget, VOIDmode, 0);
+
+ target = expand_unop (mode, bswap_optab, op0, target, 1);
+
+ gcc_assert (target);
+
+ return convert_to_mode (mode, target, 0);
+}
+
/* Expand a call to a unary builtin. The arguments are in ARGLIST.
Return 0 if a normal call should be emitted rather than expanding the
function in-line. If convenient, the result should be placed in TARGET.
@@ -5877,6 +5899,14 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
expand_stack_restore (TREE_VALUE (arglist));
return const0_rtx;
+ case BUILT_IN_BSWAP32:
+ case BUILT_IN_BSWAP64:
+ target = expand_builtin_bswap (arglist, target, subtarget);
+
+ if (target)
+ return target;
+ break;
+
CASE_INT_FN (BUILT_IN_FFS):
case BUILT_IN_FFSIMAX:
target = expand_builtin_unop (target_mode, arglist, target,
@@ -7539,6 +7569,67 @@ fold_builtin_bitop (tree fndecl, tree arglist)
return NULL_TREE;
}
+/* Fold function call to builtin_bswap and the long and long long
+ variants. Return NULL_TREE if no simplification can be made. */
+static tree
+fold_builtin_bswap (tree fndecl, tree arglist)
+{
+ tree arg;
+
+ if (! validate_arglist (arglist, INTEGER_TYPE, VOID_TYPE))
+ return 0;
+
+ /* Optimize constant value. */
+ arg = TREE_VALUE (arglist);
+ if (TREE_CODE (arg) == INTEGER_CST && ! TREE_CONSTANT_OVERFLOW (arg))
+ {
+ HOST_WIDE_INT hi, width, r_hi = 0;
+ unsigned HOST_WIDE_INT lo, r_lo = 0;
+ tree type;
+
+ type = TREE_TYPE (arg);
+ width = TYPE_PRECISION (type);
+ lo = TREE_INT_CST_LOW (arg);
+ hi = TREE_INT_CST_HIGH (arg);
+
+ switch (DECL_FUNCTION_CODE (fndecl))
+ {
+ case BUILT_IN_BSWAP32:
+ case BUILT_IN_BSWAP64:
+ {
+ int s;
+
+ for (s = 0; s < width; s += 8)
+ {
+ int d = width - s - 8;
+ unsigned HOST_WIDE_INT byte;
+
+ if (s < HOST_BITS_PER_WIDE_INT)
+ byte = (lo >> s) & 0xff;
+ else
+ byte = (hi >> (s - HOST_BITS_PER_WIDE_INT)) & 0xff;
+
+ if (d < HOST_BITS_PER_WIDE_INT)
+ r_lo |= byte << d;
+ else
+ r_hi |= byte << (d - HOST_BITS_PER_WIDE_INT);
+ }
+ }
+
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
+ if (width < HOST_BITS_PER_WIDE_INT)
+ return build_int_cst (TREE_TYPE (TREE_TYPE (fndecl)), r_lo);
+ else
+ return build_int_cst_wide (TREE_TYPE (TREE_TYPE (fndecl)), r_lo, r_hi);
+ }
+
+ return NULL_TREE;
+}
/* Return true if EXPR is the real constant contained in VALUE. */
static bool
@@ -9053,6 +9144,10 @@ fold_builtin_1 (tree fndecl, tree arglist, bool ignore)
CASE_FLT_FN (BUILT_IN_LLRINT):
return fold_fixed_mathfn (fndecl, arglist);
+ case BUILT_IN_BSWAP32:
+ case BUILT_IN_BSWAP64:
+ return fold_builtin_bswap (fndecl, arglist);
+
CASE_INT_FN (BUILT_IN_FFS):
CASE_INT_FN (BUILT_IN_CLZ):
CASE_INT_FN (BUILT_IN_CTZ):
diff --git a/contrib/gcc/builtins.def b/contrib/gcc/builtins.def
index 37ea28c09..7c1f2ef 100644
--- a/contrib/gcc/builtins.def
+++ b/contrib/gcc/builtins.def
@@ -594,6 +594,8 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_ALLOCA, "alloca", BT_FN_PTR_SIZE, ATTR_MALLOC_N
DEF_GCC_BUILTIN (BUILT_IN_APPLY, "apply", BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE, ATTR_NULL)
DEF_GCC_BUILTIN (BUILT_IN_APPLY_ARGS, "apply_args", BT_FN_PTR_VAR, ATTR_NULL)
DEF_GCC_BUILTIN (BUILT_IN_ARGS_INFO, "args_info", BT_FN_INT_INT, ATTR_NULL)
+DEF_GCC_BUILTIN (BUILT_IN_BSWAP32, "bswap32", BT_FN_UINT32_UINT32, ATTR_CONST_NOTHROW_LIST)
+DEF_GCC_BUILTIN (BUILT_IN_BSWAP64, "bswap64", BT_FN_UINT64_UINT64, ATTR_CONST_NOTHROW_LIST)
DEF_LIB_BUILTIN (BUILT_IN_CALLOC, "calloc", BT_FN_PTR_SIZE_SIZE, ATTR_MALLOC_NOTHROW_LIST)
DEF_GCC_BUILTIN (BUILT_IN_CLASSIFY_TYPE, "classify_type", BT_FN_INT_VAR, ATTR_NULL)
DEF_GCC_BUILTIN (BUILT_IN_CLZ, "clz", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST)
diff --git a/contrib/gcc/c-common.c b/contrib/gcc/c-common.c
index 9a04130..fa89614 100644
--- a/contrib/gcc/c-common.c
+++ b/contrib/gcc/c-common.c
@@ -916,39 +916,45 @@ constant_expression_warning (tree value)
pedwarn ("overflow in constant expression");
}
-/* Print a warning if an expression had overflow in folding.
+/* Print a warning if an expression had overflow in folding and its
+ operands hadn't.
+
Invoke this function on every expression that
(1) appears in the source code, and
- (2) might be a constant expression that overflowed, and
+ (2) is a constant expression that overflowed, and
(3) is not already checked by convert_and_check;
- however, do not invoke this function on operands of explicit casts. */
+ however, do not invoke this function on operands of explicit casts
+ or when the expression is the result of an operator and any operand
+ already overflowed. */
void
overflow_warning (tree value)
{
- if ((TREE_CODE (value) == INTEGER_CST
- || (TREE_CODE (value) == COMPLEX_CST
- && TREE_CODE (TREE_REALPART (value)) == INTEGER_CST))
- && TREE_OVERFLOW (value))
- {
- TREE_OVERFLOW (value) = 0;
- if (skip_evaluation == 0)
- warning (OPT_Woverflow, "integer overflow in expression");
- }
- else if ((TREE_CODE (value) == REAL_CST
- || (TREE_CODE (value) == COMPLEX_CST
- && TREE_CODE (TREE_REALPART (value)) == REAL_CST))
- && TREE_OVERFLOW (value))
- {
- TREE_OVERFLOW (value) = 0;
- if (skip_evaluation == 0)
- warning (OPT_Woverflow, "floating point overflow in expression");
- }
- else if (TREE_CODE (value) == VECTOR_CST && TREE_OVERFLOW (value))
+ if (skip_evaluation) return;
+
+ switch (TREE_CODE (value))
{
- TREE_OVERFLOW (value) = 0;
- if (skip_evaluation == 0)
- warning (OPT_Woverflow, "vector overflow in expression");
+ case INTEGER_CST:
+ warning (OPT_Woverflow, "integer overflow in expression");
+ break;
+
+ case REAL_CST:
+ warning (OPT_Woverflow, "floating point overflow in expression");
+ break;
+
+ case VECTOR_CST:
+ warning (OPT_Woverflow, "vector overflow in expression");
+ break;
+
+ case COMPLEX_CST:
+ if (TREE_CODE (TREE_REALPART (value)) == INTEGER_CST)
+ warning (OPT_Woverflow, "complex integer overflow in expression");
+ else if (TREE_CODE (TREE_REALPART (value)) == REAL_CST)
+ warning (OPT_Woverflow, "complex floating point overflow in expression");
+ break;
+
+ default:
+ break;
}
}
@@ -983,35 +989,67 @@ unsigned_conversion_warning (tree result, tree operand)
strict aliasing mode is in effect. OTYPE is the original
TREE_TYPE of EXPR, and TYPE the type we're casting to. */
-void
+bool
strict_aliasing_warning (tree otype, tree type, tree expr)
{
- if (flag_strict_aliasing && warn_strict_aliasing
- && POINTER_TYPE_P (type) && POINTER_TYPE_P (otype)
- && TREE_CODE (expr) == ADDR_EXPR
+ if (!(flag_strict_aliasing && POINTER_TYPE_P (type)
+ && POINTER_TYPE_P (otype) && !VOID_TYPE_P (TREE_TYPE (type))))
+ return false;
+
+ if ((warn_strict_aliasing > 1) && TREE_CODE (expr) == ADDR_EXPR
&& (DECL_P (TREE_OPERAND (expr, 0))
- || handled_component_p (TREE_OPERAND (expr, 0)))
- && !VOID_TYPE_P (TREE_TYPE (type)))
+ || handled_component_p (TREE_OPERAND (expr, 0))))
{
/* Casting the address of an object to non void pointer. Warn
if the cast breaks type based aliasing. */
- if (!COMPLETE_TYPE_P (TREE_TYPE (type)))
- warning (OPT_Wstrict_aliasing, "type-punning to incomplete type "
- "might break strict-aliasing rules");
+ if (!COMPLETE_TYPE_P (TREE_TYPE (type)) && warn_strict_aliasing == 2)
+ {
+ warning (OPT_Wstrict_aliasing, "type-punning to incomplete type "
+ "might break strict-aliasing rules");
+ return true;
+ }
else
{
- HOST_WIDE_INT set1 = get_alias_set (TREE_TYPE (TREE_OPERAND (expr, 0)));
+ /* warn_strict_aliasing >= 3. This includes the default (3).
+ Only warn if the cast is dereferenced immediately. */
+ HOST_WIDE_INT set1 =
+ get_alias_set (TREE_TYPE (TREE_OPERAND (expr, 0)));
HOST_WIDE_INT set2 = get_alias_set (TREE_TYPE (type));
if (!alias_sets_conflict_p (set1, set2))
- warning (OPT_Wstrict_aliasing, "dereferencing type-punned "
- "pointer will break strict-aliasing rules");
- else if (warn_strict_aliasing > 1
- && !alias_sets_might_conflict_p (set1, set2))
- warning (OPT_Wstrict_aliasing, "dereferencing type-punned "
- "pointer might break strict-aliasing rules");
+ {
+ warning (OPT_Wstrict_aliasing, "dereferencing type-punned "
+ "pointer will break strict-aliasing rules");
+ return true;
+ }
+ else if (warn_strict_aliasing == 2
+ && !alias_sets_might_conflict_p (set1, set2))
+ {
+ warning (OPT_Wstrict_aliasing, "dereferencing type-punned "
+ "pointer might break strict-aliasing rules");
+ return true;
+ }
}
}
+ else
+ if ((warn_strict_aliasing == 1) && !VOID_TYPE_P (TREE_TYPE (otype)))
+ {
+ /* At this level, warn for any conversions, even if an address is
+ not taken in the same statement. This will likely produce many
+ false positives, but could be useful to pinpoint problems that
+ are not revealed at higher levels. */
+ HOST_WIDE_INT set1 = get_alias_set (TREE_TYPE (otype));
+ HOST_WIDE_INT set2 = get_alias_set (TREE_TYPE (type));
+ if (!COMPLETE_TYPE_P(type)
+ || !alias_sets_might_conflict_p (set1, set2))
+ {
+ warning (OPT_Wstrict_aliasing, "dereferencing type-punned "
+ "pointer might break strict-aliasing rules");
+ return true;
+ }
+ }
+
+ return false;
}
@@ -2957,16 +2995,16 @@ c_sizeof_or_alignof_type (tree type, bool is_sizeof, int complain)
}
/* Implement the __alignof keyword: Return the minimum required
- alignment of EXPR, measured in bytes. For VAR_DECL's and
- FIELD_DECL's return DECL_ALIGN (which can be set from an
- "aligned" __attribute__ specification). */
+ alignment of EXPR, measured in bytes. For VAR_DECLs,
+ FUNCTION_DECLs and FIELD_DECLs return DECL_ALIGN (which can be set
+ from an "aligned" __attribute__ specification). */
tree
c_alignof_expr (tree expr)
{
tree t;
- if (TREE_CODE (expr) == VAR_DECL)
+ if (VAR_OR_FUNCTION_DECL_P (expr))
t = size_int (DECL_ALIGN_UNIT (expr));
else if (TREE_CODE (expr) == COMPONENT_REF
@@ -3108,6 +3146,85 @@ def_fn_type (builtin_type def, builtin_type ret, bool var, int n, ...)
builtin_types[def] = t;
}
+/* Build builtin functions common to both C and C++ language
+ frontends. */
+
+static void
+c_define_builtins (tree va_list_ref_type_node, tree va_list_arg_type_node)
+{
+#define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \
+ builtin_types[ENUM] = VALUE;
+#define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \
+ def_fn_type (ENUM, RETURN, 0, 0);
+#define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1) \
+ def_fn_type (ENUM, RETURN, 0, 1, ARG1);
+#define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \
+ def_fn_type (ENUM, RETURN, 0, 2, ARG1, ARG2);
+#define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3) \
+ def_fn_type (ENUM, RETURN, 0, 3, ARG1, ARG2, ARG3);
+#define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \
+ def_fn_type (ENUM, RETURN, 0, 4, ARG1, ARG2, ARG3, ARG4);
+#define DEF_FUNCTION_TYPE_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
+ def_fn_type (ENUM, RETURN, 0, 5, ARG1, ARG2, ARG3, ARG4, ARG5);
+#define DEF_FUNCTION_TYPE_6(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
+ ARG6) \
+ def_fn_type (ENUM, RETURN, 0, 6, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6);
+#define DEF_FUNCTION_TYPE_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
+ ARG6, ARG7) \
+ def_fn_type (ENUM, RETURN, 0, 7, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7);
+#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \
+ def_fn_type (ENUM, RETURN, 1, 0);
+#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \
+ def_fn_type (ENUM, RETURN, 1, 1, ARG1);
+#define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \
+ def_fn_type (ENUM, RETURN, 1, 2, ARG1, ARG2);
+#define DEF_FUNCTION_TYPE_VAR_3(ENUM, RETURN, ARG1, ARG2, ARG3) \
+ def_fn_type (ENUM, RETURN, 1, 3, ARG1, ARG2, ARG3);
+#define DEF_FUNCTION_TYPE_VAR_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \
+ def_fn_type (ENUM, RETURN, 1, 4, ARG1, ARG2, ARG3, ARG4);
+#define DEF_FUNCTION_TYPE_VAR_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
+ def_fn_type (ENUM, RETURN, 1, 5, ARG1, ARG2, ARG3, ARG4, ARG5);
+#define DEF_POINTER_TYPE(ENUM, TYPE) \
+ builtin_types[(int) ENUM] = build_pointer_type (builtin_types[(int) TYPE]);
+
+#include "builtin-types.def"
+
+#undef DEF_PRIMITIVE_TYPE
+#undef DEF_FUNCTION_TYPE_1
+#undef DEF_FUNCTION_TYPE_2
+#undef DEF_FUNCTION_TYPE_3
+#undef DEF_FUNCTION_TYPE_4
+#undef DEF_FUNCTION_TYPE_5
+#undef DEF_FUNCTION_TYPE_6
+#undef DEF_FUNCTION_TYPE_VAR_0
+#undef DEF_FUNCTION_TYPE_VAR_1
+#undef DEF_FUNCTION_TYPE_VAR_2
+#undef DEF_FUNCTION_TYPE_VAR_3
+#undef DEF_FUNCTION_TYPE_VAR_4
+#undef DEF_FUNCTION_TYPE_VAR_5
+#undef DEF_POINTER_TYPE
+ builtin_types[(int) BT_LAST] = NULL_TREE;
+
+ c_init_attributes ();
+
+#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P, \
+ NONANSI_P, ATTRS, IMPLICIT, COND) \
+ if (NAME && COND) \
+ def_builtin_1 (ENUM, NAME, CLASS, \
+ builtin_types[(int) TYPE], \
+ builtin_types[(int) LIBTYPE], \
+ BOTH_P, FALLBACK_P, NONANSI_P, \
+ built_in_attributes[(int) ATTRS], IMPLICIT);
+#include "builtins.def"
+#undef DEF_BUILTIN
+
+ build_common_builtin_nodes ();
+
+ targetm.init_builtins ();
+ if (flag_mudflap)
+ mudflap_init ();
+}
+
/* Build tree nodes and builtin functions common to both C and C++ language
frontends. */
@@ -3320,77 +3437,8 @@ c_common_nodes_and_builtins (void)
va_list_ref_type_node = build_reference_type (va_list_type_node);
}
-#define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \
- builtin_types[ENUM] = VALUE;
-#define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \
- def_fn_type (ENUM, RETURN, 0, 0);
-#define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1) \
- def_fn_type (ENUM, RETURN, 0, 1, ARG1);
-#define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \
- def_fn_type (ENUM, RETURN, 0, 2, ARG1, ARG2);
-#define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3) \
- def_fn_type (ENUM, RETURN, 0, 3, ARG1, ARG2, ARG3);
-#define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \
- def_fn_type (ENUM, RETURN, 0, 4, ARG1, ARG2, ARG3, ARG4);
-#define DEF_FUNCTION_TYPE_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
- def_fn_type (ENUM, RETURN, 0, 5, ARG1, ARG2, ARG3, ARG4, ARG5);
-#define DEF_FUNCTION_TYPE_6(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
- ARG6) \
- def_fn_type (ENUM, RETURN, 0, 6, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6);
-#define DEF_FUNCTION_TYPE_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
- ARG6, ARG7) \
- def_fn_type (ENUM, RETURN, 0, 7, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7);
-#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \
- def_fn_type (ENUM, RETURN, 1, 0);
-#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \
- def_fn_type (ENUM, RETURN, 1, 1, ARG1);
-#define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \
- def_fn_type (ENUM, RETURN, 1, 2, ARG1, ARG2);
-#define DEF_FUNCTION_TYPE_VAR_3(ENUM, RETURN, ARG1, ARG2, ARG3) \
- def_fn_type (ENUM, RETURN, 1, 3, ARG1, ARG2, ARG3);
-#define DEF_FUNCTION_TYPE_VAR_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \
- def_fn_type (ENUM, RETURN, 1, 4, ARG1, ARG2, ARG3, ARG4);
-#define DEF_FUNCTION_TYPE_VAR_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
- def_fn_type (ENUM, RETURN, 1, 5, ARG1, ARG2, ARG3, ARG4, ARG5);
-#define DEF_POINTER_TYPE(ENUM, TYPE) \
- builtin_types[(int) ENUM] = build_pointer_type (builtin_types[(int) TYPE]);
-
-#include "builtin-types.def"
-
-#undef DEF_PRIMITIVE_TYPE
-#undef DEF_FUNCTION_TYPE_1
-#undef DEF_FUNCTION_TYPE_2
-#undef DEF_FUNCTION_TYPE_3
-#undef DEF_FUNCTION_TYPE_4
-#undef DEF_FUNCTION_TYPE_5
-#undef DEF_FUNCTION_TYPE_6
-#undef DEF_FUNCTION_TYPE_VAR_0
-#undef DEF_FUNCTION_TYPE_VAR_1
-#undef DEF_FUNCTION_TYPE_VAR_2
-#undef DEF_FUNCTION_TYPE_VAR_3
-#undef DEF_FUNCTION_TYPE_VAR_4
-#undef DEF_FUNCTION_TYPE_VAR_5
-#undef DEF_POINTER_TYPE
- builtin_types[(int) BT_LAST] = NULL_TREE;
-
- c_init_attributes ();
-
-#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P, \
- NONANSI_P, ATTRS, IMPLICIT, COND) \
- if (NAME && COND) \
- def_builtin_1 (ENUM, NAME, CLASS, \
- builtin_types[(int) TYPE], \
- builtin_types[(int) LIBTYPE], \
- BOTH_P, FALLBACK_P, NONANSI_P, \
- built_in_attributes[(int) ATTRS], IMPLICIT);
-#include "builtins.def"
-#undef DEF_BUILTIN
-
- build_common_builtin_nodes ();
-
- targetm.init_builtins ();
- if (flag_mudflap)
- mudflap_init ();
+ if (!flag_preprocess_only)
+ c_define_builtins (va_list_ref_type_node, va_list_arg_type_node);
main_identifier_node = get_identifier ("main");
@@ -4761,12 +4809,24 @@ handle_aligned_attribute (tree *node, tree ARG_UNUSED (name), tree args,
TYPE_ALIGN (*type) = (1 << i) * BITS_PER_UNIT;
TYPE_USER_ALIGN (*type) = 1;
}
- else if (TREE_CODE (decl) != VAR_DECL
+ else if (! VAR_OR_FUNCTION_DECL_P (decl)
&& TREE_CODE (decl) != FIELD_DECL)
{
error ("alignment may not be specified for %q+D", decl);
*no_add_attrs = true;
}
+ else if (TREE_CODE (decl) == FUNCTION_DECL
+ && DECL_ALIGN (decl) > (1 << i) * BITS_PER_UNIT)
+ {
+ if (DECL_USER_ALIGN (decl))
+ error ("alignment for %q+D was previously specified as %d "
+ "and may not be decreased", decl,
+ DECL_ALIGN (decl) / BITS_PER_UNIT);
+ else
+ error ("alignment for %q+D must be at least %d", decl,
+ DECL_ALIGN (decl) / BITS_PER_UNIT);
+ *no_add_attrs = true;
+ }
else
{
DECL_ALIGN (decl) = (1 << i) * BITS_PER_UNIT;
diff --git a/contrib/gcc/c-common.h b/contrib/gcc/c-common.h
index eea0f35..453a2d6 100644
--- a/contrib/gcc/c-common.h
+++ b/contrib/gcc/c-common.h
@@ -654,7 +654,7 @@ extern void binary_op_error (enum tree_code);
extern tree fix_string_type (tree);
struct varray_head_tag;
extern void constant_expression_warning (tree);
-extern void strict_aliasing_warning(tree, tree, tree);
+extern bool strict_aliasing_warning (tree, tree, tree);
extern void empty_body_warning (tree, tree);
extern tree convert_and_check (tree, tree);
extern void overflow_warning (tree);
diff --git a/contrib/gcc/c-decl.c b/contrib/gcc/c-decl.c
index fbafc0d..3cdd69b 100644
--- a/contrib/gcc/c-decl.c
+++ b/contrib/gcc/c-decl.c
@@ -1690,12 +1690,11 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
DECL_SIZE (newdecl) = DECL_SIZE (olddecl);
DECL_SIZE_UNIT (newdecl) = DECL_SIZE_UNIT (olddecl);
DECL_MODE (newdecl) = DECL_MODE (olddecl);
- if (TREE_CODE (olddecl) != FUNCTION_DECL)
- if (DECL_ALIGN (olddecl) > DECL_ALIGN (newdecl))
- {
- DECL_ALIGN (newdecl) = DECL_ALIGN (olddecl);
- DECL_USER_ALIGN (newdecl) |= DECL_ALIGN (olddecl);
- }
+ if (DECL_ALIGN (olddecl) > DECL_ALIGN (newdecl))
+ {
+ DECL_ALIGN (newdecl) = DECL_ALIGN (olddecl);
+ DECL_USER_ALIGN (newdecl) |= DECL_ALIGN (olddecl);
+ }
}
@@ -3931,6 +3930,61 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name)
}
+
+/* Print warning about variable length array if necessary. */
+
+static void
+warn_variable_length_array (const char *name, tree size)
+{
+ int ped = !flag_isoc99 && pedantic && warn_vla != 0;
+ int const_size = TREE_CONSTANT (size);
+
+ if (ped)
+ {
+ if (const_size)
+ {
+ if (name)
+ pedwarn ("ISO C90 forbids array %qs whose size "
+ "can%'t be evaluated",
+ name);
+ else
+ pedwarn ("ISO C90 forbids array whose size "
+ "can%'t be evaluated");
+ }
+ else
+ {
+ if (name)
+ pedwarn ("ISO C90 forbids variable length array %qs",
+ name);
+ else
+ pedwarn ("ISO C90 forbids variable length array");
+ }
+ }
+ else if (warn_vla > 0)
+ {
+ if (const_size)
+ {
+ if (name)
+ warning (OPT_Wvla,
+ "the size of array %qs can"
+ "%'t be evaluated", name);
+ else
+ warning (OPT_Wvla,
+ "the size of array can %'t be evaluated");
+ }
+ else
+ {
+ if (name)
+ warning (OPT_Wvla,
+ "variable length array %qs is used",
+ name);
+ else
+ warning (OPT_Wvla,
+ "variable length array is used");
+ }
+ }
+}
+
/* Given declspecs and a declarator,
determine the name and type of the object declared
and construct a ..._DECL node for it.
@@ -4329,17 +4383,7 @@ grokdeclarator (const struct c_declarator *declarator,
nonconstant even if it is (eg) a const variable
with known value. */
size_varies = 1;
-
- if (!flag_isoc99 && pedantic)
- {
- if (TREE_CONSTANT (size))
- pedwarn ("ISO C90 forbids array %qs whose size "
- "can%'t be evaluated",
- name);
- else
- pedwarn ("ISO C90 forbids variable-size array %qs",
- name);
- }
+ warn_variable_length_array (orig_name, size);
if (warn_variable_decl)
warning (0, "variable-sized array %qs", name);
}
diff --git a/contrib/gcc/c-opts.c b/contrib/gcc/c-opts.c
index 3e89ec2..0c584eb 100644
--- a/contrib/gcc/c-opts.c
+++ b/contrib/gcc/c-opts.c
@@ -396,7 +396,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
if (c_dialect_cxx ())
warn_sign_compare = value;
warn_switch = value;
- warn_strict_aliasing = value;
+ set_warn_strict_aliasing (value);
warn_strict_overflow = value;
warn_address = value;
@@ -606,6 +606,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
disable_builtin_function (arg);
break;
+ case OPT_fdirectives_only:
+ cpp_opts->directives_only = 1;
+ break;
+
case OPT_fdollars_in_identifiers:
cpp_opts->dollars_in_ident = value;
break;
@@ -818,6 +822,18 @@ c_common_handle_option (size_t scode, const char *arg, int value)
flag_gen_declaration = 1;
break;
+ case OPT_femit_struct_debug_baseonly:
+ set_struct_debug_option ("base");
+ break;
+
+ case OPT_femit_struct_debug_reduced:
+ set_struct_debug_option ("dir:ord:sys,dir:gen:any,ind:base");
+ break;
+
+ case OPT_femit_struct_debug_detailed_:
+ set_struct_debug_option (arg);
+ break;
+
case OPT_idirafter:
add_path (xstrdup (arg), AFTER, 0, true);
break;
@@ -1317,6 +1333,11 @@ sanitize_cpp_opts (void)
if (flag_dump_macros == 'M')
flag_no_output = 1;
+ /* By default, -fdirectives-only implies -dD. This allows subsequent phases
+ to perform proper macro expansion. */
+ if (cpp_opts->directives_only && !cpp_opts->preprocessed && !flag_dump_macros)
+ flag_dump_macros = 'D';
+
/* Disable -dD, -dN and -dI if normal output is suppressed. Allow
-dM since at least glibc relies on -M -dM to work. */
/* Also, flag_no_output implies flag_no_line_commands, always. */
@@ -1347,6 +1368,14 @@ sanitize_cpp_opts (void)
actually output the current directory? */
if (flag_working_directory == -1)
flag_working_directory = (debug_info_level != DINFO_LEVEL_NONE);
+
+ if (cpp_opts->directives_only)
+ {
+ if (warn_unused_macros)
+ error ("-fdirectives-only is incompatible with -Wunused_macros");
+ if (cpp_opts->traditional)
+ error ("-fdirectives-only is incompatible with -traditional");
+ }
}
/* Add include path with a prefix at the front of its name. */
@@ -1430,6 +1459,8 @@ finish_options (void)
}
}
}
+ else if (cpp_opts->directives_only)
+ cpp_init_special_builtins (parse_in);
include_cursor = 0;
push_command_line_include ();
diff --git a/contrib/gcc/c-ppoutput.c b/contrib/gcc/c-ppoutput.c
index 10540b7..62b350b 100644
--- a/contrib/gcc/c-ppoutput.c
+++ b/contrib/gcc/c-ppoutput.c
@@ -41,6 +41,8 @@ static struct
/* General output routines. */
static void scan_translation_unit (cpp_reader *);
+static void print_lines_directives_only (int, const void *, size_t);
+static void scan_translation_unit_directives_only (cpp_reader *);
static void scan_translation_unit_trad (cpp_reader *);
static void account_for_newlines (const unsigned char *, size_t);
static int dump_macro (cpp_reader *, cpp_hashnode *, void *);
@@ -75,6 +77,9 @@ preprocess_file (cpp_reader *pfile)
}
else if (cpp_get_options (pfile)->traditional)
scan_translation_unit_trad (pfile);
+ else if (cpp_get_options (pfile)->directives_only
+ && !cpp_get_options (pfile)->preprocessed)
+ scan_translation_unit_directives_only (pfile);
else
scan_translation_unit (pfile);
@@ -179,6 +184,26 @@ scan_translation_unit (cpp_reader *pfile)
}
}
+static void
+print_lines_directives_only (int lines, const void *buf, size_t size)
+{
+ print.src_line += lines;
+ fwrite (buf, 1, size, print.outf);
+}
+
+/* Writes out the preprocessed file, handling spacing and paste
+ avoidance issues. */
+static void
+scan_translation_unit_directives_only (cpp_reader *pfile)
+{
+ struct _cpp_dir_only_callbacks cb;
+
+ cb.print_lines = print_lines_directives_only;
+ cb.maybe_print_line = maybe_print_line;
+
+ _cpp_preprocess_dir_only (pfile, &cb);
+}
+
/* Adjust print.src_line for newlines embedded in output. */
static void
account_for_newlines (const unsigned char *str, size_t len)
diff --git a/contrib/gcc/c-typeck.c b/contrib/gcc/c-typeck.c
index e10a222..dd0fdc5 100644
--- a/contrib/gcc/c-typeck.c
+++ b/contrib/gcc/c-typeck.c
@@ -1876,6 +1876,19 @@ build_indirect_ref (tree ptr, const char *errorstring)
if (TREE_CODE (type) == POINTER_TYPE)
{
+ if (TREE_CODE (pointer) == CONVERT_EXPR
+ || TREE_CODE (pointer) == NOP_EXPR
+ || TREE_CODE (pointer) == VIEW_CONVERT_EXPR)
+ {
+ /* If a warning is issued, mark it to avoid duplicates from
+ the backend. This only needs to be done at
+ warn_strict_aliasing > 2. */
+ if (warn_strict_aliasing > 2)
+ if (strict_aliasing_warning (TREE_TYPE (TREE_OPERAND (pointer, 0)),
+ type, TREE_OPERAND (pointer, 0)))
+ TREE_NO_WARNING (pointer) = 1;
+ }
+
if (TREE_CODE (pointer) == ADDR_EXPR
&& (TREE_TYPE (TREE_OPERAND (pointer, 0))
== TREE_TYPE (type)))
@@ -2603,7 +2616,10 @@ parser_build_unary_op (enum tree_code code, struct c_expr arg)
result.original_code = ERROR_MARK;
result.value = build_unary_op (code, arg.value, 0);
- overflow_warning (result.value);
+
+ if (TREE_OVERFLOW_P (result.value) && !TREE_OVERFLOW_P (arg.value))
+ overflow_warning (result.value);
+
return result;
}
@@ -2647,7 +2663,10 @@ parser_build_binary_op (enum tree_code code, struct c_expr arg1,
warning (OPT_Waddress,
"comparison with string literal results in unspecified behaviour");
- overflow_warning (result.value);
+ if (TREE_OVERFLOW_P (result.value)
+ && !TREE_OVERFLOW_P (arg1.value)
+ && !TREE_OVERFLOW_P (arg2.value))
+ overflow_warning (result.value);
return result;
}
@@ -3562,7 +3581,8 @@ build_c_cast (tree type, tree expr)
warning (OPT_Wint_to_pointer_cast, "cast to pointer from integer "
"of different size");
- strict_aliasing_warning (otype, type, expr);
+ if (warn_strict_aliasing <= 2)
+ strict_aliasing_warning (otype, type, expr);
/* If pedantic, warn for conversions between function and object
pointer types, except for converting a null pointer constant
@@ -3833,10 +3853,7 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
}
if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (rhstype))
- {
- overflow_warning (rhs);
- return rhs;
- }
+ return rhs;
if (coder == VOID_TYPE)
{
diff --git a/contrib/gcc/c.opt b/contrib/gcc/c.opt
index 038fc51..80b5312 100644
--- a/contrib/gcc/c.opt
+++ b/contrib/gcc/c.opt
@@ -432,6 +432,10 @@ Wvariadic-macros
C ObjC C++ ObjC++
Do not warn about using variadic macros when -pedantic
+Wvla
+C ObjC C++ ObjC++ Var(warn_vla) Init(-1) Warning
+Warn if a variable length array is used
+
Wwrite-strings
C ObjC C++ ObjC++ Var(warn_write_strings)
In C++, nonzero means warn about deprecated conversion from string literals to `char *'. In C, similar warning, except that the conversion is of course not deprecated by the ISO C standard.
@@ -490,6 +494,10 @@ fdefault-inline
C++ ObjC++
Inline member functions by default
+fdirectives-only
+C ObjC C++ ObjC++
+Preprocess directives only.
+
fdollars-in-identifiers
C ObjC C++ ObjC++
Permit '$' as an identifier character
@@ -761,6 +769,18 @@ gen-decls
ObjC ObjC++
Dump declarations to a .decl file
+femit-struct-debug-baseonly
+C ObjC C++ ObjC++
+-femit-struct-debug-baseonly Aggressive reduced debug info for structs
+
+femit-struct-debug-reduced
+C ObjC C++ ObjC++
+-femit-struct-debug-reduced Conservative reduced debug info for structs
+
+femit-struct-debug-detailed=
+C ObjC C++ ObjC++ Joined
+-femit-struct-debug-detailed=<spec-list> Detailed reduced debug info for structs
+
idirafter
C ObjC C++ ObjC++ Joined Separate
-idirafter <dir> Add <dir> to the end of the system include path
diff --git a/contrib/gcc/cgraphunit.c b/contrib/gcc/cgraphunit.c
index 6d6ce2f..cc8b98f 100644
--- a/contrib/gcc/cgraphunit.c
+++ b/contrib/gcc/cgraphunit.c
@@ -1676,7 +1676,7 @@ cgraph_build_static_cdtor (char which, tree body, int priority)
tree decl, name, resdecl;
sprintf (which_buf, "%c_%d", which, counter++);
- name = get_file_function_name_long (which_buf);
+ name = get_file_function_name (which_buf);
decl = build_decl (FUNCTION_DECL, name,
build_function_type (void_type_node, void_list_node));
diff --git a/contrib/gcc/collect2.c b/contrib/gcc/collect2.c
index 02edde8..c6c1f3f 100644
--- a/contrib/gcc/collect2.c
+++ b/contrib/gcc/collect2.c
@@ -53,7 +53,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
the utilities are not correct for a cross-compiler; we have to hope that
cross-versions are in the proper directories. */
-#ifdef CROSS_COMPILE
+#ifdef CROSS_DIRECTORY_STRUCTURE
#undef OBJECT_FORMAT_COFF
#undef MD_EXEC_PREFIX
#undef REAL_LD_FILE_NAME
@@ -553,7 +553,7 @@ is_ctor_dtor (const char *s)
static struct path_prefix cpath, path;
-#ifdef CROSS_COMPILE
+#ifdef CROSS_DIRECTORY_STRUCTURE
/* This is the name of the target machine. We use it to form the name
of the files to execute. */
@@ -746,7 +746,7 @@ main (int argc, char **argv)
static const char *const strip_suffix = "strip";
static const char *const gstrip_suffix = "gstrip";
-#ifdef CROSS_COMPILE
+#ifdef CROSS_DIRECTORY_STRUCTURE
/* If we look for a program in the compiler directories, we just use
the short name, since these directories are already system-specific.
But it we look for a program in the system directories, we need to
@@ -775,7 +775,7 @@ main (int argc, char **argv)
#endif
const char *const full_strip_suffix = strip_suffix;
const char *const full_gstrip_suffix = gstrip_suffix;
-#endif /* CROSS_COMPILE */
+#endif /* CROSS_DIRECTORY_STRUCTURE */
const char *arg;
FILE *outf;
@@ -957,7 +957,7 @@ main (int argc, char **argv)
c_file_name = getenv ("COLLECT_GCC");
if (c_file_name == 0)
{
-#ifdef CROSS_COMPILE
+#ifdef CROSS_DIRECTORY_STRUCTURE
c_file_name = concat (target_machine, "-gcc", NULL);
#else
c_file_name = "gcc";
diff --git a/contrib/gcc/common.opt b/contrib/gcc/common.opt
index 2270d0d..7dd3909 100644
--- a/contrib/gcc/common.opt
+++ b/contrib/gcc/common.opt
@@ -95,7 +95,11 @@ Warn when an inlined function cannot be inlined
Wlarger-than-
Common RejectNegative Joined UInteger
--Wlarger-than-<number> Warn if an object is larger than <number> bytes
+-Wlarger-than-<number> Warn if an object is larger than <number> bytes
+
+Wframe-larger-than-
+Common RejectNegative Joined UInteger
+-Wframe-larger-than-<number> Warn if the frame size of a function is larger than <number> bytes
Wunsafe-loop-optimizations
Common Var(warn_unsafe_loop_optimizations)
@@ -537,6 +541,14 @@ finstrument-functions
Common Report Var(flag_instrument_function_entry_exit)
Instrument function entry and exit with profiling calls
+finstrument-functions-exclude-function-list=
+Common RejectNegative Joined
+-finstrument-functions-exclude-function-list=name,... Do not instrument listed functions
+
+finstrument-functions-exclude-file-list=
+Common RejectNegative Joined
+-finstrument-functions-exclude-file-list=filename,... Do not instrument functions listed in files
+
fipa-cp
Common Report Var(flag_ipa_cp)
Perform Interprocedural constant propagation
diff --git a/contrib/gcc/config/i386/beos-elf.h b/contrib/gcc/config/i386/beos-elf.h
index f1e2cf8..3acc830 100644
--- a/contrib/gcc/config/i386/beos-elf.h
+++ b/contrib/gcc/config/i386/beos-elf.h
@@ -135,7 +135,7 @@ Boston, MA 02110-1301, USA. */
for the BeOS include files relative to TOOL_INCLUDE_DIR. Yes, we
use ANSI string concatenation here (FIXME) */
-#ifndef CROSS_COMPILE
+#ifndef CROSS_DIRECTORY_STRUCTURE
#undef INCLUDE_DEFAULTS
#define INCLUDE_DEFAULTS \
{ \
@@ -177,7 +177,7 @@ Boston, MA 02110-1301, USA. */
{ "/boot/develop/headers", 0, 0, 0 }, \
{ 0, 0, 0, 0 } \
}
-#else /* CROSS_COMPILE */
+#else /* CROSS_DIRECTORY_STRUCTURE */
#undef INCLUDE_DEFAULTS
#define INCLUDE_DEFAULTS \
{ \
diff --git a/contrib/gcc/config/i386/cygwin.h b/contrib/gcc/config/i386/cygwin.h
index a7d5e47..fe85a6d 100644
--- a/contrib/gcc/config/i386/cygwin.h
+++ b/contrib/gcc/config/i386/cygwin.h
@@ -146,7 +146,7 @@ char cygwin_tool_include_dir[sizeof (TOOL_INCLUDE_DIR) + 1
#undef TOOL_INCLUDE_DIR
#define TOOL_INCLUDE_DIR ((const char *) cygwin_tool_include_dir)
-#ifndef CROSS_COMPILE
+#ifndef CROSS_DIRECTORY_STRUCTURE
#undef STANDARD_INCLUDE_DIR
#define STANDARD_INCLUDE_DIR "/usr/include"
char cygwin_standard_include_dir[sizeof (STANDARD_INCLUDE_DIR) + 1
diff --git a/contrib/gcc/config/i386/i386.c b/contrib/gcc/config/i386/i386.c
index 1598ae9..51bd93c 100644
--- a/contrib/gcc/config/i386/i386.c
+++ b/contrib/gcc/config/i386/i386.c
@@ -1089,6 +1089,8 @@ const int x86_cmpxchg = ~m_386;
const int x86_cmpxchg8b = ~(m_386 | m_486);
/* Exchange and add was added for 80486. */
const int x86_xadd = ~m_386;
+/* Byteswap was added for 80486. */
+const int x86_bswap = ~m_386;
const int x86_pad_returns = m_ATHLON_K8_AMDFAM10 | m_CORE2 | m_GENERIC;
/* In case the average insn count for single function invocation is
diff --git a/contrib/gcc/config/i386/i386.h b/contrib/gcc/config/i386/i386.h
index 1394fba..4a303f6 100644
--- a/contrib/gcc/config/i386/i386.h
+++ b/contrib/gcc/config/i386/i386.h
@@ -168,6 +168,7 @@ extern const int x86_use_bt;
extern const int x86_cmpxchg, x86_cmpxchg8b, x86_xadd;
extern const int x86_use_incdec;
extern const int x86_pad_returns;
+extern const int x86_bswap;
extern const int x86_partial_flag_reg_stall;
extern int x86_prefetch_sse, x86_cmpxchg16b;
@@ -243,6 +244,7 @@ extern int x86_prefetch_sse, x86_cmpxchg16b;
#define TARGET_CMPXCHG8B (x86_cmpxchg8b & (1 << ix86_arch))
#define TARGET_CMPXCHG16B (x86_cmpxchg16b)
#define TARGET_XADD (x86_xadd & (1 << ix86_arch))
+#define TARGET_BSWAP (x86_bswap & (1 << ix86_arch))
#ifndef TARGET_64BIT_DEFAULT
#define TARGET_64BIT_DEFAULT 0
diff --git a/contrib/gcc/config/i386/i386.md b/contrib/gcc/config/i386/i386.md
index 21b9cb3..f009cbb 100644
--- a/contrib/gcc/config/i386/i386.md
+++ b/contrib/gcc/config/i386/i386.md
@@ -284,14 +284,14 @@
(const_int 0)))
;; Set when string REP prefix is used.
-(define_attr "prefix_rep" ""
+(define_attr "prefix_rep" ""
(if_then_else (and (eq_attr "unit" "sse") (eq_attr "mode" "SF,DF"))
(const_int 1)
(const_int 0)))
;; Set when 0f opcode prefix is used.
(define_attr "prefix_0f" ""
- (if_then_else
+ (if_then_else
(ior (eq_attr "type" "imovx,setcc,icmov,bitmanip")
(eq_attr "unit" "sse,mmx"))
(const_int 1)
@@ -466,7 +466,7 @@
;; All x87 floating point modes
(define_mode_macro X87MODEF [SF DF XF])
-
+
;; All integer modes handled by x87 fisttp operator.
(define_mode_macro X87MODEI [HI SI DI])
@@ -475,7 +475,7 @@
;; All SSE floating point modes
(define_mode_macro SSEMODEF [SF DF])
-
+
;; All integer modes handled by SSE cvtts?2si* operators.
(define_mode_macro SSEMODEI24 [SI DI])
@@ -1098,7 +1098,7 @@
;; Push/pop instructions. They are separate since autoinc/dec is not a
;; general_operand.
;;
-;; %%% We don't use a post-inc memory reference because x86 is not a
+;; %%% We don't use a post-inc memory reference because x86 is not a
;; general AUTO_INC_DEC host, which impacts how it is treated in flow.
;; Changing this impacts compiler performance on other non-AUTO_INC_DEC
;; targets without our curiosities, and it is just as easy to represent
@@ -1160,7 +1160,7 @@
[(set_attr "type" "alu1")
(set_attr "mode" "SI")
(set_attr "length_immediate" "0")])
-
+
(define_insn "*movsi_or"
[(set (match_operand:SI 0 "register_operand" "=r")
(match_operand:SI 1 "immediate_operand" "i"))
@@ -2308,7 +2308,7 @@
&& (reload_in_progress || reload_completed
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
|| GET_CODE (operands[1]) != CONST_DOUBLE
- || memory_operand (operands[0], SFmode))"
+ || memory_operand (operands[0], SFmode))"
{
switch (which_alternative)
{
@@ -2368,7 +2368,7 @@
(const_string "V4SF"))
/* For architectures resolving dependencies on
whole SSE registers use APS move to break dependency
- chains, otherwise use short move to avoid extra work.
+ chains, otherwise use short move to avoid extra work.
Do the same for architectures resolving dependencies on
the parts. While in DF mode it is better to always handle
@@ -2476,7 +2476,7 @@
&& (reload_in_progress || reload_completed
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
|| GET_CODE (operands[1]) != CONST_DOUBLE
- || memory_operand (operands[0], DFmode))"
+ || memory_operand (operands[0], DFmode))"
{
switch (which_alternative)
{
@@ -2596,7 +2596,7 @@
&& (reload_in_progress || reload_completed
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
|| GET_CODE (operands[1]) != CONST_DOUBLE
- || memory_operand (operands[0], DFmode))"
+ || memory_operand (operands[0], DFmode))"
{
switch (which_alternative)
{
@@ -2712,10 +2712,10 @@
(match_operand:DF 1 "general_operand" ""))]
"reload_completed
&& (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
- && ! (ANY_FP_REG_P (operands[0]) ||
+ && ! (ANY_FP_REG_P (operands[0]) ||
(GET_CODE (operands[0]) == SUBREG
&& ANY_FP_REG_P (SUBREG_REG (operands[0]))))
- && ! (ANY_FP_REG_P (operands[1]) ||
+ && ! (ANY_FP_REG_P (operands[1]) ||
(GET_CODE (operands[1]) == SUBREG
&& ANY_FP_REG_P (SUBREG_REG (operands[1]))))"
[(const_int 0)]
@@ -2807,7 +2807,7 @@
&& (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
&& (reload_in_progress || reload_completed
|| GET_CODE (operands[1]) != CONST_DOUBLE
- || memory_operand (operands[0], XFmode))"
+ || memory_operand (operands[0], XFmode))"
{
switch (which_alternative)
{
@@ -2841,7 +2841,7 @@
&& (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
&& (reload_in_progress || reload_completed
|| GET_CODE (operands[1]) != CONST_DOUBLE
- || memory_operand (operands[0], XFmode))"
+ || memory_operand (operands[0], XFmode))"
{
switch (which_alternative)
{
@@ -2875,10 +2875,10 @@
"reload_completed
&& (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
&& GET_MODE (operands[0]) == XFmode
- && ! (ANY_FP_REG_P (operands[0]) ||
+ && ! (ANY_FP_REG_P (operands[0]) ||
(GET_CODE (operands[0]) == SUBREG
&& ANY_FP_REG_P (SUBREG_REG (operands[0]))))
- && ! (ANY_FP_REG_P (operands[1]) ||
+ && ! (ANY_FP_REG_P (operands[1]) ||
(GET_CODE (operands[1]) == SUBREG
&& ANY_FP_REG_P (SUBREG_REG (operands[1]))))"
[(const_int 0)]
@@ -3073,7 +3073,7 @@
[(set (match_operand:HI 0 "register_operand" "")
(zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "reload_completed
+ "reload_completed
&& (!TARGET_ZERO_EXTEND_WITH_AND || optimize_size)
&& (!REG_P (operands[1]) || ANY_QI_REG_P (operands[1]))"
[(set (match_operand:HI 0 "register_operand" "")
@@ -3143,7 +3143,7 @@
[(set (match_operand:SI 0 "register_operand" "")
(zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "reload_completed
+ "reload_completed
&& (!TARGET_ZERO_EXTEND_WITH_AND || optimize_size)
&& (!REG_P (operands[1]) || ANY_QI_REG_P (operands[1]))"
[(set (match_dup 0)
@@ -3220,7 +3220,7 @@
[(set (match_dup 4) (const_int 0))]
"split_di (&operands[0], 1, &operands[3], &operands[4]);")
-(define_split
+(define_split
[(set (match_operand:DI 0 "register_operand" "")
(zero_extend:DI (match_operand:SI 1 "register_operand" "")))
(clobber (reg:CC FLAGS_REG))]
@@ -3229,7 +3229,7 @@
[(set (match_dup 4) (const_int 0))]
"split_di (&operands[0], 1, &operands[3], &operands[4]);")
-(define_split
+(define_split
[(set (match_operand:DI 0 "nonimmediate_operand" "")
(zero_extend:DI (match_operand:SI 1 "general_operand" "")))
(clobber (reg:CC FLAGS_REG))]
@@ -3308,7 +3308,7 @@
(set_attr "mode" "DI")])
;; Extend to memory case when source register does die.
-(define_split
+(define_split
[(set (match_operand:DI 0 "memory_operand" "")
(sign_extend:DI (match_operand:SI 1 "register_operand" "")))
(clobber (reg:CC FLAGS_REG))
@@ -3323,7 +3323,7 @@
"split_di (&operands[0], 1, &operands[3], &operands[4]);")
;; Extend to memory case when source register does not die.
-(define_split
+(define_split
[(set (match_operand:DI 0 "memory_operand" "")
(sign_extend:DI (match_operand:SI 1 "register_operand" "")))
(clobber (reg:CC FLAGS_REG))
@@ -3353,7 +3353,7 @@
;; Extend to register case. Optimize case where source and destination
;; registers match and cases where we can use cltd.
-(define_split
+(define_split
[(set (match_operand:DI 0 "register_operand" "")
(sign_extend:DI (match_operand:SI 1 "register_operand" "")))
(clobber (reg:CC FLAGS_REG))
@@ -3482,7 +3482,7 @@
;; These are all no-ops in the model used for the 80387. So just
;; emit moves.
-;; %%% Kill these when call knows how to work out a DFmode push earlier.
+;; %%% Kill these when call knows how to work out a DFmode push earlier.
(define_insn "*dummy_extendsfdf2"
[(set (match_operand:DF 0 "push_operand" "=<")
(float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "fY")))]
@@ -4365,7 +4365,7 @@
(set_attr "i387_cw" "trunc")
(set_attr "mode" "DI")])
-(define_split
+(define_split
[(set (match_operand:DI 0 "register_operand" "")
(fix:DI (match_operand 1 "register_operand" "")))
(use (match_operand:HI 2 "memory_operand" ""))
@@ -4380,7 +4380,7 @@
(set (match_dup 0) (match_dup 4))]
"")
-(define_split
+(define_split
[(set (match_operand:DI 0 "memory_operand" "")
(fix:DI (match_operand 1 "register_operand" "")))
(use (match_operand:HI 2 "memory_operand" ""))
@@ -4421,7 +4421,7 @@
(set_attr "i387_cw" "trunc")
(set_attr "mode" "<MODE>")])
-(define_split
+(define_split
[(set (match_operand:X87MODEI12 0 "register_operand" "")
(fix:X87MODEI12 (match_operand 1 "register_operand" "")))
(use (match_operand:HI 2 "memory_operand" ""))
@@ -4434,7 +4434,7 @@
(set (match_dup 0) (match_dup 4))]
"")
-(define_split
+(define_split
[(set (match_operand:X87MODEI12 0 "memory_operand" "")
(fix:X87MODEI12 (match_operand 1 "register_operand" "")))
(use (match_operand:HI 2 "memory_operand" ""))
@@ -4913,7 +4913,7 @@
(define_insn "*addsi3_carry_zext"
[(set (match_operand:DI 0 "register_operand" "=r")
- (zero_extend:DI
+ (zero_extend:DI
(plus:SI (plus:SI (match_operand:SI 3 "ix86_carry_flag_operator" "")
(match_operand:SI 1 "nonimmediate_operand" "%0"))
(match_operand:SI 2 "general_operand" "rim"))))
@@ -5222,7 +5222,7 @@
(compare
(plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
(match_operand:DI 2 "x86_64_general_operand" "rme,re"))
- (const_int 0)))
+ (const_int 0)))
(set (match_operand:DI 0 "nonimmediate_operand" "=r,rm")
(plus:DI (match_dup 1) (match_dup 2)))]
"TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode)
@@ -5369,7 +5369,7 @@
(compare
(plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
(match_operand:DI 2 "x86_64_general_operand" "rme"))
- (const_int 0)))
+ (const_int 0)))
(clobber (match_scratch:DI 0 "=r"))]
"TARGET_64BIT
&& ix86_match_ccmode (insn, CCGOCmode)
@@ -5568,7 +5568,7 @@
(compare
(plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
(match_operand:SI 2 "general_operand" "rmni,rni"))
- (const_int 0)))
+ (const_int 0)))
(set (match_operand:SI 0 "nonimmediate_operand" "=r,rm")
(plus:SI (match_dup 1) (match_dup 2)))]
"ix86_match_ccmode (insn, CCGOCmode)
@@ -5616,7 +5616,7 @@
(compare
(plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0")
(match_operand:SI 2 "general_operand" "rmni"))
- (const_int 0)))
+ (const_int 0)))
(set (match_operand:DI 0 "register_operand" "=r")
(zero_extend:DI (plus:SI (match_dup 1) (match_dup 2))))]
"TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode)
@@ -5794,7 +5794,7 @@
(compare
(plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0")
(match_operand:SI 2 "general_operand" "rmni"))
- (const_int 0)))
+ (const_int 0)))
(clobber (match_scratch:SI 0 "=r"))]
"ix86_match_ccmode (insn, CCGOCmode)
&& (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)
@@ -5934,7 +5934,7 @@
(compare
(plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0")
(match_operand:HI 2 "general_operand" "rmni,rni"))
- (const_int 0)))
+ (const_int 0)))
(set (match_operand:HI 0 "nonimmediate_operand" "=r,rm")
(plus:HI (match_dup 1) (match_dup 2)))]
"ix86_match_ccmode (insn, CCGOCmode)
@@ -6054,7 +6054,7 @@
(compare
(plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0")
(match_operand:HI 2 "general_operand" "rmni"))
- (const_int 0)))
+ (const_int 0)))
(clobber (match_scratch:HI 0 "=r"))]
"ix86_match_ccmode (insn, CCGOCmode)
&& (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
@@ -7483,7 +7483,7 @@
(match_operand:DF 2 "nonimmediate_operand" "")))]
"TARGET_80387 || (TARGET_SSE2 && TARGET_SSE_MATH)"
"")
-
+
(define_expand "divsf3"
[(set (match_operand:SF 0 "register_operand" "")
(div:SF (match_operand:SF 1 "register_operand" "")
@@ -8161,7 +8161,7 @@
gcc_assert (INTVAL (operands[2]) == 0xffff);
mode = HImode;
}
-
+
operands[1] = gen_lowpart (mode, operands[1]);
if (mode == QImode)
return "movz{bq|x}\t{%1,%0|%0, %1}";
@@ -8226,7 +8226,7 @@
gcc_assert (INTVAL (operands[2]) == 0xffff);
mode = HImode;
}
-
+
operands[1] = gen_lowpart (mode, operands[1]);
if (mode == QImode)
return "movz{bl|x}\t{%1,%0|%0, %1}";
@@ -8270,7 +8270,7 @@
[(parallel [(set (zero_extract:SI (match_dup 0)
(const_int 8)
(const_int 8))
- (xor:SI
+ (xor:SI
(zero_extract:SI (match_dup 0)
(const_int 8)
(const_int 8))
@@ -8458,7 +8458,7 @@
[(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
- (and:SI
+ (and:SI
(zero_extract:SI
(match_operand 1 "ext_register_operand" "0")
(const_int 8)
@@ -8487,7 +8487,7 @@
(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
- (and:SI
+ (and:SI
(zero_extract:SI
(match_dup 1)
(const_int 8)
@@ -8503,7 +8503,7 @@
[(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
- (and:SI
+ (and:SI
(zero_extract:SI
(match_operand 1 "ext_register_operand" "0")
(const_int 8)
@@ -8521,7 +8521,7 @@
[(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
- (and:SI
+ (and:SI
(zero_extract:SI
(match_operand 1 "ext_register_operand" "0")
(const_int 8)
@@ -8864,7 +8864,7 @@
[(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
- (ior:SI
+ (ior:SI
(zero_extract:SI
(match_operand 1 "ext_register_operand" "0")
(const_int 8)
@@ -8881,7 +8881,7 @@
[(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
- (ior:SI
+ (ior:SI
(zero_extract:SI
(match_operand 1 "ext_register_operand" "0")
(const_int 8)
@@ -8900,7 +8900,7 @@
[(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
- (ior:SI
+ (ior:SI
(zero_extract:SI
(match_operand 1 "ext_register_operand" "0")
(const_int 8)
@@ -8919,7 +8919,7 @@
[(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
- (ior:SI
+ (ior:SI
(zero_extract:SI (match_operand 1 "ext_register_operand" "0")
(const_int 8)
(const_int 8))
@@ -9202,7 +9202,7 @@
[(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
- (xor:SI
+ (xor:SI
(zero_extract:SI
(match_operand 1 "ext_register_operand" "0")
(const_int 8)
@@ -9219,7 +9219,7 @@
[(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
- (xor:SI
+ (xor:SI
(zero_extract:SI
(match_operand 1 "ext_register_operand" "0")
(const_int 8)
@@ -9238,7 +9238,7 @@
[(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
- (xor:SI
+ (xor:SI
(zero_extract:SI
(match_operand 1 "ext_register_operand" "0")
(const_int 8)
@@ -9257,7 +9257,7 @@
[(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
- (xor:SI
+ (xor:SI
(zero_extract:SI (match_operand 1 "ext_register_operand" "0")
(const_int 8)
(const_int 8))
@@ -9325,7 +9325,7 @@
(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=q")
(const_int 8)
(const_int 8))
- (xor:SI
+ (xor:SI
(zero_extract:SI (match_dup 1) (const_int 8) (const_int 8))
(match_dup 2)))]
"!TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode)"
@@ -9346,7 +9346,7 @@
(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
- (xor:SI
+ (xor:SI
(zero_extract:SI (match_dup 1) (const_int 8) (const_int 8))
(match_dup 2)))]
"TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode)"
@@ -9368,7 +9368,7 @@
(set (zero_extract:SI (match_operand 0 "ext_register_operand" "")
(const_int 8)
(const_int 8))
- (xor:SI
+ (xor:SI
(zero_extract:SI (match_dup 1) (const_int 8) (const_int 8))
(match_dup 2)))])]
""
@@ -9867,7 +9867,7 @@
enum machine_mode mode = GET_MODE (operands[0]);
enum machine_mode vmode = GET_MODE (operands[2]);
rtx tmp;
-
+
operands[0] = simplify_gen_subreg (vmode, operands[0], mode, 0);
operands[1] = simplify_gen_subreg (vmode, operands[1], mode, 0);
if (operands_match_p (operands[0], operands[2]))
@@ -9891,7 +9891,7 @@
"reload_completed"
[(parallel [(set (match_dup 0) (match_dup 1))
(clobber (reg:CC FLAGS_REG))])]
-{
+{
rtx tmp;
operands[0] = gen_lowpart (SImode, operands[0]);
if (GET_CODE (operands[1]) == ABS)
@@ -9998,7 +9998,7 @@
operands[1] = tmp;
})
-;; Conditionalize these after reload. If they match before reload, we
+;; Conditionalize these after reload. If they match before reload, we
;; lose the clobber and ability to use integer instructions.
(define_insn "*negsf2_1"
@@ -11415,8 +11415,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"sar{q}\t%0"
[(set_attr "type" "ishift")
- (set (attr "length")
- (if_then_else (match_operand:DI 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand:DI 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -11448,8 +11448,8 @@
&& ix86_binary_operator_ok (ASHIFTRT, DImode, operands)"
"sar{q}\t%0"
[(set_attr "type" "ishift")
- (set (attr "length")
- (if_then_else (match_operand:DI 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand:DI 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -11628,8 +11628,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"sar{l}\t%0"
[(set_attr "type" "ishift")
- (set (attr "length")
- (if_then_else (match_operand:SI 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand:SI 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -11684,8 +11684,8 @@
&& ix86_binary_operator_ok (ASHIFTRT, SImode, operands)"
"sar{l}\t%0"
[(set_attr "type" "ishift")
- (set (attr "length")
- (if_then_else (match_operand:SI 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand:SI 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -11785,8 +11785,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"sar{w}\t%0"
[(set_attr "type" "ishift")
- (set (attr "length")
- (if_then_else (match_operand 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -11818,8 +11818,8 @@
&& ix86_binary_operator_ok (ASHIFTRT, HImode, operands)"
"sar{w}\t%0"
[(set_attr "type" "ishift")
- (set (attr "length")
- (if_then_else (match_operand 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -11888,8 +11888,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"sar{b}\t%0"
[(set_attr "type" "ishift")
- (set (attr "length")
- (if_then_else (match_operand 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -11903,8 +11903,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"sar{b}\t%0"
[(set_attr "type" "ishift1")
- (set (attr "length")
- (if_then_else (match_operand 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -11949,8 +11949,8 @@
&& ix86_binary_operator_ok (ASHIFTRT, QImode, operands)"
"sar{b}\t%0"
[(set_attr "type" "ishift")
- (set (attr "length")
- (if_then_else (match_operand 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12042,7 +12042,7 @@
"#"
[(set_attr "type" "multi")])
-(define_split
+(define_split
[(set (match_operand:TI 0 "register_operand" "")
(lshiftrt:TI (match_operand:TI 1 "register_operand" "")
(match_operand:QI 2 "register_operand" "")))
@@ -12052,7 +12052,7 @@
[(const_int 0)]
"ix86_split_lshr (operands, operands[3], TImode); DONE;")
-(define_split
+(define_split
[(set (match_operand:TI 0 "register_operand" "")
(lshiftrt:TI (match_operand:TI 1 "register_operand" "")
(match_operand:QI 2 "immediate_operand" "")))
@@ -12077,8 +12077,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"shr{q}\t%0"
[(set_attr "type" "ishift")
- (set (attr "length")
- (if_then_else (match_operand:DI 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand:DI 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12110,8 +12110,8 @@
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{q}\t%0"
[(set_attr "type" "ishift")
- (set (attr "length")
- (if_then_else (match_operand:DI 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand:DI 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12186,7 +12186,7 @@
[(const_int 0)]
"ix86_split_lshr (operands, operands[3], DImode); DONE;")
-(define_split
+(define_split
[(set (match_operand:DI 0 "register_operand" "")
(lshiftrt:DI (match_operand:DI 1 "register_operand" "")
(match_operand:QI 2 "nonmemory_operand" "")))
@@ -12213,8 +12213,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"shr{l}\t%0"
[(set_attr "type" "ishift")
- (set (attr "length")
- (if_then_else (match_operand:SI 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand:SI 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12270,8 +12270,8 @@
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{l}\t%0"
[(set_attr "type" "ishift")
- (set (attr "length")
- (if_then_else (match_operand:SI 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand:SI 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12371,8 +12371,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"shr{w}\t%0"
[(set_attr "type" "ishift")
- (set (attr "length")
- (if_then_else (match_operand 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12404,8 +12404,8 @@
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{w}\t%0"
[(set_attr "type" "ishift")
- (set (attr "length")
- (if_then_else (match_operand:SI 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand:SI 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12474,8 +12474,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"shr{b}\t%0"
[(set_attr "type" "ishift")
- (set (attr "length")
- (if_then_else (match_operand 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12488,8 +12488,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"shr{b}\t%0"
[(set_attr "type" "ishift1")
- (set (attr "length")
- (if_then_else (match_operand 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12534,8 +12534,8 @@
&& ix86_binary_operator_ok (LSHIFTRT, QImode, operands)"
"shr{b}\t%0"
[(set_attr "type" "ishift")
- (set (attr "length")
- (if_then_else (match_operand:SI 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand:SI 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12608,7 +12608,7 @@
})
;; Implement rotation using two double-precision shift instructions
-;; and a scratch register.
+;; and a scratch register.
(define_insn_and_split "ix86_rotldi3"
[(set (match_operand:DI 0 "register_operand" "=r")
(rotate:DI (match_operand:DI 1 "register_operand" "0")
@@ -12616,7 +12616,7 @@
(clobber (reg:CC FLAGS_REG))
(clobber (match_scratch:SI 3 "=&r"))]
"!TARGET_64BIT"
- ""
+ ""
"&& reload_completed"
[(set (match_dup 3) (match_dup 4))
(parallel
@@ -12632,7 +12632,7 @@
(minus:QI (const_int 32) (match_dup 2)))))
(clobber (reg:CC FLAGS_REG))])]
"split_di (operands, 1, operands + 4, operands + 5);")
-
+
(define_insn "*rotlsi3_1_one_bit_rex64"
[(set (match_operand:DI 0 "nonimmediate_operand" "=rm")
(rotate:DI (match_operand:DI 1 "nonimmediate_operand" "0")
@@ -12642,8 +12642,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"rol{q}\t%0"
[(set_attr "type" "rotate")
- (set (attr "length")
- (if_then_else (match_operand:DI 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand:DI 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12676,8 +12676,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"rol{l}\t%0"
[(set_attr "type" "rotate")
- (set (attr "length")
- (if_then_else (match_operand:SI 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand:SI 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12735,8 +12735,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"rol{w}\t%0"
[(set_attr "type" "rotate")
- (set (attr "length")
- (if_then_else (match_operand 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12769,8 +12769,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"rol{b}\t%0"
[(set_attr "type" "rotate1")
- (set (attr "length")
- (if_then_else (match_operand 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12783,8 +12783,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"rol{b}\t%0"
[(set_attr "type" "rotate")
- (set (attr "length")
- (if_then_else (match_operand 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12830,9 +12830,9 @@
emit_insn (gen_ix86_rotrdi3 (operands[0], operands[1], operands[2]));
DONE;
})
-
+
;; Implement rotation using two double-precision shift instructions
-;; and a scratch register.
+;; and a scratch register.
(define_insn_and_split "ix86_rotrdi3"
[(set (match_operand:DI 0 "register_operand" "=r")
(rotatert:DI (match_operand:DI 1 "register_operand" "0")
@@ -12866,8 +12866,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"ror{q}\t%0"
[(set_attr "type" "rotate")
- (set (attr "length")
- (if_then_else (match_operand:DI 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand:DI 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12900,8 +12900,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"ror{l}\t%0"
[(set_attr "type" "rotate")
- (set (attr "length")
- (if_then_else (match_operand:SI 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand:SI 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12915,8 +12915,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"ror{l}\t%k0"
[(set_attr "type" "rotate")
- (set (attr "length")
- (if_then_else (match_operand:SI 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand:SI 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12962,8 +12962,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"ror{w}\t%0"
[(set_attr "type" "rotate")
- (set (attr "length")
- (if_then_else (match_operand 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -12996,8 +12996,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"ror{b}\t%0"
[(set_attr "type" "rotate")
- (set (attr "length")
- (if_then_else (match_operand 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -13010,8 +13010,8 @@
&& (TARGET_SHIFT1 || optimize_size)"
"ror{b}\t%0"
[(set_attr "type" "rotate1")
- (set (attr "length")
- (if_then_else (match_operand 0 "register_operand" "")
+ (set (attr "length")
+ (if_then_else (match_operand 0 "register_operand" "")
(const_string "2")
(const_string "*")))])
@@ -13378,14 +13378,14 @@
(set_attr "mode" "QI")])
;; In general it is not safe to assume too much about CCmode registers,
-;; so simplify-rtx stops when it sees a second one. Under certain
+;; so simplify-rtx stops when it sees a second one. Under certain
;; conditions this is safe on x86, so help combine not create
;;
;; seta %al
;; testb %al, %al
;; sete %al
-(define_split
+(define_split
[(set (match_operand:QI 0 "nonimmediate_operand" "")
(ne:QI (match_operator 1 "ix86_comparison_operator"
[(reg FLAGS_REG) (const_int 0)])
@@ -13396,7 +13396,7 @@
PUT_MODE (operands[1], QImode);
})
-(define_split
+(define_split
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" ""))
(ne:QI (match_operator 1 "ix86_comparison_operator"
[(reg FLAGS_REG) (const_int 0)])
@@ -13407,7 +13407,7 @@
PUT_MODE (operands[1], QImode);
})
-(define_split
+(define_split
[(set (match_operand:QI 0 "nonimmediate_operand" "")
(eq:QI (match_operator 1 "ix86_comparison_operator"
[(reg FLAGS_REG) (const_int 0)])
@@ -13427,7 +13427,7 @@
FAIL;
})
-(define_split
+(define_split
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" ""))
(eq:QI (match_operator 1 "ix86_comparison_operator"
[(reg FLAGS_REG) (const_int 0)])
@@ -13659,14 +13659,14 @@
(const_int 6)))])
;; In general it is not safe to assume too much about CCmode registers,
-;; so simplify-rtx stops when it sees a second one. Under certain
+;; so simplify-rtx stops when it sees a second one. Under certain
;; conditions this is safe on x86, so help combine not create
;;
;; seta %al
;; testb %al, %al
;; je Lfoo
-(define_split
+(define_split
[(set (pc)
(if_then_else (ne (match_operator 0 "ix86_comparison_operator"
[(reg FLAGS_REG) (const_int 0)])
@@ -13681,8 +13681,8 @@
{
PUT_MODE (operands[0], VOIDmode);
})
-
-(define_split
+
+(define_split
[(set (pc)
(if_then_else (eq (match_operator 0 "ix86_comparison_operator"
[(reg FLAGS_REG) (const_int 0)])
@@ -14157,7 +14157,7 @@
return "call\t%P0";
}
[(set_attr "type" "call")])
-
+
(define_insn "*call_pop_1"
[(call (mem:QI (match_operand:SI 0 "call_insn_operand" "rsm"))
(match_operand:SI 1 "" ""))
@@ -14493,7 +14493,7 @@
})
(define_insn_and_split "eh_return_si"
- [(set (pc)
+ [(set (pc)
(unspec [(match_operand:SI 0 "register_operand" "c")]
UNSPEC_EH_RETURN))]
"!TARGET_64BIT"
@@ -14503,7 +14503,7 @@
"ix86_expand_epilogue (2); DONE;")
(define_insn_and_split "eh_return_di"
- [(set (pc)
+ [(set (pc)
(unspec [(match_operand:DI 0 "register_operand" "c")]
UNSPEC_EH_RETURN))]
"TARGET_64BIT"
@@ -14530,7 +14530,7 @@
(define_expand "ffssi2"
[(parallel
- [(set (match_operand:SI 0 "register_operand" "")
+ [(set (match_operand:SI 0 "register_operand" "")
(ffs:SI (match_operand:SI 1 "nonimmediate_operand" "")))
(clobber (match_scratch:SI 2 ""))
(clobber (reg:CC FLAGS_REG))])]
@@ -14538,7 +14538,7 @@
"")
(define_insn_and_split "*ffs_cmove"
- [(set (match_operand:SI 0 "register_operand" "=r")
+ [(set (match_operand:SI 0 "register_operand" "=r")
(ffs:SI (match_operand:SI 1 "nonimmediate_operand" "rm")))
(clobber (match_scratch:SI 2 "=&r"))
(clobber (reg:CC FLAGS_REG))]
@@ -14557,7 +14557,7 @@
"")
(define_insn_and_split "*ffs_no_cmove"
- [(set (match_operand:SI 0 "nonimmediate_operand" "=r")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=r")
(ffs:SI (match_operand:SI 1 "nonimmediate_operand" "rm")))
(clobber (match_scratch:SI 2 "=&q"))
(clobber (reg:CC FLAGS_REG))]
@@ -14591,7 +14591,7 @@
(define_expand "ffsdi2"
[(parallel
- [(set (match_operand:DI 0 "register_operand" "")
+ [(set (match_operand:DI 0 "register_operand" "")
(ffs:DI (match_operand:DI 1 "nonimmediate_operand" "")))
(clobber (match_scratch:DI 2 ""))
(clobber (reg:CC FLAGS_REG))])]
@@ -14599,7 +14599,7 @@
"")
(define_insn_and_split "*ffs_rex64"
- [(set (match_operand:DI 0 "register_operand" "=r")
+ [(set (match_operand:DI 0 "register_operand" "=r")
(ffs:DI (match_operand:DI 1 "nonimmediate_operand" "rm")))
(clobber (match_scratch:DI 2 "=&r"))
(clobber (reg:CC FLAGS_REG))]
@@ -14718,6 +14718,24 @@
(set_attr "type" "bitmanip")
(set_attr "mode" "SI")])
+(define_insn "bswapsi2"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (bswap:SI (match_operand:SI 1 "register_operand" "0")))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_BSWAP"
+ "bswap\t%k0"
+ [(set_attr "prefix_0f" "1")
+ (set_attr "length" "2")])
+
+(define_insn "bswapdi2"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (bswap:DI (match_operand:DI 1 "register_operand" "0")))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_64BIT && TARGET_BSWAP"
+ "bswap\t%0"
+ [(set_attr "prefix_0f" "1")
+ (set_attr "length" "3")])
+
(define_expand "clzdi2"
[(parallel
[(set (match_operand:DI 0 "register_operand" "")
@@ -15231,12 +15249,12 @@
&& COMMUTATIVE_ARITH_P (operands[3])
&& (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
+ [(set (attr "type")
(if_then_else (eq_attr "alternative" "1")
- (if_then_else (match_operand:SF 3 "mult_operator" "")
+ (if_then_else (match_operand:SF 3 "mult_operator" "")
(const_string "ssemul")
(const_string "sseadd"))
- (if_then_else (match_operand:SF 3 "mult_operator" "")
+ (if_then_else (match_operand:SF 3 "mult_operator" "")
(const_string "fmul")
(const_string "fop"))))
(set_attr "mode" "SF")])
@@ -15250,8 +15268,8 @@
&& COMMUTATIVE_ARITH_P (operands[3])
&& (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (if_then_else (match_operand:SF 3 "mult_operator" "")
+ [(set (attr "type")
+ (if_then_else (match_operand:SF 3 "mult_operator" "")
(const_string "ssemul")
(const_string "sseadd")))
(set_attr "mode" "SF")])
@@ -15265,8 +15283,8 @@
&& COMMUTATIVE_ARITH_P (operands[3])
&& (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (if_then_else (match_operand:SF 3 "mult_operator" "")
+ [(set (attr "type")
+ (if_then_else (match_operand:SF 3 "mult_operator" "")
(const_string "fmul")
(const_string "fop")))
(set_attr "mode" "SF")])
@@ -15280,7 +15298,7 @@
&& !COMMUTATIVE_ARITH_P (operands[3])
&& (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
+ [(set (attr "type")
(cond [(and (eq_attr "alternative" "2")
(match_operand:SF 3 "mult_operator" ""))
(const_string "ssemul")
@@ -15289,9 +15307,9 @@
(const_string "ssediv")
(eq_attr "alternative" "2")
(const_string "sseadd")
- (match_operand:SF 3 "mult_operator" "")
+ (match_operand:SF 3 "mult_operator" "")
(const_string "fmul")
- (match_operand:SF 3 "div_operator" "")
+ (match_operand:SF 3 "div_operator" "")
(const_string "fdiv")
]
(const_string "fop")))
@@ -15305,7 +15323,7 @@
"TARGET_SSE_MATH
&& !COMMUTATIVE_ARITH_P (operands[3])"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
+ [(set (attr "type")
(cond [(match_operand:SF 3 "mult_operator" "")
(const_string "ssemul")
(match_operand:SF 3 "div_operator" "")
@@ -15324,10 +15342,10 @@
&& !COMMUTATIVE_ARITH_P (operands[3])
&& (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:SF 3 "mult_operator" "")
+ [(set (attr "type")
+ (cond [(match_operand:SF 3 "mult_operator" "")
(const_string "fmul")
- (match_operand:SF 3 "div_operator" "")
+ (match_operand:SF 3 "div_operator" "")
(const_string "fdiv")
]
(const_string "fop")))
@@ -15341,10 +15359,10 @@
(match_operand:SF 2 "register_operand" "0,0")]))]
"TARGET_80387 && TARGET_USE_<MODE>MODE_FIOP && !TARGET_SSE_MATH"
"* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:SF 3 "mult_operator" "")
+ [(set (attr "type")
+ (cond [(match_operand:SF 3 "mult_operator" "")
(const_string "fmul")
- (match_operand:SF 3 "div_operator" "")
+ (match_operand:SF 3 "div_operator" "")
(const_string "fdiv")
]
(const_string "fop")))
@@ -15358,10 +15376,10 @@
(float:SF (match_operand:X87MODEI12 2 "nonimmediate_operand" "m,?r"))]))]
"TARGET_80387 && TARGET_USE_<MODE>MODE_FIOP && !TARGET_SSE_MATH"
"* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:SF 3 "mult_operator" "")
+ [(set (attr "type")
+ (cond [(match_operand:SF 3 "mult_operator" "")
(const_string "fmul")
- (match_operand:SF 3 "div_operator" "")
+ (match_operand:SF 3 "div_operator" "")
(const_string "fdiv")
]
(const_string "fop")))
@@ -15377,12 +15395,12 @@
&& COMMUTATIVE_ARITH_P (operands[3])
&& (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
+ [(set (attr "type")
(if_then_else (eq_attr "alternative" "1")
- (if_then_else (match_operand:DF 3 "mult_operator" "")
+ (if_then_else (match_operand:DF 3 "mult_operator" "")
(const_string "ssemul")
(const_string "sseadd"))
- (if_then_else (match_operand:DF 3 "mult_operator" "")
+ (if_then_else (match_operand:DF 3 "mult_operator" "")
(const_string "fmul")
(const_string "fop"))))
(set_attr "mode" "DF")])
@@ -15396,8 +15414,8 @@
&& COMMUTATIVE_ARITH_P (operands[3])
&& (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (if_then_else (match_operand:DF 3 "mult_operator" "")
+ [(set (attr "type")
+ (if_then_else (match_operand:DF 3 "mult_operator" "")
(const_string "ssemul")
(const_string "sseadd")))
(set_attr "mode" "DF")])
@@ -15411,8 +15429,8 @@
&& COMMUTATIVE_ARITH_P (operands[3])
&& (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (if_then_else (match_operand:DF 3 "mult_operator" "")
+ [(set (attr "type")
+ (if_then_else (match_operand:DF 3 "mult_operator" "")
(const_string "fmul")
(const_string "fop")))
(set_attr "mode" "DF")])
@@ -15426,7 +15444,7 @@
&& !COMMUTATIVE_ARITH_P (operands[3])
&& (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
+ [(set (attr "type")
(cond [(and (eq_attr "alternative" "2")
(match_operand:DF 3 "mult_operator" ""))
(const_string "ssemul")
@@ -15435,9 +15453,9 @@
(const_string "ssediv")
(eq_attr "alternative" "2")
(const_string "sseadd")
- (match_operand:DF 3 "mult_operator" "")
+ (match_operand:DF 3 "mult_operator" "")
(const_string "fmul")
- (match_operand:DF 3 "div_operator" "")
+ (match_operand:DF 3 "div_operator" "")
(const_string "fdiv")
]
(const_string "fop")))
@@ -15452,7 +15470,7 @@
&& !COMMUTATIVE_ARITH_P (operands[3])"
"* return output_387_binary_op (insn, operands);"
[(set_attr "mode" "DF")
- (set (attr "type")
+ (set (attr "type")
(cond [(match_operand:DF 3 "mult_operator" "")
(const_string "ssemul")
(match_operand:DF 3 "div_operator" "")
@@ -15470,8 +15488,8 @@
&& !COMMUTATIVE_ARITH_P (operands[3])
&& (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:DF 3 "mult_operator" "")
+ [(set (attr "type")
+ (cond [(match_operand:DF 3 "mult_operator" "")
(const_string "fmul")
(match_operand:DF 3 "div_operator" "")
(const_string "fdiv")
@@ -15488,10 +15506,10 @@
"TARGET_80387 && TARGET_USE_<MODE>MODE_FIOP
&& !(TARGET_SSE2 && TARGET_SSE_MATH)"
"* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:DF 3 "mult_operator" "")
+ [(set (attr "type")
+ (cond [(match_operand:DF 3 "mult_operator" "")
(const_string "fmul")
- (match_operand:DF 3 "div_operator" "")
+ (match_operand:DF 3 "div_operator" "")
(const_string "fdiv")
]
(const_string "fop")))
@@ -15506,10 +15524,10 @@
"TARGET_80387 && TARGET_USE_<MODE>MODE_FIOP
&& !(TARGET_SSE2 && TARGET_SSE_MATH)"
"* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:DF 3 "mult_operator" "")
+ [(set (attr "type")
+ (cond [(match_operand:DF 3 "mult_operator" "")
(const_string "fmul")
- (match_operand:DF 3 "div_operator" "")
+ (match_operand:DF 3 "div_operator" "")
(const_string "fdiv")
]
(const_string "fop")))
@@ -15524,10 +15542,10 @@
"TARGET_80387 && !(TARGET_SSE2 && TARGET_SSE_MATH)
&& (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:DF 3 "mult_operator" "")
+ [(set (attr "type")
+ (cond [(match_operand:DF 3 "mult_operator" "")
(const_string "fmul")
- (match_operand:DF 3 "div_operator" "")
+ (match_operand:DF 3 "div_operator" "")
(const_string "fdiv")
]
(const_string "fop")))
@@ -15541,10 +15559,10 @@
(match_operand:SF 2 "nonimmediate_operand" "fm,0"))]))]
"TARGET_80387 && !(TARGET_SSE2 && TARGET_SSE_MATH)"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:DF 3 "mult_operator" "")
+ [(set (attr "type")
+ (cond [(match_operand:DF 3 "mult_operator" "")
(const_string "fmul")
- (match_operand:DF 3 "div_operator" "")
+ (match_operand:DF 3 "div_operator" "")
(const_string "fdiv")
]
(const_string "fop")))
@@ -15559,10 +15577,10 @@
(match_operand:SF 2 "nonimmediate_operand" "fm,0"))]))]
"TARGET_80387 && !(TARGET_SSE2 && TARGET_SSE_MATH)"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:DF 3 "mult_operator" "")
+ [(set (attr "type")
+ (cond [(match_operand:DF 3 "mult_operator" "")
(const_string "fmul")
- (match_operand:DF 3 "div_operator" "")
+ (match_operand:DF 3 "div_operator" "")
(const_string "fdiv")
]
(const_string "fop")))
@@ -15576,8 +15594,8 @@
"TARGET_80387
&& COMMUTATIVE_ARITH_P (operands[3])"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (if_then_else (match_operand:XF 3 "mult_operator" "")
+ [(set (attr "type")
+ (if_then_else (match_operand:XF 3 "mult_operator" "")
(const_string "fmul")
(const_string "fop")))
(set_attr "mode" "XF")])
@@ -15590,10 +15608,10 @@
"TARGET_80387
&& !COMMUTATIVE_ARITH_P (operands[3])"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:XF 3 "mult_operator" "")
+ [(set (attr "type")
+ (cond [(match_operand:XF 3 "mult_operator" "")
(const_string "fmul")
- (match_operand:XF 3 "div_operator" "")
+ (match_operand:XF 3 "div_operator" "")
(const_string "fdiv")
]
(const_string "fop")))
@@ -15606,10 +15624,10 @@
(match_operand:XF 2 "register_operand" "0,0")]))]
"TARGET_80387 && TARGET_USE_<MODE>MODE_FIOP"
"* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:XF 3 "mult_operator" "")
+ [(set (attr "type")
+ (cond [(match_operand:XF 3 "mult_operator" "")
(const_string "fmul")
- (match_operand:XF 3 "div_operator" "")
+ (match_operand:XF 3 "div_operator" "")
(const_string "fdiv")
]
(const_string "fop")))
@@ -15623,10 +15641,10 @@
(float:XF (match_operand:X87MODEI12 2 "nonimmediate_operand" "m,?r"))]))]
"TARGET_80387 && TARGET_USE_<MODE>MODE_FIOP"
"* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:XF 3 "mult_operator" "")
+ [(set (attr "type")
+ (cond [(match_operand:XF 3 "mult_operator" "")
(const_string "fmul")
- (match_operand:XF 3 "div_operator" "")
+ (match_operand:XF 3 "div_operator" "")
(const_string "fdiv")
]
(const_string "fop")))
@@ -15640,10 +15658,10 @@
(match_operand:XF 2 "register_operand" "0,f")]))]
"TARGET_80387"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:XF 3 "mult_operator" "")
+ [(set (attr "type")
+ (cond [(match_operand:XF 3 "mult_operator" "")
(const_string "fmul")
- (match_operand:XF 3 "div_operator" "")
+ (match_operand:XF 3 "div_operator" "")
(const_string "fdiv")
]
(const_string "fop")))
@@ -15657,10 +15675,10 @@
(match_operand 2 "nonimmediate_operand" "fm,0"))]))]
"TARGET_80387"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:XF 3 "mult_operator" "")
+ [(set (attr "type")
+ (cond [(match_operand:XF 3 "mult_operator" "")
(const_string "fmul")
- (match_operand:XF 3 "div_operator" "")
+ (match_operand:XF 3 "div_operator" "")
(const_string "fdiv")
]
(const_string "fop")))
@@ -15675,10 +15693,10 @@
(match_operand 2 "nonimmediate_operand" "fm,0"))]))]
"TARGET_80387"
"* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:XF 3 "mult_operator" "")
+ [(set (attr "type")
+ (cond [(match_operand:XF 3 "mult_operator" "")
(const_string "fmul")
- (match_operand:XF 3 "div_operator" "")
+ (match_operand:XF 3 "div_operator" "")
(const_string "fdiv")
]
(const_string "fop")))
@@ -15692,7 +15710,7 @@
"TARGET_80387 && reload_completed
&& FLOAT_MODE_P (GET_MODE (operands[0]))"
[(const_int 0)]
-{
+{
operands[4] = ix86_force_to_memory (GET_MODE (operands[1]), operands[1]);
operands[4] = gen_rtx_FLOAT (GET_MODE (operands[0]), operands[4]);
emit_insn (gen_rtx_SET (VOIDmode, operands[0],
@@ -16105,7 +16123,7 @@
(set_attr "mode" "XF")])
;; With sincos pattern defined, sin and cos builtin function will be
-;; expanded to sincos pattern with one of its outputs left unused.
+;; expanded to sincos pattern with one of its outputs left unused.
;; Cse pass will detected, if two sincos patterns can be combined,
;; otherwise sincos pattern will be split back to sin or cos pattern,
;; depending on the unused output.
@@ -17507,7 +17525,7 @@
[(set_attr "type" "fpspc")
(set_attr "mode" "DI")])
-(define_split
+(define_split
[(set (match_operand:DI 0 "register_operand" "")
(unspec:DI [(match_operand:XF 1 "register_operand" "")]
UNSPEC_FIST))
@@ -17519,7 +17537,7 @@
(set (match_dup 0) (match_dup 2))]
"")
-(define_split
+(define_split
[(set (match_operand:DI 0 "memory_operand" "")
(unspec:DI [(match_operand:XF 1 "register_operand" "")]
UNSPEC_FIST))
@@ -17570,7 +17588,7 @@
[(set_attr "type" "fpspc")
(set_attr "mode" "<MODE>")])
-(define_split
+(define_split
[(set (match_operand:X87MODEI12 0 "register_operand" "")
(unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")]
UNSPEC_FIST))
@@ -17581,7 +17599,7 @@
(set (match_dup 0) (match_dup 2))]
"")
-(define_split
+(define_split
[(set (match_operand:X87MODEI12 0 "memory_operand" "")
(unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")]
UNSPEC_FIST))
@@ -17744,7 +17762,7 @@
(set_attr "i387_cw" "floor")
(set_attr "mode" "DI")])
-(define_split
+(define_split
[(set (match_operand:DI 0 "register_operand" "")
(unspec:DI [(match_operand:XF 1 "register_operand" "")]
UNSPEC_FIST_FLOOR))
@@ -17760,7 +17778,7 @@
(set (match_dup 0) (match_dup 4))]
"")
-(define_split
+(define_split
[(set (match_operand:DI 0 "memory_operand" "")
(unspec:DI [(match_operand:XF 1 "register_operand" "")]
UNSPEC_FIST_FLOOR))
@@ -17802,7 +17820,7 @@
(set_attr "i387_cw" "floor")
(set_attr "mode" "<MODE>")])
-(define_split
+(define_split
[(set (match_operand:X87MODEI12 0 "register_operand" "")
(unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")]
UNSPEC_FIST_FLOOR))
@@ -17817,7 +17835,7 @@
(set (match_dup 0) (match_dup 4))]
"")
-(define_split
+(define_split
[(set (match_operand:X87MODEI12 0 "memory_operand" "")
(unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")]
UNSPEC_FIST_FLOOR))
@@ -17985,7 +18003,7 @@
(set_attr "i387_cw" "ceil")
(set_attr "mode" "DI")])
-(define_split
+(define_split
[(set (match_operand:DI 0 "register_operand" "")
(unspec:DI [(match_operand:XF 1 "register_operand" "")]
UNSPEC_FIST_CEIL))
@@ -18001,7 +18019,7 @@
(set (match_dup 0) (match_dup 4))]
"")
-(define_split
+(define_split
[(set (match_operand:DI 0 "memory_operand" "")
(unspec:DI [(match_operand:XF 1 "register_operand" "")]
UNSPEC_FIST_CEIL))
@@ -18043,7 +18061,7 @@
(set_attr "i387_cw" "ceil")
(set_attr "mode" "<MODE>")])
-(define_split
+(define_split
[(set (match_operand:X87MODEI12 0 "register_operand" "")
(unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")]
UNSPEC_FIST_CEIL))
@@ -18058,7 +18076,7 @@
(set (match_dup 0) (match_dup 4))]
"")
-(define_split
+(define_split
[(set (match_operand:X87MODEI12 0 "memory_operand" "")
(unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")]
UNSPEC_FIST_CEIL))
@@ -18452,11 +18470,11 @@
(define_insn "*rep_movdi_rex64"
[(set (match_operand:DI 2 "register_operand" "=c") (const_int 0))
- (set (match_operand:DI 0 "register_operand" "=D")
+ (set (match_operand:DI 0 "register_operand" "=D")
(plus:DI (ashift:DI (match_operand:DI 5 "register_operand" "2")
(const_int 3))
(match_operand:DI 3 "register_operand" "0")))
- (set (match_operand:DI 1 "register_operand" "=S")
+ (set (match_operand:DI 1 "register_operand" "=S")
(plus:DI (ashift:DI (match_dup 5) (const_int 3))
(match_operand:DI 4 "register_operand" "1")))
(set (mem:BLK (match_dup 3))
@@ -18472,11 +18490,11 @@
(define_insn "*rep_movsi"
[(set (match_operand:SI 2 "register_operand" "=c") (const_int 0))
- (set (match_operand:SI 0 "register_operand" "=D")
+ (set (match_operand:SI 0 "register_operand" "=D")
(plus:SI (ashift:SI (match_operand:SI 5 "register_operand" "2")
(const_int 2))
(match_operand:SI 3 "register_operand" "0")))
- (set (match_operand:SI 1 "register_operand" "=S")
+ (set (match_operand:SI 1 "register_operand" "=S")
(plus:SI (ashift:SI (match_dup 5) (const_int 2))
(match_operand:SI 4 "register_operand" "1")))
(set (mem:BLK (match_dup 3))
@@ -18492,11 +18510,11 @@
(define_insn "*rep_movsi_rex64"
[(set (match_operand:DI 2 "register_operand" "=c") (const_int 0))
- (set (match_operand:DI 0 "register_operand" "=D")
+ (set (match_operand:DI 0 "register_operand" "=D")
(plus:DI (ashift:DI (match_operand:DI 5 "register_operand" "2")
(const_int 2))
(match_operand:DI 3 "register_operand" "0")))
- (set (match_operand:DI 1 "register_operand" "=S")
+ (set (match_operand:DI 1 "register_operand" "=S")
(plus:DI (ashift:DI (match_dup 5) (const_int 2))
(match_operand:DI 4 "register_operand" "1")))
(set (mem:BLK (match_dup 3))
@@ -18512,10 +18530,10 @@
(define_insn "*rep_movqi"
[(set (match_operand:SI 2 "register_operand" "=c") (const_int 0))
- (set (match_operand:SI 0 "register_operand" "=D")
+ (set (match_operand:SI 0 "register_operand" "=D")
(plus:SI (match_operand:SI 3 "register_operand" "0")
(match_operand:SI 5 "register_operand" "2")))
- (set (match_operand:SI 1 "register_operand" "=S")
+ (set (match_operand:SI 1 "register_operand" "=S")
(plus:SI (match_operand:SI 4 "register_operand" "1") (match_dup 5)))
(set (mem:BLK (match_dup 3))
(mem:BLK (match_dup 4)))
@@ -18530,10 +18548,10 @@
(define_insn "*rep_movqi_rex64"
[(set (match_operand:DI 2 "register_operand" "=c") (const_int 0))
- (set (match_operand:DI 0 "register_operand" "=D")
+ (set (match_operand:DI 0 "register_operand" "=D")
(plus:DI (match_operand:DI 3 "register_operand" "0")
(match_operand:DI 5 "register_operand" "2")))
- (set (match_operand:DI 1 "register_operand" "=S")
+ (set (match_operand:DI 1 "register_operand" "=S")
(plus:DI (match_operand:DI 4 "register_operand" "1") (match_dup 5)))
(set (mem:BLK (match_dup 3))
(mem:BLK (match_dup 4)))
@@ -18720,7 +18738,7 @@
(define_insn "*rep_stosdi_rex64"
[(set (match_operand:DI 1 "register_operand" "=c") (const_int 0))
- (set (match_operand:DI 0 "register_operand" "=D")
+ (set (match_operand:DI 0 "register_operand" "=D")
(plus:DI (ashift:DI (match_operand:DI 4 "register_operand" "1")
(const_int 3))
(match_operand:DI 3 "register_operand" "0")))
@@ -18738,7 +18756,7 @@
(define_insn "*rep_stossi"
[(set (match_operand:SI 1 "register_operand" "=c") (const_int 0))
- (set (match_operand:SI 0 "register_operand" "=D")
+ (set (match_operand:SI 0 "register_operand" "=D")
(plus:SI (ashift:SI (match_operand:SI 4 "register_operand" "1")
(const_int 2))
(match_operand:SI 3 "register_operand" "0")))
@@ -18756,7 +18774,7 @@
(define_insn "*rep_stossi_rex64"
[(set (match_operand:DI 1 "register_operand" "=c") (const_int 0))
- (set (match_operand:DI 0 "register_operand" "=D")
+ (set (match_operand:DI 0 "register_operand" "=D")
(plus:DI (ashift:DI (match_operand:DI 4 "register_operand" "1")
(const_int 2))
(match_operand:DI 3 "register_operand" "0")))
@@ -18774,7 +18792,7 @@
(define_insn "*rep_stosqi"
[(set (match_operand:SI 1 "register_operand" "=c") (const_int 0))
- (set (match_operand:SI 0 "register_operand" "=D")
+ (set (match_operand:SI 0 "register_operand" "=D")
(plus:SI (match_operand:SI 3 "register_operand" "0")
(match_operand:SI 4 "register_operand" "1")))
(set (mem:BLK (match_dup 3))
@@ -18791,7 +18809,7 @@
(define_insn "*rep_stosqi_rex64"
[(set (match_operand:DI 1 "register_operand" "=c") (const_int 0))
- (set (match_operand:DI 0 "register_operand" "=D")
+ (set (match_operand:DI 0 "register_operand" "=D")
(plus:DI (match_operand:DI 3 "register_operand" "0")
(match_operand:DI 4 "register_operand" "1")))
(set (mem:BLK (match_dup 3))
@@ -19167,7 +19185,7 @@
(define_insn "*movdicc_c_rex64"
[(set (match_operand:DI 0 "register_operand" "=r,r")
- (if_then_else:DI (match_operator 1 "ix86_comparison_operator"
+ (if_then_else:DI (match_operator 1 "ix86_comparison_operator"
[(reg FLAGS_REG) (const_int 0)])
(match_operand:DI 2 "nonimmediate_operand" "rm,0")
(match_operand:DI 3 "nonimmediate_operand" "0,rm")))]
@@ -19210,7 +19228,7 @@
(define_insn "*movsicc_noc"
[(set (match_operand:SI 0 "register_operand" "=r,r")
- (if_then_else:SI (match_operator 1 "ix86_comparison_operator"
+ (if_then_else:SI (match_operator 1 "ix86_comparison_operator"
[(reg FLAGS_REG) (const_int 0)])
(match_operand:SI 2 "nonimmediate_operand" "rm,0")
(match_operand:SI 3 "nonimmediate_operand" "0,rm")))]
@@ -19232,7 +19250,7 @@
(define_insn "*movhicc_noc"
[(set (match_operand:HI 0 "register_operand" "=r,r")
- (if_then_else:HI (match_operator 1 "ix86_comparison_operator"
+ (if_then_else:HI (match_operator 1 "ix86_comparison_operator"
[(reg FLAGS_REG) (const_int 0)])
(match_operand:HI 2 "nonimmediate_operand" "rm,0")
(match_operand:HI 3 "nonimmediate_operand" "0,rm")))]
@@ -19254,7 +19272,7 @@
(define_insn_and_split "*movqicc_noc"
[(set (match_operand:QI 0 "register_operand" "=r,r")
- (if_then_else:QI (match_operator 1 "ix86_comparison_operator"
+ (if_then_else:QI (match_operator 1 "ix86_comparison_operator"
[(match_operand 4 "flags_reg_operand" "")
(const_int 0)])
(match_operand:QI 2 "register_operand" "r,0")
@@ -19282,7 +19300,7 @@
(define_insn "*movsfcc_1_387"
[(set (match_operand:SF 0 "register_operand" "=f,f,r,r")
- (if_then_else:SF (match_operator 1 "fcmov_comparison_operator"
+ (if_then_else:SF (match_operator 1 "fcmov_comparison_operator"
[(reg FLAGS_REG) (const_int 0)])
(match_operand:SF 2 "nonimmediate_operand" "f,0,rm,0")
(match_operand:SF 3 "nonimmediate_operand" "0,f,0,rm")))]
@@ -19306,7 +19324,7 @@
(define_insn "*movdfcc_1"
[(set (match_operand:DF 0 "register_operand" "=f,f,&r,&r")
- (if_then_else:DF (match_operator 1 "fcmov_comparison_operator"
+ (if_then_else:DF (match_operator 1 "fcmov_comparison_operator"
[(reg FLAGS_REG) (const_int 0)])
(match_operand:DF 2 "nonimmediate_operand" "f,0,rm,0")
(match_operand:DF 3 "nonimmediate_operand" "0,f,0,rm")))]
@@ -19322,7 +19340,7 @@
(define_insn "*movdfcc_1_rex64"
[(set (match_operand:DF 0 "register_operand" "=f,f,r,r")
- (if_then_else:DF (match_operator 1 "fcmov_comparison_operator"
+ (if_then_else:DF (match_operator 1 "fcmov_comparison_operator"
[(reg FLAGS_REG) (const_int 0)])
(match_operand:DF 2 "nonimmediate_operand" "f,0,rm,0")
(match_operand:DF 3 "nonimmediate_operand" "0,f,0,rm")))]
@@ -19338,7 +19356,7 @@
(define_split
[(set (match_operand:DF 0 "register_and_not_any_fp_reg_operand" "")
- (if_then_else:DF (match_operator 1 "fcmov_comparison_operator"
+ (if_then_else:DF (match_operator 1 "fcmov_comparison_operator"
[(match_operand 4 "flags_reg_operand" "")
(const_int 0)])
(match_operand:DF 2 "nonimmediate_operand" "")
@@ -19366,7 +19384,7 @@
(define_insn "*movxfcc_1"
[(set (match_operand:XF 0 "register_operand" "=f,f")
- (if_then_else:XF (match_operator 1 "fcmov_comparison_operator"
+ (if_then_else:XF (match_operator 1 "fcmov_comparison_operator"
[(reg FLAGS_REG) (const_int 0)])
(match_operand:XF 2 "register_operand" "f,0")
(match_operand:XF 3 "register_operand" "0,f")))]
@@ -19528,7 +19546,7 @@
;; This pattern exists to put a dependency on all ebp-based memory accesses.
;; Otherwise there will be nothing to keep
-;;
+;;
;; [(set (reg ebp) (reg esp))]
;; [(set (reg esp) (plus (reg esp) (const_int -160000)))
;; (clobber (eflags)]
@@ -19720,7 +19738,7 @@
&& INTVAL (operands[1]) < CHECK_STACK_LIMIT)
emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx,
operands[1]));
- else
+ else
#endif
emit_insn (gen_allocate_stack_worker (copy_to_mode_reg (SImode,
operands[1])));
@@ -19760,12 +19778,12 @@
(match_operand 2 "aligned_operand" "")]))
(clobber (reg:CC FLAGS_REG))]
"! TARGET_PARTIAL_REG_STALL && reload_completed
- && ((GET_MODE (operands[0]) == HImode
+ && ((GET_MODE (operands[0]) == HImode
&& ((!optimize_size && !TARGET_FAST_PREFIX)
/* ??? next two lines just !satisfies_constraint_K (...) */
|| GET_CODE (operands[2]) != CONST_INT
|| satisfies_constraint_K (operands[2])))
- || (GET_MODE (operands[0]) == QImode
+ || (GET_MODE (operands[0]) == QImode
&& (TARGET_PROMOTE_QImode || optimize_size)))"
[(parallel [(set (match_dup 0)
(match_op_dup 3 [(match_dup 1) (match_dup 2)]))
@@ -19838,7 +19856,7 @@
(clobber (reg:CC FLAGS_REG))]
"! TARGET_PARTIAL_REG_STALL && reload_completed
&& (GET_MODE (operands[0]) == HImode
- || (GET_MODE (operands[0]) == QImode
+ || (GET_MODE (operands[0]) == QImode
&& (TARGET_PROMOTE_QImode || optimize_size)))"
[(parallel [(set (match_dup 0)
(neg:SI (match_dup 1)))
@@ -19851,29 +19869,29 @@
(not (match_operand 1 "register_operand" "")))]
"! TARGET_PARTIAL_REG_STALL && reload_completed
&& (GET_MODE (operands[0]) == HImode
- || (GET_MODE (operands[0]) == QImode
+ || (GET_MODE (operands[0]) == QImode
&& (TARGET_PROMOTE_QImode || optimize_size)))"
[(set (match_dup 0)
(not:SI (match_dup 1)))]
"operands[0] = gen_lowpart (SImode, operands[0]);
operands[1] = gen_lowpart (SImode, operands[1]);")
-(define_split
+(define_split
[(set (match_operand 0 "register_operand" "")
- (if_then_else (match_operator 1 "comparison_operator"
+ (if_then_else (match_operator 1 "comparison_operator"
[(reg FLAGS_REG) (const_int 0)])
(match_operand 2 "register_operand" "")
(match_operand 3 "register_operand" "")))]
"! TARGET_PARTIAL_REG_STALL && TARGET_CMOVE
&& (GET_MODE (operands[0]) == HImode
- || (GET_MODE (operands[0]) == QImode
+ || (GET_MODE (operands[0]) == QImode
&& (TARGET_PROMOTE_QImode || optimize_size)))"
[(set (match_dup 0)
(if_then_else:SI (match_dup 1) (match_dup 2) (match_dup 3)))]
"operands[0] = gen_lowpart (SImode, operands[0]);
operands[2] = gen_lowpart (SImode, operands[2]);
operands[3] = gen_lowpart (SImode, operands[3]);")
-
+
;; RTL Peephole optimizations, run before sched2. These primarily look to
;; transform a complex memory operation into two memory to register operations.
@@ -20018,7 +20036,7 @@
(set (match_dup 0) (match_op_dup 1 [(match_dup 3) (const_int 0)]))]
"")
-;; NOT is not pairable on Pentium, while XOR is, but one byte longer.
+;; NOT is not pairable on Pentium, while XOR is, but one byte longer.
;; Don't split NOTs with a displacement operand, because resulting XOR
;; will not be pairable anyway.
;;
@@ -20034,7 +20052,7 @@
(not:SI (match_operand:SI 1 "nonimmediate_operand" "")))]
"!optimize_size
&& peep2_regno_dead_p (0, FLAGS_REG)
- && ((TARGET_PENTIUM
+ && ((TARGET_PENTIUM
&& (GET_CODE (operands[0]) != MEM
|| !memory_displacement_operand (operands[0], SImode)))
|| (TARGET_K6 && long_memory_operand (operands[0], SImode)))"
@@ -20048,7 +20066,7 @@
(not:HI (match_operand:HI 1 "nonimmediate_operand" "")))]
"!optimize_size
&& peep2_regno_dead_p (0, FLAGS_REG)
- && ((TARGET_PENTIUM
+ && ((TARGET_PENTIUM
&& (GET_CODE (operands[0]) != MEM
|| !memory_displacement_operand (operands[0], HImode)))
|| (TARGET_K6 && long_memory_operand (operands[0], HImode)))"
@@ -20062,7 +20080,7 @@
(not:QI (match_operand:QI 1 "nonimmediate_operand" "")))]
"!optimize_size
&& peep2_regno_dead_p (0, FLAGS_REG)
- && ((TARGET_PENTIUM
+ && ((TARGET_PENTIUM
&& (GET_CODE (operands[0]) != MEM
|| !memory_displacement_operand (operands[0], QImode)))
|| (TARGET_K6 && long_memory_operand (operands[0], QImode)))"
@@ -20143,7 +20161,7 @@
(set (zero_extract:SI (match_dup 2)
(const_int 8)
(const_int 8))
- (and:SI
+ (and:SI
(zero_extract:SI
(match_dup 2)
(const_int 8)
@@ -20245,7 +20263,7 @@
[(set (match_operand 0 "register_operand" "")
(const_int -1))]
"(GET_MODE (operands[0]) == HImode
- || GET_MODE (operands[0]) == SImode
+ || GET_MODE (operands[0]) == SImode
|| (GET_MODE (operands[0]) == DImode && TARGET_64BIT))
&& (optimize_size || TARGET_PENTIUM)
&& peep2_regno_dead_p (0, FLAGS_REG)"
@@ -20601,7 +20619,7 @@
(mult:SI (match_operand:SI 1 "nonimmediate_operand" "")
(match_operand:SI 2 "const_int_operand" "")))
(clobber (reg:CC FLAGS_REG))])]
- "!optimize_size
+ "!optimize_size
&& (INTVAL (operands[2]) == 3
|| INTVAL (operands[2]) == 5
|| INTVAL (operands[2]) == 9)"
@@ -20633,7 +20651,7 @@
(match_operand:DI 2 "const_int_operand" "")))
(clobber (reg:CC FLAGS_REG))])]
"TARGET_64BIT
- && !optimize_size
+ && !optimize_size
&& (INTVAL (operands[2]) == 3
|| INTVAL (operands[2]) == 5
|| INTVAL (operands[2]) == 9)"
@@ -20764,7 +20782,7 @@
&& ((!TARGET_PARTIAL_REG_STALL
&& (GET_MODE (operands[0]) == QImode
|| GET_MODE (operands[0]) == HImode))
- || GET_MODE (operands[0]) == SImode
+ || GET_MODE (operands[0]) == SImode
|| (TARGET_64BIT && GET_MODE (operands[0]) == DImode))
/* We reorder load and the shift. */
&& !rtx_equal_p (operands[1], operands[3])
@@ -20913,7 +20931,7 @@
[(set_attr "type" "callv")])
;; We used to use "int $5", in honor of #BR which maps to interrupt vector 5.
-;; That, however, is usually mapped by the OS to SIGSEGV, which is often
+;; That, however, is usually mapped by the OS to SIGSEGV, which is often
;; caught for use by garbage collectors and the like. Using an insn that
;; maps to SIGILL makes it more likely the program will rightfully die.
;; Keeping with tradition, "6" is in honor of #UD.
@@ -21021,7 +21039,7 @@
int locality = INTVAL (operands[1]);
gcc_assert (locality >= 0 && locality <= 3);
- return patterns[locality];
+ return patterns[locality];
}
[(set_attr "type" "sse")
(set_attr "memory" "none")])
@@ -21039,7 +21057,7 @@
int locality = INTVAL (operands[1]);
gcc_assert (locality >= 0 && locality <= 3);
- return patterns[locality];
+ return patterns[locality];
}
[(set_attr "type" "sse")
(set_attr "memory" "none")])
diff --git a/contrib/gcc/config/i386/nto.h b/contrib/gcc/config/i386/nto.h
index 1095a63..42ae556 100644
--- a/contrib/gcc/config/i386/nto.h
+++ b/contrib/gcc/config/i386/nto.h
@@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA. */
#undef THREAD_MODEL_SPEC
#define THREAD_MODEL_SPEC "posix"
-#ifdef CROSS_COMPILE
+#ifdef CROSS_DIRECTORY_STRUCTURE
#define SYSROOT_SUFFIX_SPEC "x86"
#endif
diff --git a/contrib/gcc/config/rs6000/aix.h b/contrib/gcc/config/rs6000/aix.h
index 57f4876..242bd02 100644
--- a/contrib/gcc/config/rs6000/aix.h
+++ b/contrib/gcc/config/rs6000/aix.h
@@ -124,14 +124,14 @@
/* #define ASM_SPEC "-u %(asm_cpu)" */
/* Default location of syscalls.exp under AIX */
-#ifndef CROSS_COMPILE
+#ifndef CROSS_DIRECTORY_STRUCTURE
#define LINK_SYSCALLS_SPEC "-bI:/lib/syscalls.exp"
#else
#define LINK_SYSCALLS_SPEC ""
#endif
/* Default location of libg.exp under AIX */
-#ifndef CROSS_COMPILE
+#ifndef CROSS_DIRECTORY_STRUCTURE
#define LINK_LIBG_SPEC "-bexport:/usr/lib/libg.exp"
#else
#define LINK_LIBG_SPEC ""
diff --git a/contrib/gcc/config/rs6000/rs6000.c b/contrib/gcc/config/rs6000/rs6000.c
index c7efad5..287902f 100644
--- a/contrib/gcc/config/rs6000/rs6000.c
+++ b/contrib/gcc/config/rs6000/rs6000.c
@@ -1171,11 +1171,9 @@ rs6000_override_options (const char *default_cpu)
{"801", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
{"821", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
{"823", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
- {"8540", PROCESSOR_PPC8540,
- POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_STRICT_ALIGN},
+ {"8540", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN},
/* 8548 has a dummy entry for now. */
- {"8548", PROCESSOR_PPC8540,
- POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_STRICT_ALIGN},
+ {"8548", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN},
{"860", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
{"970", PROCESSOR_POWER4,
POWERPC_7400_MASK | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64},
@@ -14468,77 +14466,6 @@ rs6000_emit_prologue (void)
sp_offset = info->total_size;
}
- /* Save AltiVec registers if needed. */
- if (!WORLD_SAVE_P (info) && TARGET_ALTIVEC_ABI && info->altivec_size != 0)
- {
- int i;
-
- /* There should be a non inline version of this, for when we
- are saving lots of vector registers. */
- for (i = info->first_altivec_reg_save; i <= LAST_ALTIVEC_REGNO; ++i)
- if (info->vrsave_mask & ALTIVEC_REG_BIT (i))
- {
- rtx areg, savereg, mem;
- int offset;
-
- offset = info->altivec_save_offset + sp_offset
- + 16 * (i - info->first_altivec_reg_save);
-
- savereg = gen_rtx_REG (V4SImode, i);
-
- areg = gen_rtx_REG (Pmode, 0);
- emit_move_insn (areg, GEN_INT (offset));
-
- /* AltiVec addressing mode is [reg+reg]. */
- mem = gen_frame_mem (V4SImode,
- gen_rtx_PLUS (Pmode, frame_reg_rtx, areg));
-
- insn = emit_move_insn (mem, savereg);
-
- rs6000_frame_related (insn, frame_ptr_rtx, info->total_size,
- areg, GEN_INT (offset));
- }
- }
-
- /* VRSAVE is a bit vector representing which AltiVec registers
- are used. The OS uses this to determine which vector
- registers to save on a context switch. We need to save
- VRSAVE on the stack frame, add whatever AltiVec registers we
- used in this function, and do the corresponding magic in the
- epilogue. */
-
- if (TARGET_ALTIVEC && TARGET_ALTIVEC_VRSAVE
- && info->vrsave_mask != 0)
- {
- rtx reg, mem, vrsave;
- int offset;
-
- /* Get VRSAVE onto a GPR. Note that ABI_V4 might be using r12
- as frame_reg_rtx and r11 as the static chain pointer for
- nested functions. */
- reg = gen_rtx_REG (SImode, 0);
- vrsave = gen_rtx_REG (SImode, VRSAVE_REGNO);
- if (TARGET_MACHO)
- emit_insn (gen_get_vrsave_internal (reg));
- else
- emit_insn (gen_rtx_SET (VOIDmode, reg, vrsave));
-
- if (!WORLD_SAVE_P (info))
- {
- /* Save VRSAVE. */
- offset = info->vrsave_save_offset + sp_offset;
- mem = gen_frame_mem (SImode,
- gen_rtx_PLUS (Pmode, frame_reg_rtx,
- GEN_INT (offset)));
- insn = emit_move_insn (mem, reg);
- }
-
- /* Include the registers in the mask. */
- emit_insn (gen_iorsi3 (reg, reg, GEN_INT ((int) info->vrsave_mask)));
-
- insn = emit_insn (generate_set_vrsave (reg, info, 0));
- }
-
/* If we use the link register, get it into r0. */
if (!WORLD_SAVE_P (info) && info->lr_save_p)
{
@@ -14776,7 +14703,19 @@ rs6000_emit_prologue (void)
for which it was done previously. */
if (!WORLD_SAVE_P (info) && info->push_p
&& !(DEFAULT_ABI == ABI_V4 || current_function_calls_eh_return))
- rs6000_emit_allocate_stack (info->total_size, FALSE);
+ {
+ if (info->total_size < 32767)
+ sp_offset = info->total_size;
+ else
+ frame_reg_rtx = frame_ptr_rtx;
+ rs6000_emit_allocate_stack (info->total_size,
+ (frame_reg_rtx != sp_reg_rtx
+ && ((info->altivec_size != 0)
+ || (info->vrsave_mask != 0)
+ )));
+ if (frame_reg_rtx != sp_reg_rtx)
+ rs6000_emit_stack_tie ();
+ }
/* Set frame pointer, if needed. */
if (frame_pointer_needed)
@@ -14786,6 +14725,78 @@ rs6000_emit_prologue (void)
RTX_FRAME_RELATED_P (insn) = 1;
}
+ /* Save AltiVec registers if needed. Save here because the red zone does
+ not include AltiVec registers. */
+ if (!WORLD_SAVE_P (info) && TARGET_ALTIVEC_ABI && info->altivec_size != 0)
+ {
+ int i;
+
+ /* There should be a non inline version of this, for when we
+ are saving lots of vector registers. */
+ for (i = info->first_altivec_reg_save; i <= LAST_ALTIVEC_REGNO; ++i)
+ if (info->vrsave_mask & ALTIVEC_REG_BIT (i))
+ {
+ rtx areg, savereg, mem;
+ int offset;
+
+ offset = info->altivec_save_offset + sp_offset
+ + 16 * (i - info->first_altivec_reg_save);
+
+ savereg = gen_rtx_REG (V4SImode, i);
+
+ areg = gen_rtx_REG (Pmode, 0);
+ emit_move_insn (areg, GEN_INT (offset));
+
+ /* AltiVec addressing mode is [reg+reg]. */
+ mem = gen_frame_mem (V4SImode,
+ gen_rtx_PLUS (Pmode, frame_reg_rtx, areg));
+
+ insn = emit_move_insn (mem, savereg);
+
+ rs6000_frame_related (insn, frame_ptr_rtx, info->total_size,
+ areg, GEN_INT (offset));
+ }
+ }
+
+ /* VRSAVE is a bit vector representing which AltiVec registers
+ are used. The OS uses this to determine which vector
+ registers to save on a context switch. We need to save
+ VRSAVE on the stack frame, add whatever AltiVec registers we
+ used in this function, and do the corresponding magic in the
+ epilogue. */
+
+ if (TARGET_ALTIVEC && TARGET_ALTIVEC_VRSAVE
+ && info->vrsave_mask != 0)
+ {
+ rtx reg, mem, vrsave;
+ int offset;
+
+ /* Get VRSAVE onto a GPR. Note that ABI_V4 might be using r12
+ as frame_reg_rtx and r11 as the static chain pointer for
+ nested functions. */
+ reg = gen_rtx_REG (SImode, 0);
+ vrsave = gen_rtx_REG (SImode, VRSAVE_REGNO);
+ if (TARGET_MACHO)
+ emit_insn (gen_get_vrsave_internal (reg));
+ else
+ emit_insn (gen_rtx_SET (VOIDmode, reg, vrsave));
+
+ if (!WORLD_SAVE_P (info))
+ {
+ /* Save VRSAVE. */
+ offset = info->vrsave_save_offset + sp_offset;
+ mem = gen_frame_mem (SImode,
+ gen_rtx_PLUS (Pmode, frame_reg_rtx,
+ GEN_INT (offset)));
+ insn = emit_move_insn (mem, reg);
+ }
+
+ /* Include the registers in the mask. */
+ emit_insn (gen_iorsi3 (reg, reg, GEN_INT ((int) info->vrsave_mask)));
+
+ insn = emit_insn (generate_set_vrsave (reg, info, 0));
+ }
+
/* If we are using RS6000_PIC_OFFSET_TABLE_REGNUM, we need to set it up. */
if ((TARGET_TOC && TARGET_MINIMAL_TOC && get_pool_size () != 0)
|| (DEFAULT_ABI == ABI_V4
@@ -15043,33 +15054,9 @@ rs6000_emit_epilogue (int sibcall)
return;
}
- /* If we have a frame pointer, a call to alloca, or a large stack
- frame, restore the old stack pointer using the backchain. Otherwise,
- we know what size to update it with. */
- if (use_backchain_to_restore_sp)
- {
- /* Under V.4, don't reset the stack pointer until after we're done
- loading the saved registers. */
- if (DEFAULT_ABI == ABI_V4)
- frame_reg_rtx = gen_rtx_REG (Pmode, 11);
-
- emit_move_insn (frame_reg_rtx,
- gen_rtx_MEM (Pmode, sp_reg_rtx));
- }
- else if (info->push_p)
- {
- if (DEFAULT_ABI == ABI_V4
- || current_function_calls_eh_return)
- sp_offset = info->total_size;
- else
- {
- emit_insn (TARGET_32BIT
- ? gen_addsi3 (sp_reg_rtx, sp_reg_rtx,
- GEN_INT (info->total_size))
- : gen_adddi3 (sp_reg_rtx, sp_reg_rtx,
- GEN_INT (info->total_size)));
- }
- }
+ /* Set sp_offset based on the stack push from the prologue. */
+ if (info->total_size < 32767)
+ sp_offset = info->total_size;
/* Restore AltiVec registers if needed. */
if (TARGET_ALTIVEC_ABI && info->altivec_size != 0)
@@ -15110,6 +15097,36 @@ rs6000_emit_epilogue (int sibcall)
emit_insn (generate_set_vrsave (reg, info, 1));
}
+ sp_offset = 0;
+
+ /* If we have a frame pointer, a call to alloca, or a large stack
+ frame, restore the old stack pointer using the backchain. Otherwise,
+ we know what size to update it with. */
+ if (use_backchain_to_restore_sp)
+ {
+ /* Under V.4, don't reset the stack pointer until after we're done
+ loading the saved registers. */
+ if (DEFAULT_ABI == ABI_V4)
+ frame_reg_rtx = gen_rtx_REG (Pmode, 11);
+
+ emit_move_insn (frame_reg_rtx,
+ gen_rtx_MEM (Pmode, sp_reg_rtx));
+ }
+ else if (info->push_p)
+ {
+ if (DEFAULT_ABI == ABI_V4
+ || current_function_calls_eh_return)
+ sp_offset = info->total_size;
+ else
+ {
+ emit_insn (TARGET_32BIT
+ ? gen_addsi3 (sp_reg_rtx, sp_reg_rtx,
+ GEN_INT (info->total_size))
+ : gen_adddi3 (sp_reg_rtx, sp_reg_rtx,
+ GEN_INT (info->total_size)));
+ }
+ }
+
/* Get the old lr if we saved it. */
if (info->lr_save_p)
{
diff --git a/contrib/gcc/config/rs6000/sysv4.h b/contrib/gcc/config/rs6000/sysv4.h
index 0adde2b..0b1eb1e 100644
--- a/contrib/gcc/config/rs6000/sysv4.h
+++ b/contrib/gcc/config/rs6000/sysv4.h
@@ -634,7 +634,7 @@ extern int fixuplabelno;
%{profile: -p}"
/* Don't put -Y P,<path> for cross compilers. */
-#ifndef CROSS_COMPILE
+#ifndef CROSS_DIRECTORY_STRUCTURE
#define LINK_PATH_SPEC "\
%{!R*:%{L*:-R %*}} \
%{!nostdlib: %{!YP,*: \
diff --git a/contrib/gcc/config/svr4.h b/contrib/gcc/config/svr4.h
index 6fa88fc..216e929 100644
--- a/contrib/gcc/config/svr4.h
+++ b/contrib/gcc/config/svr4.h
@@ -84,7 +84,7 @@ Boston, MA 02110-1301, USA.
/* Under svr4, the normal location of the `ld' and `as' programs is the
/usr/ccs/bin directory. */
-#ifndef CROSS_COMPILE
+#ifndef CROSS_DIRECTORY_STRUCTURE
#undef MD_EXEC_PREFIX
#define MD_EXEC_PREFIX "/usr/ccs/bin/"
#endif
@@ -92,7 +92,7 @@ Boston, MA 02110-1301, USA.
/* Under svr4, the normal location of the various *crt*.o files is the
/usr/ccs/lib directory. */
-#ifndef CROSS_COMPILE
+#ifndef CROSS_DIRECTORY_STRUCTURE
#undef MD_STARTFILE_PREFIX
#define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
#endif
@@ -136,7 +136,7 @@ Boston, MA 02110-1301, USA.
not being done. */
#undef LINK_SPEC
-#ifdef CROSS_COMPILE
+#ifdef CROSS_DIRECTORY_STRUCTURE
#define LINK_SPEC "%{h*} %{v:-V} \
%{b} \
%{static:-dn -Bstatic} \
diff --git a/contrib/gcc/configure b/contrib/gcc/configure
index a248d39..7baa70a 100755
--- a/contrib/gcc/configure
+++ b/contrib/gcc/configure
@@ -13151,7 +13151,8 @@ for f in $build_xm_file; do
esac
done
-# Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
+# Define macro CROSS_DIRECTORY_STRUCTURE in compilation if this is a
+# cross-compiler which does not use the native headers and libraries.
# Also use all.cross instead of all.internal and adjust SYSTEM_HEADER_DIR.
CROSS=
ALL=all.internal
@@ -13168,7 +13169,7 @@ fi
if test x$host != x$target
then
- CROSS="-DCROSS_COMPILE"
+ CROSS="-DCROSS_DIRECTORY_STRUCTURE"
ALL=all.cross
SYSTEM_HEADER_DIR=$build_system_header_dir
case "$host","$target" in
diff --git a/contrib/gcc/configure.ac b/contrib/gcc/configure.ac
index b6c394c..fc29233 100644
--- a/contrib/gcc/configure.ac
+++ b/contrib/gcc/configure.ac
@@ -1729,7 +1729,8 @@ for f in $build_xm_file; do
esac
done
-# Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
+# Define macro CROSS_DIRECTORY_STRUCTURE in compilation if this is a
+# cross-compiler which does not use the native headers and libraries.
# Also use all.cross instead of all.internal and adjust SYSTEM_HEADER_DIR.
CROSS= AC_SUBST(CROSS)
ALL=all.internal AC_SUBST(ALL)
@@ -1746,7 +1747,7 @@ fi
if test x$host != x$target
then
- CROSS="-DCROSS_COMPILE"
+ CROSS="-DCROSS_DIRECTORY_STRUCTURE"
ALL=all.cross
SYSTEM_HEADER_DIR=$build_system_header_dir
case "$host","$target" in
diff --git a/contrib/gcc/coverage.c b/contrib/gcc/coverage.c
index 5eaf488..292526f 100644
--- a/contrib/gcc/coverage.c
+++ b/contrib/gcc/coverage.c
@@ -429,57 +429,75 @@ tree_coverage_counter_ref (unsigned counter, unsigned no)
static unsigned
coverage_checksum_string (unsigned chksum, const char *string)
{
- int i;
char *dup = NULL;
+ char *ptr;
/* Look for everything that looks if it were produced by
- get_file_function_name_long and zero out the second part
+ get_file_function_name and zero out the second part
that may result from flag_random_seed. This is not critical
as the checksums are used only for sanity checking. */
- for (i = 0; string[i]; i++)
+#define GLOBAL_PREFIX "_GLOBAL__"
+#define TRAILING_N "N_"
+#define ISCAPXDIGIT(a) (((a) >= '0' && (a) <= '9') || ((a) >= 'A' && (a) <= 'F'))
+ if ((ptr = strstr (string, GLOBAL_PREFIX)))
{
- int offset = 0;
- if (!strncmp (string + i, "_GLOBAL__N_", 11))
- offset = 11;
- if (!strncmp (string + i, "_GLOBAL__", 9))
- offset = 9;
-
- /* C++ namespaces do have scheme:
- _GLOBAL__N_<filename>_<wrongmagicnumber>_<magicnumber>functionname
- since filename might contain extra underscores there seems
- to be no better chance then walk all possible offsets looking
- for magicnuber. */
- if (offset)
- {
- for (i = i + offset; string[i]; i++)
- if (string[i]=='_')
- {
- int y;
-
- for (y = 1; y < 9; y++)
- if (!(string[i + y] >= '0' && string[i + y] <= '9')
- && !(string[i + y] >= 'A' && string[i + y] <= 'F'))
- break;
- if (y != 9 || string[i + 9] != '_')
- continue;
- for (y = 10; y < 18; y++)
- if (!(string[i + y] >= '0' && string[i + y] <= '9')
- && !(string[i + y] >= 'A' && string[i + y] <= 'F'))
- break;
- if (y != 18)
- continue;
- if (!dup)
- string = dup = xstrdup (string);
- for (y = 10; y < 18; y++)
- dup[i + y] = '0';
- }
- break;
- }
+ /* Skip _GLOBAL__. */
+ ptr += strlen (GLOBAL_PREFIX);
+
+ /* Skip optional N_ (in case __GLOBAL_N__). */
+ if (!strncmp (ptr, TRAILING_N, strlen (TRAILING_N)))
+ ptr += strlen (TRAILING_N);
+ /* At this point, ptr should point after "_GLOBAL__N_" or "_GLOBAL__". */
+
+ while ((ptr = strchr (ptr, '_')) != NULL)
+ {
+ int y;
+ /* For every "_" in the rest of the string,
+ try the follwing pattern matching */
+
+ /* Skip over '_'. */
+ ptr++;
+#define NDIGITS (8)
+ /* Try matching the pattern:
+ <8-digit hex>_<8-digit hex>
+ The second number is randomly generated
+ so we want to mask it out before computing the checksum. */
+ for (y = 0; *ptr != 0 && y < NDIGITS; y++, ptr++)
+ if (!ISCAPXDIGIT (*ptr))
+ break;
+ if (y != NDIGITS || *ptr != '_')
+ continue;
+ /* Skip over '_' again. */
+ ptr++;
+ for (y = 0; *ptr != 0 && y < NDIGITS; y++, ptr++)
+ if (!ISCAPXDIGIT (*ptr))
+ break;
+
+ if (y == NDIGITS)
+ {
+ /* We have a match.
+ Duplicate the string and mask out
+ the second 8-digit number. */
+ dup = xstrdup (string);
+ ptr = dup + (ptr - string);
+ for(y = -NDIGITS - 1 ; y < 0; y++)
+ {
+ ptr[y] = '0';
+ }
+ ptr = dup;
+ break;
+ }
+ }
+ /* "ptr" should be NULL if we couldn't find the match
+ (strchr will return NULL if no match is found),
+ or it should point to dup which contains the string
+ with the random part masked. */
}
- chksum = crc32_string (chksum, string);
+ chksum = crc32_string (chksum, (ptr) ? ptr : string);
+
if (dup)
- free (dup);
+ free (dup);
return chksum;
}
diff --git a/contrib/gcc/cp/ChangeLog.gcc43 b/contrib/gcc/cp/ChangeLog.gcc43
new file mode 100644
index 0000000..701bea8
--- /dev/null
+++ b/contrib/gcc/cp/ChangeLog.gcc43
@@ -0,0 +1,50 @@
+2007-07-09 Geoffrey Keating <geoffk@apple.com> (r126529)
+
+ PR 32617
+ * decl.c (cxx_init_decl_processing): Don't set
+ force_align_functions_log.
+ (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
+ * typeck.c (cxx_alignof_expr): When alignof is used on a plain
+ FUNCTION_DECL, return its alignment.
+
+2007-06-28 Geoffrey Keating <geoffk@apple.com> (r126080)
+
+ * decl2.c (start_objects): Mark constructor-runnning function
+ as artificial.
+
+2007-06-14 Geoff Keating <geoffk@apple.com> (r125721)
+
+ PR 31093
+ * decl2.c (determine_visibility): Remove duplicate code for
+ handling type info.
+
+2007-05-05 Geoffrey Keating <geoffk@apple.com> (r124467)
+
+ PR 31775
+ * mangle.c (write_mangled_name): Mangle static variable names.
+ (write_unqualified_name): Use local-source-name for
+ namespace-scope static variables.
+
+2007-03-12 Seongbae Park <seongbae.park@gmail.com> (r122851)
+
+ * decl.c (compute_array_index_type): New warning flag warn_vla.
+
+2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c++/28986
+ * typeck.c (build_binary_op): Call overflow_warning if
+ TREE_OVERFLOW_P is true for the result and not for any of the
+ operands.
+
+2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c/19978
+ * semantics.c (finish_unary_op_expr): Warn only if result
+ overflowed and operands did not.
+
+2006-10-31 Geoffrey Keating <geoffk@apple.com> (r118360)
+
+ * name-lookup.c (get_anonymous_namespace_name): New.
+ (push_namespace_with_attribs): Use get_anonymous_namespace_name.
+ * decl2.c (start_objects): Update for rename of
+ get_file_function_name_long.
diff --git a/contrib/gcc/cp/cp-lang.c b/contrib/gcc/cp/cp-lang.c
index 6050327..c33d488 100644
--- a/contrib/gcc/cp/cp-lang.c
+++ b/contrib/gcc/cp/cp-lang.c
@@ -44,6 +44,8 @@ static void cp_init_ts (void);
#define LANG_HOOKS_NAME "GNU C++"
#undef LANG_HOOKS_INIT
#define LANG_HOOKS_INIT cxx_init
+#undef LANG_HOOKS_GENERIC_TYPE_P
+#define LANG_HOOKS_GENERIC_TYPE_P class_tmpl_impl_spec_p
#undef LANG_HOOKS_DECL_PRINTABLE_NAME
#define LANG_HOOKS_DECL_PRINTABLE_NAME cxx_printable_name
#undef LANG_HOOKS_FOLD_OBJ_TYPE_REF
diff --git a/contrib/gcc/cp/cp-tree.h b/contrib/gcc/cp/cp-tree.h
index ab84b62..0b30f38 100644
--- a/contrib/gcc/cp/cp-tree.h
+++ b/contrib/gcc/cp/cp-tree.h
@@ -4373,6 +4373,7 @@ extern tree add_stmt_to_compound (tree, tree);
extern tree cxx_maybe_build_cleanup (tree);
extern void init_tree (void);
extern int pod_type_p (tree);
+extern bool class_tmpl_impl_spec_p (tree);
extern int zero_init_p (tree);
extern tree canonical_type_variant (tree);
extern tree copy_binfo (tree, tree, tree,
diff --git a/contrib/gcc/cp/decl.c b/contrib/gcc/cp/decl.c
index 4e3c6e9..58128aa 100644
--- a/contrib/gcc/cp/decl.c
+++ b/contrib/gcc/cp/decl.c
@@ -3158,12 +3158,6 @@ cxx_init_decl_processing (void)
if (flag_inline_functions)
flag_inline_trees = 2;
- /* Force minimum function alignment if using the least significant
- bit of function pointers to store the virtual bit. */
- if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn
- && force_align_functions_log < 1)
- force_align_functions_log = 1;
-
/* Initially, C. */
current_lang_name = lang_name_c;
@@ -4966,9 +4960,9 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec)
{
gcc_assert (TREE_STATIC (decl));
/* An in-class declaration of a static data member should be
- external; it is only a declaration, and not a definition. */
- if (init == NULL_TREE)
- gcc_assert (DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl));
+ external; it is only a declaration, and not a definition. */
+ if (init == NULL_TREE && DECL_INITIAL (decl) == NULL_TREE)
+ gcc_assert (DECL_EXTERNAL (decl));
}
/* We don't create any RTL for local variables. */
@@ -6065,6 +6059,14 @@ grokfndecl (tree ctype,
if (TYPE_VOLATILE (type))
TREE_THIS_VOLATILE (decl) = 1;
+ /* If pointers to member functions use the least significant bit to
+ indicate whether a function is virtual, ensure a pointer
+ to this function will have that bit clear. */
+ if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn
+ && TREE_CODE (type) == METHOD_TYPE
+ && DECL_ALIGN (decl) < 2 * BITS_PER_UNIT)
+ DECL_ALIGN (decl) = 2 * BITS_PER_UNIT;
+
if (friendp
&& TREE_CODE (orig_declarator) == TEMPLATE_ID_EXPR)
{
@@ -6702,12 +6704,21 @@ compute_array_index_type (tree name, tree size)
error ("size of array is not an integral constant-expression");
size = integer_one_node;
}
- else if (pedantic)
+ else if (pedantic && warn_vla != 0)
+ {
+ if (name)
+ pedwarn ("ISO C++ forbids variable length array %qD", name);
+ else
+ pedwarn ("ISO C++ forbids variable length array");
+ }
+ else if (warn_vla > 0)
{
if (name)
- pedwarn ("ISO C++ forbids variable-size array %qD", name);
+ warning (OPT_Wvla,
+ "variable length array %qD is used", name);
else
- pedwarn ("ISO C++ forbids variable-size array");
+ warning (OPT_Wvla,
+ "variable length array is used");
}
if (processing_template_decl && !TREE_CONSTANT (size))
diff --git a/contrib/gcc/cp/decl2.c b/contrib/gcc/cp/decl2.c
index 310dc83..f0b46c9 100644
--- a/contrib/gcc/cp/decl2.c
+++ b/contrib/gcc/cp/decl2.c
@@ -1698,10 +1698,6 @@ determine_visibility (tree decl)
class can influence the visibility of the DECL. */
if (DECL_CLASS_SCOPE_P (decl))
class_type = DECL_CONTEXT (decl);
- else if (TREE_CODE (decl) == VAR_DECL
- && DECL_TINFO_P (decl)
- && CLASS_TYPE_P (TREE_TYPE (DECL_NAME (decl))))
- class_type = TREE_TYPE (DECL_NAME (decl));
else
{
/* Not a class member. */
@@ -1787,7 +1783,8 @@ determine_visibility (tree decl)
{
/* Propagate anonymity from type to decl. */
int tvis = type_visibility (TREE_TYPE (decl));
- if (tvis == VISIBILITY_ANON)
+ if (tvis == VISIBILITY_ANON
+ || ! DECL_VISIBILITY_SPECIFIED (decl))
constrain_visibility (decl, tvis);
}
}
@@ -2326,7 +2323,7 @@ start_objects (int method_type, int initp)
sprintf (type, "%c", method_type);
fndecl = build_lang_decl (FUNCTION_DECL,
- get_file_function_name_long (type),
+ get_file_function_name (type),
build_function_type (void_type_node,
void_list_node));
start_preparsed_function (fndecl, /*attrs=*/NULL_TREE, SF_PRE_PARSED);
@@ -2335,6 +2332,10 @@ start_objects (int method_type, int initp)
to scan the object file to find its ctor/dtor routine. */
TREE_PUBLIC (current_function_decl) = ! targetm.have_ctors_dtors;
+ /* Mark as artificial because it's not explicitly in the user's
+ source code. */
+ DECL_ARTIFICIAL (current_function_decl) = 1;
+
/* Mark this declaration as used to avoid spurious warnings. */
TREE_USED (current_function_decl) = 1;
diff --git a/contrib/gcc/cp/mangle.c b/contrib/gcc/cp/mangle.c
index 74ff854..c327133 100644
--- a/contrib/gcc/cp/mangle.c
+++ b/contrib/gcc/cp/mangle.c
@@ -688,7 +688,8 @@ write_mangled_name (const tree decl, bool top_level)
}
}
else if (TREE_CODE (decl) == VAR_DECL
- /* The names of global variables aren't mangled. */
+ /* The names of non-static global variables aren't mangled. */
+ && DECL_EXTERNAL_LINKAGE_P (decl)
&& (CP_DECL_CONTEXT (decl) == global_namespace
/* And neither are `extern "C"' variables. */
|| DECL_EXTERN_C_P (decl)))
@@ -1086,7 +1087,10 @@ write_template_prefix (const tree node)
<unqualified-name> ::= <operator-name>
::= <special-name>
- ::= <source-name> */
+ ::= <source-name>
+ ::= <local-source-name>
+
+ <local-source-name> ::= L <source-name> <discriminator> */
static void
write_unqualified_name (const tree decl)
@@ -1126,6 +1130,16 @@ write_unqualified_name (const tree decl)
write_string (oni[DECL_OVERLOADED_OPERATOR_P (decl)].mangled_name);
}
+ else if (VAR_OR_FUNCTION_DECL_P (decl) && ! TREE_PUBLIC (decl)
+ && DECL_NAMESPACE_SCOPE_P (decl)
+ && decl_linkage (decl) == lk_internal)
+ {
+ MANGLE_TRACE_TREE ("local-source-name", decl);
+ write_char ('L');
+ write_source_name (DECL_NAME (decl));
+ /* The default discriminator is 1, and that's all we ever use,
+ so there's no code to output one here. */
+ }
else
write_source_name (DECL_NAME (decl));
}
diff --git a/contrib/gcc/cp/name-lookup.c b/contrib/gcc/cp/name-lookup.c
index 744dd5c..4d08174 100644
--- a/contrib/gcc/cp/name-lookup.c
+++ b/contrib/gcc/cp/name-lookup.c
@@ -61,6 +61,24 @@ tree global_namespace;
unit. */
static GTY(()) tree anonymous_namespace_name;
+/* Initialise anonymous_namespace_name if necessary, and return it. */
+
+static tree
+get_anonymous_namespace_name(void)
+{
+ if (!anonymous_namespace_name)
+ {
+ /* The anonymous namespace has to have a unique name
+ if typeinfo objects are being compared by name. */
+ if (! flag_weak || ! SUPPORTS_ONE_ONLY)
+ anonymous_namespace_name = get_file_function_name ("N");
+ else
+ /* The demangler expects anonymous namespaces to be called
+ something starting with '_GLOBAL__N_'. */
+ anonymous_namespace_name = get_identifier ("_GLOBAL__N_1");
+ }
+ return anonymous_namespace_name;
+}
/* Compute the chain index of a binding_entry given the HASH value of its
name and the total COUNT of chains. COUNT is assumed to be a power
@@ -3011,11 +3029,7 @@ push_namespace_with_attribs (tree name, tree attributes)
if (anon)
{
- /* The name of anonymous namespace is unique for the translation
- unit. */
- if (!anonymous_namespace_name)
- anonymous_namespace_name = get_file_function_name ('N');
- name = anonymous_namespace_name;
+ name = get_anonymous_namespace_name();
d = IDENTIFIER_NAMESPACE_VALUE (name);
if (d)
/* Reopening anonymous namespace. */
diff --git a/contrib/gcc/cp/semantics.c b/contrib/gcc/cp/semantics.c
index ee16e75..547859b 100644
--- a/contrib/gcc/cp/semantics.c
+++ b/contrib/gcc/cp/semantics.c
@@ -2012,7 +2012,9 @@ finish_unary_op_expr (enum tree_code code, tree expr)
result = copy_node (result);
TREE_NEGATED_INT (result) = 1;
}
- overflow_warning (result);
+ if (TREE_OVERFLOW_P (result) && !TREE_OVERFLOW_P (expr))
+ overflow_warning (result);
+
return result;
}
diff --git a/contrib/gcc/cp/tree.c b/contrib/gcc/cp/tree.c
index e3391a5..eee9151 100644
--- a/contrib/gcc/cp/tree.c
+++ b/contrib/gcc/cp/tree.c
@@ -1762,6 +1762,14 @@ pod_type_p (tree t)
return 1;
}
+/* Nonzero iff type T is a class template implicit specialization. */
+
+bool
+class_tmpl_impl_spec_p (tree t)
+{
+ return CLASS_TYPE_P (t) && CLASSTYPE_TEMPLATE_INSTANTIATION (t);
+}
+
/* Returns 1 iff zero initialization of type T means actually storing
zeros in it. */
diff --git a/contrib/gcc/cp/typeck.c b/contrib/gcc/cp/typeck.c
index 6b28f49..5325989 100644
--- a/contrib/gcc/cp/typeck.c
+++ b/contrib/gcc/cp/typeck.c
@@ -1358,7 +1358,10 @@ cxx_alignof_expr (tree e)
{
pedwarn ("ISO C++ forbids applying %<__alignof%> to an expression of "
"function type");
- t = size_one_node;
+ if (TREE_CODE (e) == FUNCTION_DECL)
+ t = size_int (DECL_ALIGN_UNIT (e));
+ else
+ t = size_one_node;
}
else if (type_unknown_p (e))
{
@@ -2334,6 +2337,19 @@ build_indirect_ref (tree ptr, const char *errorstring)
types. */
tree t = canonical_type_variant (TREE_TYPE (type));
+ if (TREE_CODE (ptr) == CONVERT_EXPR
+ || TREE_CODE (ptr) == NOP_EXPR
+ || TREE_CODE (ptr) == VIEW_CONVERT_EXPR)
+ {
+ /* If a warning is issued, mark it to avoid duplicates from
+ the backend. This only needs to be done at
+ warn_strict_aliasing > 2. */
+ if (warn_strict_aliasing > 2)
+ if (strict_aliasing_warning (TREE_TYPE (TREE_OPERAND (ptr, 0)),
+ type, TREE_OPERAND (ptr, 0)))
+ TREE_NO_WARNING (ptr) = 1;
+ }
+
if (VOID_TYPE_P (t))
{
/* A pointer to incomplete type (other than cv void) can be
@@ -3773,6 +3789,12 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
result = fold_if_not_in_template (result);
if (final_type != 0)
result = cp_convert (final_type, result);
+
+ if (TREE_OVERFLOW_P (result)
+ && !TREE_OVERFLOW_P (op0)
+ && !TREE_OVERFLOW_P (op1))
+ overflow_warning (result);
+
return result;
}
@@ -5250,7 +5272,8 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p,
/* We need to strip nops here, because the frontend likes to
create (int *)&a for array-to-pointer decay, instead of &a[0]. */
STRIP_NOPS (sexpr);
- strict_aliasing_warning (intype, type, sexpr);
+ if (warn_strict_aliasing <= 2)
+ strict_aliasing_warning (intype, type, sexpr);
return fold_if_not_in_template (build_nop (type, expr));
}
diff --git a/contrib/gcc/cppdefault.c b/contrib/gcc/cppdefault.c
index d040558..4346660 100644
--- a/contrib/gcc/cppdefault.c
+++ b/contrib/gcc/cppdefault.c
@@ -33,7 +33,7 @@ Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#define STANDARD_INCLUDE_COMPONENT 0
#endif
-#if defined (CROSS_COMPILE) && !defined (TARGET_SYSTEM_ROOT)
+#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
# undef LOCAL_INCLUDE_DIR
# undef SYSTEM_INCLUDE_DIR
# undef STANDARD_INCLUDE_DIR
diff --git a/contrib/gcc/doc/cppopts.texi b/contrib/gcc/doc/cppopts.texi
index 024d255..69738cc 100644
--- a/contrib/gcc/doc/cppopts.texi
+++ b/contrib/gcc/doc/cppopts.texi
@@ -506,6 +506,22 @@ Search @var{dir} only for header files requested with
@xref{Search Path}.
@end ifset
+@item -fdirectives-only
+@opindex fdirectives-only
+This option provides a simplified preprocessor to improve the
+performance of distributed build systems such as distcc. It's
+behavior depends on a number of other flags.
+
+If the @option{-E} option is enabled, it suppresses things like macro
+expansion, trigraph conversion, and escaped newline splicing
+outside of directives. All directives are processed normally, except that
+macro definitions are output similar to the @option{-dD} option.
+
+If the @option{-fpreprocessed} option is enabled, it suppresses
+predefinition of most builtin and command line macros. This
+prevents duplicate definition of macros output with the @option{-E}
+option.
+
@item -fdollars-in-identifiers
@opindex fdollars-in-identifiers
@anchor{fdollars-in-identifiers}
diff --git a/contrib/gcc/doc/extend.texi b/contrib/gcc/doc/extend.texi
index d27af10..c6bd57d 100644
--- a/contrib/gcc/doc/extend.texi
+++ b/contrib/gcc/doc/extend.texi
@@ -1577,6 +1577,7 @@ The keyword @code{__attribute__} allows you to specify special
attributes when making a declaration. This keyword is followed by an
attribute specification inside double parentheses. The following
attributes are currently defined for functions on all targets:
+@code{aligned},
@code{noreturn}, @code{returns_twice}, @code{noinline}, @code{always_inline},
@code{flatten}, @code{pure}, @code{const}, @code{nothrow}, @code{sentinel},
@code{format}, @code{format_arg}, @code{no_instrument_function},
@@ -1615,6 +1616,27 @@ is not defined in the same translation unit.
Not all target machines support this attribute.
+@item aligned (@var{alignment})
+@cindex @code{aligned} attribute
+This attribute specifies a minimum alignment for the function,
+measured in bytes.
+
+You cannot use this attribute to decrease the alignment of a function,
+only to increase it. However, when you explicitly specify a function
+alignment this will override the effect of the
+@option{-falign-functions} (@pxref{Optimize Options}) option for this
+function.
+
+Note that the effectiveness of @code{aligned} attributes may be
+limited by inherent limitations in your linker. On many systems, the
+linker is only able to arrange for functions to be aligned up to a
+certain maximum alignment. (For some linkers, the maximum supported
+alignment may be very very small.) See your linker documentation for
+further information.
+
+The @code{aligned} attribute can also be used for variables and fields
+(@pxref{Variable Attributes}.)
+
@item always_inline
@cindex @code{always_inline} function attribute
Generally, functions are not inlined unless optimization is specified.
@@ -3044,6 +3066,9 @@ up to a maximum of 8 byte alignment, then specifying @code{aligned(16)}
in an @code{__attribute__} will still only provide you with 8 byte
alignment. See your linker documentation for further information.
+The @code{aligned} attribute can also be used for functions
+(@pxref{Function Attributes}.)
+
@item cleanup (@var{cleanup_function})
@cindex @code{cleanup} attribute
The @code{cleanup} attribute runs a function when the variable goes
@@ -6146,6 +6171,16 @@ Similar to @code{__builtin_powi}, except the argument and return types
are @code{long double}.
@end deftypefn
+@deftypefn {Built-in Function} int32_t __builtin_bswap32 (int32_t x)
+Returns @var{x} with the order of the bytes reversed; for example,
+@code{0xaabbccdd} becomes @code{0xddccbbaa}. Byte here always means
+exactly 8 bits.
+@end deftypefn
+
+@deftypefn {Built-in Function} int64_t __builtin_bswap64 (int64_t x)
+Similar to @code{__builtin_bswap32}, except the argument and return types
+are 64-bit.
+@end deftypefn
@node Target Builtins
@section Built-in Functions Specific to Particular Target Machines
diff --git a/contrib/gcc/doc/invoke.texi b/contrib/gcc/doc/invoke.texi
index c980bba..51ac30f 100644
--- a/contrib/gcc/doc/invoke.texi
+++ b/contrib/gcc/doc/invoke.texi
@@ -214,7 +214,8 @@ in the following sections.
-Wimport -Wno-import -Winit-self -Winline @gol
-Wno-int-to-pointer-cast @gol
-Wno-invalid-offsetof -Winvalid-pch @gol
--Wlarger-than-@var{len} -Wunsafe-loop-optimizations -Wlong-long @gol
+-Wlarger-than-@var{len} -Wframe-larger-than-@var{len} @gol
+-Wunsafe-loop-optimizations -Wlong-long @gol
-Wmain -Wmissing-braces -Wmissing-field-initializers @gol
-Wmissing-format-attribute -Wmissing-include-dirs @gol
-Wmissing-noreturn @gol
@@ -230,7 +231,8 @@ in the following sections.
-Wsystem-headers -Wtrigraphs -Wundef -Wuninitialized @gol
-Wunknown-pragmas -Wno-pragmas -Wunreachable-code @gol
-Wunused -Wunused-function -Wunused-label -Wunused-parameter @gol
--Wunused-value -Wunused-variable -Wvariadic-macros @gol
+-Wunused-value -Wunused-variable @gol
+-Wvariadic-macros -Wvla @gol
-Wvolatile-register-var -Wwrite-strings}
@item C-only Warning Options
@@ -274,6 +276,8 @@ in the following sections.
-ftest-coverage -ftime-report -fvar-tracking @gol
-g -g@var{level} -gcoff -gdwarf-2 @gol
-ggdb -gstabs -gstabs+ -gvms -gxcoff -gxcoff+ @gol
+-femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
+-femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
-p -pg -print-file-name=@var{library} -print-libgcc-file-name @gol
-print-multi-directory -print-multi-lib @gol
-print-prog-name=@var{program} -print-search-dirs -Q @gol
@@ -755,6 +759,8 @@ See S/390 and zSeries Options.
-fnon-call-exceptions -funwind-tables @gol
-fasynchronous-unwind-tables @gol
-finhibit-size-directive -finstrument-functions @gol
+-finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
+-finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
-fno-common -fno-ident @gol
-fpcc-struct-return -fpic -fPIC -fpie -fPIE @gol
-fno-jump-tables @gol
@@ -2502,14 +2508,40 @@ It warns about code which might break the strict aliasing rules that the
compiler is using for optimization. The warning does not catch all
cases, but does attempt to catch the more common pitfalls. It is
included in @option{-Wall}.
+It is equivalent to -Wstrict-aliasing=3
-@item -Wstrict-aliasing=2
-@opindex Wstrict-aliasing=2
+@item -Wstrict-aliasing=n
+@opindex Wstrict-aliasing=n
This option is only active when @option{-fstrict-aliasing} is active.
It warns about code which might break the strict aliasing rules that the
-compiler is using for optimization. This warning catches more cases than
-@option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous
-cases that are safe.
+compiler is using for optimization.
+Higher levels correspond to higher accuracy (fewer false positives).
+Higher levels also correspond to more effort, similar to the way -O works.
+@option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
+with n=3.
+
+Level 1: Most aggressive, quick, least accurate.
+Possibly useful when higher levels
+do not warn but -fstrict-aliasing still breaks the code, as it has very few
+false negatives. However, it has many false positives.
+Warns for all pointer conversions between possibly incompatible types,
+even if never dereferenced. Runs in the frontend only.
+
+Level 2: Aggressive, quick, not too precise.
+May still have many false positives (not as many as level 1 though),
+and few false negatives (but possibly more than level 1).
+Unlike level 1, it only warns when an address is taken. Warns about
+incomplete types. Runs in the frontend only.
+
+Level 3 (default for @option{-Wstrict-aliasing}):
+Should have very few false positives and few false
+negatives. Slightly slower than levels 1 or 2 when optimization is enabled.
+Takes care of the common punn+dereference pattern in the frontend:
+@code{*(int*)&some_float}.
+If optimization is enabled, it also runs in the backend, where it deals
+with multiple statement cases using flow-sensitive points-to information.
+Only warns when the converted pointer is dereferenced.
+Does not warn about incomplete types.
@item -Wstrict-overflow
@item -Wstrict-overflow=@var{n}
@@ -2825,6 +2857,10 @@ global variable or whenever a built-in function is shadowed.
@opindex Wlarger-than
Warn whenever an object of larger than @var{len} bytes is defined.
+@item -Wframe-larger-than-@var{len}
+@opindex Wframe-larger-than
+Warn whenever the frame size of a function is larger than @var{len} bytes.
+
@item -Wunsafe-loop-optimizations
@opindex Wunsafe-loop-optimizations
Warn if the loop cannot be optimized because the compiler could not
@@ -3201,6 +3237,13 @@ Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
alternate syntax when in pedantic ISO C99 mode. This is default.
To inhibit the warning messages, use @option{-Wno-variadic-macros}.
+@item -Wvla
+@opindex Wvla
+@opindex Wno-vla
+Warn if variable length array is used in the code.
+@option{-Wno-vla} will prevent the @option{-pedantic} warning of
+the variable length array.
+
@item -Wvolatile-register-var
@opindex Wvolatile-register-var
@opindex Wno-volatile-register-var
@@ -3403,6 +3446,78 @@ Compress DWARF2 debugging information by eliminating duplicated
information about each symbol. This option only makes sense when
generating DWARF2 debugging information with @option{-gdwarf-2}.
+@item -femit-struct-debug-baseonly
+Emit debug information for struct-like types
+only when the base name of the compilation source file
+matches the base name of file in which the struct was defined.
+
+This option substantially reduces the size of debugging information,
+but at significant potential loss in type information to the debugger.
+See @option{-femit-struct-debug-reduced} for a less aggressive option.
+See @option{-femit-struct-debug-detailed} for more detailed control.
+
+This option works only with DWARF 2.
+
+@item -femit-struct-debug-reduced
+Emit debug information for struct-like types
+only when the base name of the compilation source file
+matches the base name of file in which the type was defined,
+unless the struct is a template or defined in a system header.
+
+This option significantly reduces the size of debugging information,
+with some potential loss in type information to the debugger.
+See @option{-femit-struct-debug-baseonly} for a more aggressive option.
+See @option{-femit-struct-debug-detailed} for more detailed control.
+
+This option works only with DWARF 2.
+
+@item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
+Specify the struct-like types
+for which the compiler will generate debug information.
+The intent is to reduce duplicate struct debug information
+between different object files within the same program.
+
+This option is a detailed version of
+@option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
+which will serve for most needs.
+
+A specification has the syntax
+[@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
+
+The optional first word limits the specification to
+structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
+A struct type is used directly when it is the type of a variable, member.
+Indirect uses arise through pointers to structs.
+That is, when use of an incomplete struct would be legal, the use is indirect.
+An example is
+@samp{struct one direct; struct two * indirect;}.
+
+The optional second word limits the specification to
+ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
+Generic structs are a bit complicated to explain.
+For C++, these are non-explicit specializations of template classes,
+or non-template classes within the above.
+Other programming languages have generics,
+but @samp{-femit-struct-debug-detailed} does not yet implement them.
+
+The third word specifies the source files for those
+structs for which the compiler will emit debug information.
+The values @samp{none} and @samp{any} have the normal meaning.
+The value @samp{base} means that
+the base of name of the file in which the type declaration appears
+must match the base of the name of the main compilation file.
+In practice, this means that
+types declared in @file{foo.c} and @file{foo.h} will have debug information,
+but types declared in other header will not.
+The value @samp{sys} means those types satisfying @samp{base}
+or declared in system or compiler headers.
+
+You may need to experiment to determine the best settings for your application.
+
+The default is @samp{-femit-struct-debug-detailed=all}.
+
+This option works only with DWARF 2.
+
@cindex @command{prof}
@item -p
@opindex p
@@ -13273,6 +13388,37 @@ interrupt routines, and any functions from which the profiling functions
cannot safely be called (perhaps signal handlers, if the profiling
routines generate output or allocate memory).
+@item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
+@opindex finstrument-functions-exclude-file-list
+
+Set the list of functions that are excluded from instrumentation (see
+the description of @code{-finstrument-functions}). If the file that
+contains a function definition matches with one of @var{file}, then
+that function is not instrumented. The match is done on substrings:
+if the @var{file} parameter is a substring of the file name, it is
+considered to be a match.
+
+For example,
+@code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys}
+will exclude any inline function defined in files whose pathnames
+contain @code{/bits/stl} or @code{include/sys}.
+
+If, for some reason, you want to include letter @code{','} in one of
+@var{sym}, write @code{'\,'}. For example,
+@code{-finstrument-functions-exclude-file-list='\,\,tmp'}
+(note the single quote surrounding the option).
+
+@item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
+@opindex finstrument-functions-exclude-function-list
+
+This is similar to @code{-finstrument-functions-exclude-file-list},
+but this option sets the list of function names to be excluded from
+instrumentation. The function name to be matched is its user-visible
+name, such as @code{vector<int> blah(const vector<int> &)}, not the
+internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}). The
+match is done on substrings: if the @var{sym} parameter is a substring
+of the function name, it is considered to be a match.
+
@item -fstack-check
@opindex fstack-check
Generate code to verify that you do not go beyond the boundary of the
@@ -13850,3 +13996,4 @@ exist, because otherwise they won't get converted.
@xref{Protoize Caveats}, for more information on how to use
@code{protoize} successfully.
+
diff --git a/contrib/gcc/doc/libgcc.texi b/contrib/gcc/doc/libgcc.texi
index f67b117..fcc55d7 100644
--- a/contrib/gcc/doc/libgcc.texi
+++ b/contrib/gcc/doc/libgcc.texi
@@ -212,6 +212,11 @@ These functions return the value zero if the number of bits set in
These functions return the number of bits set in @var{a}.
@end deftypefn
+@deftypefn {Runtime Function} int32_t __bswapsi2 (int32_t @var{a})
+@deftypefnx {Runtime Function} int64_t __bswapdi2 (int64_t @var{a})
+These functions return the @var{a} byteswapped.
+@end deftypefn
+
@node Soft float library routines
@section Routines for floating point emulation
@cindex soft float library
@@ -728,4 +733,3 @@ document me!
@deftypefn {Runtime Function} void __clear_cache (char *@var{beg}, char *@var{end})
This function clears the instruction cache between @var{beg} and @var{end}.
@end deftypefn
-
diff --git a/contrib/gcc/doc/rtl.texi b/contrib/gcc/doc/rtl.texi
index 76e8f16..d97b2b3 100644
--- a/contrib/gcc/doc/rtl.texi
+++ b/contrib/gcc/doc/rtl.texi
@@ -2084,6 +2084,11 @@ mode @var{m}. The mode of @var{x} will usually be an integer mode.
Represents the number of 1-bits modulo 2 in @var{x}, represented as an
integer of mode @var{m}. The mode of @var{x} will usually be an integer
mode.
+
+@findex bswap
+@item (bswap:@var{m} @var{x})
+Represents the value @var{x} with the order of bytes reversed, carried out
+in mode @var{m}, which must be a fixed-point machine mode.
@end table
@node Comparisons
diff --git a/contrib/gcc/dwarf2out.c b/contrib/gcc/dwarf2out.c
index 5e4354a..266973a 100644
--- a/contrib/gcc/dwarf2out.c
+++ b/contrib/gcc/dwarf2out.c
@@ -2030,7 +2030,7 @@ switch_to_eh_frame_section (void)
/* We have no special eh_frame section. Put the information in
the data section and emit special labels to guide collect2. */
switch_to_section (data_section);
- label = get_file_function_name ('F');
+ label = get_file_function_name ("F");
ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));
targetm.asm_out.globalize_label (asm_out_file,
IDENTIFIER_POINTER (label));
@@ -4215,7 +4215,8 @@ static void gen_ptr_to_mbr_type_die (tree, dw_die_ref);
static dw_die_ref gen_compile_unit_die (const char *);
static void gen_inheritance_die (tree, tree, dw_die_ref);
static void gen_member_die (tree, dw_die_ref);
-static void gen_struct_or_union_type_die (tree, dw_die_ref);
+static void gen_struct_or_union_type_die (tree, dw_die_ref,
+ enum debug_info_usage);
static void gen_subroutine_type_die (tree, dw_die_ref);
static void gen_typedef_die (tree, dw_die_ref);
static void gen_type_die (tree, dw_die_ref);
@@ -12473,7 +12474,8 @@ gen_member_die (tree type, dw_die_ref context_die)
member DIEs needed by later specification DIEs. */
static void
-gen_struct_or_union_type_die (tree type, dw_die_ref context_die)
+gen_struct_or_union_type_die (tree type, dw_die_ref context_die,
+ enum debug_info_usage usage)
{
dw_die_ref type_die = lookup_type_die (type);
dw_die_ref scope_die = 0;
@@ -12482,6 +12484,7 @@ gen_struct_or_union_type_die (tree type, dw_die_ref context_die)
&& (! TYPE_STUB_DECL (type)
|| ! TYPE_DECL_SUPPRESS_DEBUG (TYPE_STUB_DECL (type))));
int ns_decl = (context_die && context_die->die_tag == DW_TAG_namespace);
+ complete = complete && should_emit_struct_debug (type, usage);
if (type_die && ! complete)
return;
@@ -12609,7 +12612,8 @@ gen_typedef_die (tree decl, dw_die_ref context_die)
/* Generate a type description DIE. */
static void
-gen_type_die (tree type, dw_die_ref context_die)
+gen_type_die_with_usage (tree type, dw_die_ref context_die,
+ enum debug_info_usage usage)
{
int need_pop;
@@ -12657,16 +12661,19 @@ gen_type_die (tree type, dw_die_ref context_die)
/* For these types, all that is required is that we output a DIE (or a
set of DIEs) to represent the "basis" type. */
- gen_type_die (TREE_TYPE (type), context_die);
+ gen_type_die_with_usage (TREE_TYPE (type), context_die,
+ DINFO_USAGE_IND_USE);
break;
case OFFSET_TYPE:
/* This code is used for C++ pointer-to-data-member types.
Output a description of the relevant class type. */
- gen_type_die (TYPE_OFFSET_BASETYPE (type), context_die);
+ gen_type_die_with_usage (TYPE_OFFSET_BASETYPE (type), context_die,
+ DINFO_USAGE_IND_USE);
/* Output a description of the type of the object pointed to. */
- gen_type_die (TREE_TYPE (type), context_die);
+ gen_type_die_with_usage (TREE_TYPE (type), context_die,
+ DINFO_USAGE_IND_USE);
/* Now output a DIE to represent this pointer-to-data-member type
itself. */
@@ -12675,13 +12682,15 @@ gen_type_die (tree type, dw_die_ref context_die)
case FUNCTION_TYPE:
/* Force out return type (in case it wasn't forced out already). */
- gen_type_die (TREE_TYPE (type), context_die);
+ gen_type_die_with_usage (TREE_TYPE (type), context_die,
+ DINFO_USAGE_DIR_USE);
gen_subroutine_type_die (type, context_die);
break;
case METHOD_TYPE:
/* Force out return type (in case it wasn't forced out already). */
- gen_type_die (TREE_TYPE (type), context_die);
+ gen_type_die_with_usage (TREE_TYPE (type), context_die,
+ DINFO_USAGE_DIR_USE);
gen_subroutine_type_die (type, context_die);
break;
@@ -12707,7 +12716,7 @@ gen_type_die (tree type, dw_die_ref context_die)
&& AGGREGATE_TYPE_P (TYPE_CONTEXT (type))
&& ! TREE_ASM_WRITTEN (TYPE_CONTEXT (type)))
{
- gen_type_die (TYPE_CONTEXT (type), context_die);
+ gen_type_die_with_usage (TYPE_CONTEXT (type), context_die, usage);
if (TREE_ASM_WRITTEN (type))
return;
@@ -12731,7 +12740,7 @@ gen_type_die (tree type, dw_die_ref context_die)
gen_enumeration_type_die (type, context_die);
}
else
- gen_struct_or_union_type_die (type, context_die);
+ gen_struct_or_union_type_die (type, context_die, usage);
if (need_pop)
pop_decl_scope ();
@@ -12760,6 +12769,12 @@ gen_type_die (tree type, dw_die_ref context_die)
TREE_ASM_WRITTEN (type) = 1;
}
+static void
+gen_type_die (tree type, dw_die_ref context_die)
+{
+ gen_type_die_with_usage (type, context_die, DINFO_USAGE_DIR_USE);
+}
+
/* Generate a DIE for a tagged type instantiation. */
static void
@@ -13357,7 +13372,11 @@ dwarf2out_imported_module_or_decl (tree decl, tree context)
if (!context)
scope_die = comp_unit_die;
else if (TYPE_P (context))
+ {
+ if (!should_emit_struct_debug (context, DINFO_USAGE_DIR_USE))
+ return;
scope_die = force_type_die (context);
+ }
else
scope_die = force_decl_die (context);
@@ -13383,7 +13402,12 @@ dwarf2out_imported_module_or_decl (tree decl, tree context)
if (TYPE_CONTEXT (type))
if (TYPE_P (TYPE_CONTEXT (type)))
+ {
+ if (!should_emit_struct_debug (TYPE_CONTEXT (type),
+ DINFO_USAGE_DIR_USE))
+ return;
type_context_die = force_type_die (TYPE_CONTEXT (type));
+ }
else
type_context_die = force_decl_die (TYPE_CONTEXT (type));
else
diff --git a/contrib/gcc/expr.c b/contrib/gcc/expr.c
index 3655eb0..16e43aa 100644
--- a/contrib/gcc/expr.c
+++ b/contrib/gcc/expr.c
@@ -361,6 +361,8 @@ convert_move (rtx to, rtx from, int unsignedp)
gcc_assert (to_real == from_real);
+ gcc_assert (to_mode != BLKmode);
+ gcc_assert (from_mode != BLKmode);
/* If the source and destination are already the same, then there's
nothing to do. */
@@ -415,7 +417,7 @@ convert_move (rtx to, rtx from, int unsignedp)
!= GET_MODE_PRECISION (to_mode))
|| (DECIMAL_FLOAT_MODE_P (from_mode)
!= DECIMAL_FLOAT_MODE_P (to_mode)));
-
+
if (GET_MODE_PRECISION (from_mode) == GET_MODE_PRECISION (to_mode))
/* Conversion between decimal float and binary float, same size. */
tab = DECIMAL_FLOAT_MODE_P (from_mode) ? trunc_optab : sext_optab;
@@ -2135,7 +2137,7 @@ void
use_reg (rtx *call_fusage, rtx reg)
{
gcc_assert (REG_P (reg) && REGNO (reg) < FIRST_PSEUDO_REGISTER);
-
+
*call_fusage
= gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_USE (VOIDmode, reg), *call_fusage);
@@ -2682,7 +2684,7 @@ set_storage_via_setmem (rtx object, rtx size, rtx val, unsigned int align)
pred = insn_data[(int) code].operand[1].predicate;
if (pred != 0 && ! (*pred) (opsize, mode))
opsize = copy_to_mode_reg (mode, opsize);
-
+
opchar = val;
char_mode = insn_data[(int) code].operand[2].mode;
if (char_mode != VOIDmode)
@@ -3140,9 +3142,9 @@ emit_move_multi_word (enum machine_mode mode, rtx x, rtx y)
rtx seq, inner;
bool need_clobber;
int i;
-
+
gcc_assert (GET_MODE_SIZE (mode) >= UNITS_PER_WORD);
-
+
/* If X is a push on the stack, do the push now and replace
X with a reference to the stack pointer. */
if (push_operand (x, mode))
@@ -4440,6 +4442,11 @@ store_expr (tree exp, rtx target, int call_param_p)
temp = convert_to_mode (GET_MODE (target), temp, unsignedp);
emit_move_insn (target, temp);
}
+ else if (GET_MODE (target) == BLKmode)
+ emit_block_move (target, temp, expr_size (exp),
+ (call_param_p
+ ? BLOCK_OP_CALL_PARM
+ : BLOCK_OP_NORMAL));
else
convert_move (target, temp, unsignedp);
}
@@ -4571,7 +4578,7 @@ categorize_ctor_elements_1 (tree ctor, HOST_WIDE_INT *p_nz_elts,
case CONSTRUCTOR:
{
HOST_WIDE_INT nz = 0, ic = 0;
-
+
bool const_elt_p
= categorize_ctor_elements_1 (value, &nz, &ic, p_must_clear);
@@ -4648,7 +4655,7 @@ categorize_ctor_elements_1 (tree ctor, HOST_WIDE_INT *p_nz_elts,
largest element. Which would avoid comparing the size of the
initialized element against any tail padding in the union.
Doesn't seem worth the effort... */
- if (simple_cst_equal (TYPE_SIZE (TREE_TYPE (ctor)),
+ if (simple_cst_equal (TYPE_SIZE (TREE_TYPE (ctor)),
TYPE_SIZE (init_sub_type)) == 1)
{
/* And now we have to find out if the element itself is fully
@@ -4944,24 +4951,24 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
HOST_WIDE_INT bitpos = 0;
tree offset;
rtx to_rtx = target;
-
+
/* Just ignore missing fields. We cleared the whole
structure, above, if any fields are missing. */
if (field == 0)
continue;
-
+
if (cleared && initializer_zerop (value))
continue;
-
+
if (host_integerp (DECL_SIZE (field), 1))
bitsize = tree_low_cst (DECL_SIZE (field), 1);
else
bitsize = -1;
-
+
mode = DECL_MODE (field);
if (DECL_BIT_FIELD (field))
mode = VOIDmode;
-
+
offset = DECL_FIELD_OFFSET (field);
if (host_integerp (offset, 0)
&& host_integerp (bit_position (field), 0))
@@ -4971,11 +4978,11 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
}
else
bitpos = tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 0);
-
+
if (offset)
{
rtx offset_rtx;
-
+
offset
= SUBSTITUTE_PLACEHOLDER_IN_EXPR (offset,
make_tree (TREE_TYPE (exp),
@@ -4983,7 +4990,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
offset_rtx = expand_normal (offset);
gcc_assert (MEM_P (to_rtx));
-
+
#ifdef POINTERS_EXTEND_UNSIGNED
if (GET_MODE (offset_rtx) != Pmode)
offset_rtx = convert_to_mode (Pmode, offset_rtx, 0);
@@ -5011,14 +5018,14 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
&& bitpos + BITS_PER_WORD <= exp_size * BITS_PER_UNIT)
{
tree type = TREE_TYPE (value);
-
+
if (TYPE_PRECISION (type) < BITS_PER_WORD)
{
type = lang_hooks.types.type_for_size
(BITS_PER_WORD, TYPE_UNSIGNED (type));
value = fold_convert (type, value);
}
-
+
if (BYTES_BIG_ENDIAN)
value
= fold_build2 (LSHIFT_EXPR, type, value,
@@ -5035,7 +5042,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
to_rtx = copy_rtx (to_rtx);
MEM_KEEP_ALIAS_SET_P (to_rtx) = 1;
}
-
+
store_constructor_field (to_rtx, bitsize, bitpos, mode,
value, type, cleared,
get_alias_set (TREE_TYPE (field)));
@@ -5079,7 +5086,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
tree index, value;
HOST_WIDE_INT count = 0, zero_count = 0;
need_to_clear = ! const_bounds_p;
-
+
/* This loop is a more accurate version of the loop in
mostly_zeros_p (it handles RANGE_EXPR in an index). It
is also needed to check for missing elements. */
@@ -5089,30 +5096,30 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
if (need_to_clear)
break;
-
+
if (index != NULL_TREE && TREE_CODE (index) == RANGE_EXPR)
{
tree lo_index = TREE_OPERAND (index, 0);
tree hi_index = TREE_OPERAND (index, 1);
-
+
if (! host_integerp (lo_index, 1)
|| ! host_integerp (hi_index, 1))
{
need_to_clear = 1;
break;
}
-
+
this_node_count = (tree_low_cst (hi_index, 1)
- tree_low_cst (lo_index, 1) + 1);
}
else
this_node_count = 1;
-
+
count += this_node_count;
if (mostly_zeros_p (value))
zero_count += this_node_count;
}
-
+
/* Clear the entire array first if there are any missing
elements, or if the incidence of zero elements is >=
75%. */
@@ -5121,7 +5128,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
|| 4 * zero_count >= 3 * count))
need_to_clear = 1;
}
-
+
if (need_to_clear && size > 0)
{
if (REG_P (target))
@@ -5145,10 +5152,10 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
HOST_WIDE_INT bitpos;
int unsignedp;
rtx xtarget = target;
-
+
if (cleared && initializer_zerop (value))
continue;
-
+
unsignedp = TYPE_UNSIGNED (elttype);
mode = TYPE_MODE (elttype);
if (mode == BLKmode)
@@ -5157,7 +5164,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
: -1);
else
bitsize = GET_MODE_BITSIZE (mode);
-
+
if (index != NULL_TREE && TREE_CODE (index) == RANGE_EXPR)
{
tree lo_index = TREE_OPERAND (index, 0);
@@ -5165,7 +5172,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
rtx index_r, pos_rtx;
HOST_WIDE_INT lo, hi, count;
tree position;
-
+
/* If the range is constant and "small", unroll the loop. */
if (const_bounds_p
&& host_integerp (lo_index, 0)
@@ -5183,7 +5190,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
for (; lo <= hi; lo++)
{
bitpos = lo * tree_low_cst (TYPE_SIZE (elttype), 0);
-
+
if (MEM_P (target)
&& !MEM_KEEP_ALIAS_SET_P (target)
&& TREE_CODE (type) == ARRAY_TYPE
@@ -5192,7 +5199,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
target = copy_rtx (target);
MEM_KEEP_ALIAS_SET_P (target) = 1;
}
-
+
store_constructor_field
(target, bitsize, bitpos, mode, value, type, cleared,
get_alias_set (elttype));
@@ -5203,18 +5210,18 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
rtx loop_start = gen_label_rtx ();
rtx loop_end = gen_label_rtx ();
tree exit_cond;
-
+
expand_normal (hi_index);
unsignedp = TYPE_UNSIGNED (domain);
-
+
index = build_decl (VAR_DECL, NULL_TREE, domain);
-
+
index_r
= gen_reg_rtx (promote_mode (domain, DECL_MODE (index),
&unsignedp, 0));
SET_DECL_RTL (index, index_r);
store_expr (lo_index, index_r, 0);
-
+
/* Build the head of the loop. */
do_pending_stack_adjust ();
emit_label (loop_start);
@@ -5231,7 +5238,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
size_binop (MULT_EXPR, position,
fold_convert (ssizetype,
TYPE_SIZE_UNIT (elttype)));
-
+
pos_rtx = expand_normal (position);
xtarget = offset_address (target, pos_rtx,
highest_pow2_factor (position));
@@ -5246,15 +5253,15 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
exit_cond = build2 (LT_EXPR, integer_type_node,
index, hi_index);
jumpif (exit_cond, loop_end);
-
+
/* Update the loop counter, and jump to the head of
the loop. */
expand_assignment (index,
build2 (PLUS_EXPR, TREE_TYPE (index),
index, integer_one_node));
-
+
emit_jump (loop_start);
-
+
/* Build the end of the loop. */
emit_label (loop_end);
}
@@ -5263,17 +5270,17 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
|| ! host_integerp (TYPE_SIZE (elttype), 1))
{
tree position;
-
+
if (index == 0)
index = ssize_int (1);
-
+
if (minelt)
index = fold_convert (ssizetype,
fold_build2 (MINUS_EXPR,
TREE_TYPE (index),
index,
TYPE_MIN_VALUE (domain)));
-
+
position =
size_binop (MULT_EXPR, index,
fold_convert (ssizetype,
@@ -5291,7 +5298,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
* tree_low_cst (TYPE_SIZE (elttype), 1));
else
bitpos = (i * tree_low_cst (TYPE_SIZE (elttype), 1));
-
+
if (MEM_P (target) && !MEM_KEEP_ALIAS_SET_P (target)
&& TREE_CODE (type) == ARRAY_TYPE
&& TYPE_NONALIASED_COMPONENT (type))
@@ -5320,25 +5327,25 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
HOST_WIDE_INT bitpos;
rtvec vector = NULL;
unsigned n_elts;
-
+
gcc_assert (eltmode != BLKmode);
-
+
n_elts = TYPE_VECTOR_SUBPARTS (type);
if (REG_P (target) && VECTOR_MODE_P (GET_MODE (target)))
{
enum machine_mode mode = GET_MODE (target);
-
+
icode = (int) vec_init_optab->handlers[mode].insn_code;
if (icode != CODE_FOR_nothing)
{
unsigned int i;
-
+
vector = rtvec_alloc (n_elts);
for (i = 0; i < n_elts; i++)
RTVEC_ELT (vector, i) = CONST0_RTX (GET_MODE_INNER (mode));
}
}
-
+
/* If the constructor has fewer elements than the vector,
clear the whole array first. Similarly if this is static
constructor of a non-BLKmode object. */
@@ -5350,14 +5357,14 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
{
unsigned HOST_WIDE_INT count = 0, zero_count = 0;
tree value;
-
+
FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (exp), idx, value)
{
int n_elts_here = tree_low_cst
(int_const_binop (TRUNC_DIV_EXPR,
TYPE_SIZE (TREE_TYPE (value)),
TYPE_SIZE (elttype), 0), 1);
-
+
count += n_elts_here;
if (mostly_zeros_p (value))
zero_count += n_elts_here;
@@ -5367,7 +5374,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
or if the incidence of zero elements is >= 75%. */
need_to_clear = (count < n_elts || 4 * zero_count >= 3 * count);
}
-
+
if (need_to_clear && size > 0 && !vector)
{
if (REG_P (target))
@@ -5376,7 +5383,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
clear_storage (target, GEN_INT (size), BLOCK_OP_NORMAL);
cleared = 1;
}
-
+
/* Inform later passes that the old value is dead. */
if (!cleared && !vector && REG_P (target))
emit_move_insn (target, CONST0_RTX (GET_MODE (target)));
@@ -5389,16 +5396,16 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
{
HOST_WIDE_INT eltpos;
tree value = ce->value;
-
+
bitsize = tree_low_cst (TYPE_SIZE (TREE_TYPE (value)), 1);
if (cleared && initializer_zerop (value))
continue;
-
+
if (ce->index)
eltpos = tree_low_cst (ce->index, 1);
else
eltpos = i;
-
+
if (vector)
{
/* Vector CONSTRUCTORs should only be built from smaller
@@ -5419,14 +5426,14 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
cleared, get_alias_set (elttype));
}
}
-
+
if (vector)
emit_insn (GEN_FCN (icode)
(target,
gen_rtx_PARALLEL (GET_MODE (target), vector)));
break;
}
-
+
default:
gcc_unreachable ();
}
@@ -6965,7 +6972,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
&& GET_MODE (decl_rtl) != DECL_MODE (exp))
{
enum machine_mode pmode;
-
+
/* Get the signedness used for this variable. Ensure we get the
same mode we got when the variable was declared. */
pmode = promote_mode (type, DECL_MODE (exp), &unsignedp,
@@ -7336,19 +7343,19 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
tree index1 = index;
tree low_bound = array_ref_low_bound (exp);
index1 = fold_convert (sizetype, TREE_OPERAND (exp, 1));
-
+
/* Optimize the special-case of a zero lower bound.
-
+
We convert the low_bound to sizetype to avoid some problems
with constant folding. (E.g. suppose the lower bound is 1,
and its mode is QI. Without the conversion,l (ARRAY
+(INDEX-(unsigned char)1)) becomes ((ARRAY+(-(unsigned char)1))
+INDEX), which becomes (ARRAY+255+INDEX). Opps!) */
-
+
if (! integer_zerop (low_bound))
index1 = size_diffop (index1, fold_convert (sizetype,
low_bound));
-
+
if (0 > compare_tree_int (index1,
TREE_STRING_LENGTH (init)))
{
@@ -7751,7 +7758,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
else
{
gcc_assert (REG_P (target));
-
+
/* Store this field into a union of the proper type. */
store_field (target,
MIN ((int_size_in_bytes (TREE_TYPE
@@ -7837,9 +7844,9 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
other. */
else if (SCALAR_INT_MODE_P (GET_MODE (op0))
&& SCALAR_INT_MODE_P (TYPE_MODE (type)))
- op0 = convert_modes (TYPE_MODE (type), GET_MODE (op0), op0,
+ op0 = convert_modes (TYPE_MODE (type), GET_MODE (op0), op0,
TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))));
- /* As a last resort, spill op0 to memory, and reload it in a
+ /* As a last resort, spill op0 to memory, and reload it in a
different mode. */
else if (!MEM_P (op0))
{
@@ -8742,7 +8749,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case REALIGN_LOAD_EXPR:
{
- tree oprnd0 = TREE_OPERAND (exp, 0);
+ tree oprnd0 = TREE_OPERAND (exp, 0);
tree oprnd1 = TREE_OPERAND (exp, 1);
tree oprnd2 = TREE_OPERAND (exp, 2);
rtx op2;
@@ -8750,7 +8757,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
this_optab = optab_for_tree_code (code, type);
expand_operands (oprnd0, oprnd1, NULL_RTX, &op0, &op1, EXPAND_NORMAL);
op2 = expand_normal (oprnd2);
- temp = expand_ternary_op (mode, this_optab, op0, op1, op2,
+ temp = expand_ternary_op (mode, this_optab, op0, op1, op2,
target, unsignedp);
gcc_assert (temp);
return temp;
@@ -8765,7 +8772,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
expand_operands (oprnd0, oprnd1, NULL_RTX, &op0, &op1, EXPAND_NORMAL);
op2 = expand_normal (oprnd2);
- target = expand_widen_pattern_expr (exp, op0, op1, op2,
+ target = expand_widen_pattern_expr (exp, op0, op1, op2,
target, unsignedp);
return target;
}
@@ -8774,7 +8781,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
{
tree oprnd0 = TREE_OPERAND (exp, 0);
tree oprnd1 = TREE_OPERAND (exp, 1);
-
+
expand_operands (oprnd0, oprnd1, NULL_RTX, &op0, &op1, 0);
target = expand_widen_pattern_expr (exp, op0, NULL_RTX, op1,
target, unsignedp);
diff --git a/contrib/gcc/final.c b/contrib/gcc/final.c
index d64f0c3..ef50ed9 100644
--- a/contrib/gcc/final.c
+++ b/contrib/gcc/final.c
@@ -1425,6 +1425,15 @@ final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file,
TREE_ASM_WRITTEN (DECL_INITIAL (current_function_decl)) = 1;
}
+ if (warn_frame_larger_than
+ && get_frame_size () > frame_larger_than_size)
+ {
+ /* Issue a warning */
+ warning (OPT_Wframe_larger_than_,
+ "the frame size of %wd bytes is larger than %wd bytes",
+ get_frame_size (), frame_larger_than_size);
+ }
+
/* First output the function prologue: code to set up the stack frame. */
targetm.asm_out.function_prologue (file, get_frame_size ());
@@ -4083,4 +4092,3 @@ struct tree_opt_pass pass_clean_state =
0, /* todo_flags_finish */
0 /* letter */
};
-
diff --git a/contrib/gcc/flags.h b/contrib/gcc/flags.h
index 226fb60..1c1fd0d 100644
--- a/contrib/gcc/flags.h
+++ b/contrib/gcc/flags.h
@@ -23,6 +23,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#ifndef GCC_FLAGS_H
#define GCC_FLAGS_H
+#include "coretypes.h"
#include "options.h"
enum debug_info_type
@@ -54,6 +55,25 @@ enum debug_info_level
/* Specify how much debugging info to generate. */
extern enum debug_info_level debug_info_level;
+/* A major contribution to object and executable size is debug
+ information size. A major contribution to debug information
+ size is struct descriptions replicated in several object files.
+ The following function determines whether or not debug information
+ should be generated for a given struct. The indirect parameter
+ indicates that the struct is being handled indirectly, via
+ a pointer. See opts.c for the implementation. */
+
+enum debug_info_usage
+{
+ DINFO_USAGE_DFN, /* A struct definition. */
+ DINFO_USAGE_DIR_USE, /* A direct use, such as the type of a variable. */
+ DINFO_USAGE_IND_USE, /* An indirect use, such as through a pointer. */
+ DINFO_USAGE_NUM_ENUMS /* The number of enumerators. */
+};
+
+extern bool should_emit_struct_debug (tree type_decl, enum debug_info_usage);
+extern void set_struct_debug_option (const char *value);
+
/* Nonzero means use GNU-only extensions in the generated symbolic
debugging information. */
extern bool use_gnu_debug_info_extensions;
@@ -102,6 +122,15 @@ extern bool extra_warnings;
extern void set_Wunused (int setting);
+/* Used to set the level of -Wstrict-aliasing, when no level is specified.
+ The external way to set the default level is to use
+ -Wstrict-aliasing=level.
+ ONOFF is assumed to take value 1 when -Wstrict-aliasing is specified,
+ and 0 otherwise. After calling this function, wstrict_aliasing will be
+ set to the default value of -Wstrict_aliasing=level. */
+
+extern void set_warn_strict_aliasing (int onoff);
+
/* Nonzero means warn about any objects definitions whose size is larger
than N bytes. Also want about function definitions whose returned
values are larger than N bytes. The value N is in `larger_than_size'. */
@@ -109,6 +138,12 @@ extern void set_Wunused (int setting);
extern bool warn_larger_than;
extern HOST_WIDE_INT larger_than_size;
+/* Nonzero means warn about any function whose frame size is larger
+ than N bytes. */
+
+extern bool warn_frame_larger_than;
+extern HOST_WIDE_INT frame_larger_than_size;
+
/* Nonzero means warn about constructs which might not be strict
aliasing safe. */
@@ -226,10 +261,6 @@ extern int align_labels_log;
extern int align_labels_max_skip;
extern int align_functions_log;
-/* Like align_functions_log above, but used by front-ends to force the
- minimum function alignment. Zero means no alignment is forced. */
-extern int force_align_functions_log;
-
/* Nonzero if we dump in VCG format, not plain text. */
extern int dump_for_graph;
@@ -267,6 +298,10 @@ extern const char *flag_random_seed;
#define abi_version_at_least(N) \
(flag_abi_version == 0 || flag_abi_version >= (N))
+/* Return whether the function should be excluded from
+ instrumentation. */
+extern bool flag_instrument_functions_exclude_p (tree fndecl);
+
/* True if the given mode has a NaN representation and the treatment of
NaN operands is important. Certain optimizations, such as folding
x * 0 into 0, are not correct for NaN operands, and are normally
diff --git a/contrib/gcc/fold-const.c b/contrib/gcc/fold-const.c
index 1aadd30..e43fb3b 100644
--- a/contrib/gcc/fold-const.c
+++ b/contrib/gcc/fold-const.c
@@ -12591,6 +12591,8 @@ tree_expr_nonnegative_warnv_p (tree t, bool *strict_overflow_p)
CASE_INT_FN (BUILT_IN_FFS):
CASE_INT_FN (BUILT_IN_PARITY):
CASE_INT_FN (BUILT_IN_POPCOUNT):
+ case BUILT_IN_BSWAP32:
+ case BUILT_IN_BSWAP64:
/* Always true. */
return 1;
diff --git a/contrib/gcc/gcc.c b/contrib/gcc/gcc.c
index e88dc53..62d248b 100644
--- a/contrib/gcc/gcc.c
+++ b/contrib/gcc/gcc.c
@@ -240,7 +240,7 @@ static const char *spec_machine = DEFAULT_TARGET_MACHINE;
/* Nonzero if cross-compiling.
When -b is used, the value comes from the `specs' file. */
-#ifdef CROSS_COMPILE
+#ifdef CROSS_DIRECTORY_STRUCTURE
static const char *cross_compile = "1";
#else
static const char *cross_compile = "0";
@@ -1469,7 +1469,7 @@ static const char *gcc_libexec_prefix;
#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
#endif
-#ifdef CROSS_COMPILE /* Don't use these prefixes for a cross compiler. */
+#ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */
#undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX
#undef MD_STARTFILE_PREFIX_1
diff --git a/contrib/gcc/genattrtab.c b/contrib/gcc/genattrtab.c
index 2555e10..9e2c1df 100644
--- a/contrib/gcc/genattrtab.c
+++ b/contrib/gcc/genattrtab.c
@@ -959,6 +959,7 @@ check_attr_value (rtx exp, struct attr_desc *attr)
case CTZ:
case POPCOUNT:
case PARITY:
+ case BSWAP:
XEXP (exp, 0) = check_attr_value (XEXP (exp, 0), attr);
break;
diff --git a/contrib/gcc/genopinit.c b/contrib/gcc/genopinit.c
index c9cea08..8541c1b 100644
--- a/contrib/gcc/genopinit.c
+++ b/contrib/gcc/genopinit.c
@@ -148,6 +148,7 @@ static const char * const optabs[] =
"atan_optab->handlers[$A].insn_code = CODE_FOR_$(atan$a2$)",
"strlen_optab->handlers[$A].insn_code = CODE_FOR_$(strlen$a$)",
"one_cmpl_optab->handlers[$A].insn_code = CODE_FOR_$(one_cmpl$a2$)",
+ "bswap_optab->handlers[$A].insn_code = CODE_FOR_$(bswap$a2$)",
"ffs_optab->handlers[$A].insn_code = CODE_FOR_$(ffs$a2$)",
"clz_optab->handlers[$A].insn_code = CODE_FOR_$(clz$a2$)",
"ctz_optab->handlers[$A].insn_code = CODE_FOR_$(ctz$a2$)",
diff --git a/contrib/gcc/gimplify.c b/contrib/gcc/gimplify.c
index 7efae38..be45f47 100644
--- a/contrib/gcc/gimplify.c
+++ b/contrib/gcc/gimplify.c
@@ -6397,7 +6397,8 @@ gimplify_function_tree (tree fndecl)
catch the exit hook. */
/* ??? Add some way to ignore exceptions for this TFE. */
if (flag_instrument_function_entry_exit
- && ! DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (fndecl))
+ && !DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (fndecl)
+ && !flag_instrument_functions_exclude_p (fndecl))
{
tree tf, x, bind;
diff --git a/contrib/gcc/langhooks-def.h b/contrib/gcc/langhooks-def.h
index eae7c92..633642c 100644
--- a/contrib/gcc/langhooks-def.h
+++ b/contrib/gcc/langhooks-def.h
@@ -217,6 +217,7 @@ extern tree lhd_make_node (enum tree_code);
so we create a compile-time error instead. */
#define LANG_HOOKS_MAKE_TYPE lhd_make_node
#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR lhd_incomplete_type_error
+#define LANG_HOOKS_GENERIC_TYPE_P hook_bool_tree_false
#define LANG_HOOKS_TYPE_PROMOTES_TO lhd_type_promotes_to
#define LANG_HOOKS_REGISTER_BUILTIN_TYPE lhd_register_builtin_type
#define LANG_HOOKS_TYPE_MAX_SIZE lhd_return_null_tree
@@ -231,6 +232,7 @@ extern tree lhd_make_node (enum tree_code);
LANG_HOOKS_UNSIGNED_TYPE, \
LANG_HOOKS_SIGNED_TYPE, \
LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, \
+ LANG_HOOKS_GENERIC_TYPE_P, \
LANG_HOOKS_TYPE_PROMOTES_TO, \
LANG_HOOKS_REGISTER_BUILTIN_TYPE, \
LANG_HOOKS_INCOMPLETE_TYPE_ERROR, \
diff --git a/contrib/gcc/langhooks.h b/contrib/gcc/langhooks.h
index e614893..1254c63 100644
--- a/contrib/gcc/langhooks.h
+++ b/contrib/gcc/langhooks.h
@@ -119,6 +119,10 @@ struct lang_hooks_for_types
according to UNSIGNEDP. */
tree (*signed_or_unsigned_type) (int, tree);
+ /* True if the type is an instantiation of a generic type,
+ e.g. C++ template implicit specializations. */
+ bool (*generic_p) (tree);
+
/* Given a type, apply default promotions to unnamed function
arguments and return the new type. Return the same type if no
change. Required by any language that supports variadic
diff --git a/contrib/gcc/libgcc-std.ver b/contrib/gcc/libgcc-std.ver
index f8e9e52..2d0a43d 100644
--- a/contrib/gcc/libgcc-std.ver
+++ b/contrib/gcc/libgcc-std.ver
@@ -274,3 +274,10 @@ GCC_4.2.0 {
__floatuntitf
_Unwind_GetIPInfo
}
+
+%inherit GCC_4.3 GCC_4.2.0
+GCC_4.3.0 {
+ # byte swapping routines
+ __bswapsi2
+ __bswapdi2
+}
diff --git a/contrib/gcc/libgcc2.c b/contrib/gcc/libgcc2.c
index 851bdd0..58ad320 100644
--- a/contrib/gcc/libgcc2.c
+++ b/contrib/gcc/libgcc2.c
@@ -492,6 +492,30 @@ __ashrdi3 (DWtype u, word_type b)
}
#endif
+#ifdef L_bswapsi2
+UWtype
+__bswapsi2 (UWtype u)
+{
+ return ((((u) & 0xff000000) >> 24)
+ | (((u) & 0x00ff0000) >> 8)
+ | (((u) & 0x0000ff00) << 8)
+ | (((u) & 0x000000ff) << 24));
+}
+#endif
+#ifdef L_bswapdi2
+UDWtype
+__bswapdi2 (UDWtype u)
+{
+ return ((((u) & 0xff00000000000000ull) >> 56)
+ | (((u) & 0x00ff000000000000ull) >> 40)
+ | (((u) & 0x0000ff0000000000ull) >> 24)
+ | (((u) & 0x000000ff00000000ull) >> 8)
+ | (((u) & 0x00000000ff000000ull) << 8)
+ | (((u) & 0x0000000000ff0000ull) << 24)
+ | (((u) & 0x000000000000ff00ull) << 40)
+ | (((u) & 0x00000000000000ffull) << 56));
+}
+#endif
#ifdef L_ffssi2
#undef int
int
@@ -1862,7 +1886,7 @@ CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
{
MTYPE denom, ratio, x, y;
- /* ??? We can get better behavior from logarithmic scaling instead of
+ /* ??? We can get better behavior from logarithmic scaling instead of
the division. But that would mean starting to link libgcc against
libm. We could implement something akin to ldexp/frexp as gcc builtins
fairly easily... */
diff --git a/contrib/gcc/libgcc2.h b/contrib/gcc/libgcc2.h
index c13f0c7..d15ab8d 100644
--- a/contrib/gcc/libgcc2.h
+++ b/contrib/gcc/libgcc2.h
@@ -345,11 +345,13 @@ extern Wtype __addvSI3 (Wtype, Wtype);
extern Wtype __subvSI3 (Wtype, Wtype);
extern Wtype __mulvSI3 (Wtype, Wtype);
extern Wtype __negvSI2 (Wtype);
+extern UWtype __bswapsi2 (UWtype);
extern DWtype __absvDI2 (DWtype);
extern DWtype __addvDI3 (DWtype, DWtype);
extern DWtype __subvDI3 (DWtype, DWtype);
extern DWtype __mulvDI3 (DWtype, DWtype);
extern DWtype __negvDI2 (DWtype);
+extern UDWtype __bswapdi2 (UDWtype);
#ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC
extern SItype __absvsi2 (SItype);
diff --git a/contrib/gcc/mips-tdump.c b/contrib/gcc/mips-tdump.c
index 6cdbcfe..cd5df38 100644
--- a/contrib/gcc/mips-tdump.c
+++ b/contrib/gcc/mips-tdump.c
@@ -29,11 +29,11 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#ifdef index
#undef index
#endif
-#ifndef CROSS_COMPILE
+#ifndef CROSS_DIRECTORY_STRUCTURE
#include <a.out.h>
#else
#include "mips/a.out.h"
-#endif /* CROSS_COMPILE */
+#endif /* CROSS_DIRECTORY_STRUCTURE */
/* Include getopt.h for the sake of getopt_long. */
#include "getopt.h"
diff --git a/contrib/gcc/mips-tfile.c b/contrib/gcc/mips-tfile.c
index 7530ac7..c543f97 100644
--- a/contrib/gcc/mips-tfile.c
+++ b/contrib/gcc/mips-tfile.c
@@ -667,11 +667,11 @@ main (void)
#include <signal.h>
-#ifndef CROSS_COMPILE
+#ifndef CROSS_DIRECTORY_STRUCTURE
#include <a.out.h>
#else
#include "mips/a.out.h"
-#endif /* CROSS_COMPILE */
+#endif /* CROSS_DIRECTORY_STRUCTURE */
#include "gstab.h"
diff --git a/contrib/gcc/mklibgcc.in b/contrib/gcc/mklibgcc.in
index b4a31a6..60e3905 100644
--- a/contrib/gcc/mklibgcc.in
+++ b/contrib/gcc/mklibgcc.in
@@ -91,7 +91,7 @@ lib2funcs='_muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3
_ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab
_popcountsi2 _popcountdi2 _paritysi2 _paritydi2 _powisf2 _powidf2
_powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3
- _divxc3 _divtc3'
+ _divxc3 _divtc3 _bswapsi2 _bswapdi2'
if [ "$LIB2_SIDITI_CONV_FUNCS" ]; then
for func in $swfloatfuncs; do
diff --git a/contrib/gcc/optabs.c b/contrib/gcc/optabs.c
index 539b3ad..3b9a23d 100644
--- a/contrib/gcc/optabs.c
+++ b/contrib/gcc/optabs.c
@@ -2591,6 +2591,10 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
goto try_libcall;
}
+ /* We can't widen a bswap. */
+ if (unoptab == bswap_optab)
+ goto try_libcall;
+
if (CLASS_HAS_WIDER_MODES_P (class))
for (wider_mode = GET_MODE_WIDER_MODE (mode);
wider_mode != VOIDmode;
@@ -5253,6 +5257,7 @@ init_optabs (void)
absv_optab = init_optabv (ABS);
addcc_optab = init_optab (UNKNOWN);
one_cmpl_optab = init_optab (NOT);
+ bswap_optab = init_optab (BSWAP);
ffs_optab = init_optab (FFS);
clz_optab = init_optab (CLZ);
ctz_optab = init_optab (CTZ);
@@ -5456,6 +5461,11 @@ init_optabs (void)
init_interclass_conv_libfuncs (trunc_optab, "trunc", MODE_FLOAT, MODE_DECIMAL_FLOAT);
init_interclass_conv_libfuncs (trunc_optab, "trunc", MODE_DECIMAL_FLOAT, MODE_FLOAT);
+ /* Explicitly initialize the bswap libfuncs since we need them to be
+ valid for things other than word_mode. */
+ set_optab_libfunc (bswap_optab, SImode, "__bswapsi2");
+ set_optab_libfunc (bswap_optab, DImode, "__bswapdi2");
+
/* Use cabs for double complex abs, since systems generally have cabs.
Don't define any libcall for float complex, so that cabs will be used. */
if (complex_double_type_node)
diff --git a/contrib/gcc/optabs.h b/contrib/gcc/optabs.h
index 58fb690..854341b 100644
--- a/contrib/gcc/optabs.h
+++ b/contrib/gcc/optabs.h
@@ -146,6 +146,8 @@ enum optab_index
/* Abs value */
OTI_abs,
OTI_absv,
+ /* Byteswap */
+ OTI_bswap,
/* Bitwise not */
OTI_one_cmpl,
/* Bit scanning and counting */
@@ -315,6 +317,7 @@ extern GTY(()) optab optab_table[OTI_MAX];
#define abs_optab (optab_table[OTI_abs])
#define absv_optab (optab_table[OTI_absv])
#define one_cmpl_optab (optab_table[OTI_one_cmpl])
+#define bswap_optab (optab_table[OTI_bswap])
#define ffs_optab (optab_table[OTI_ffs])
#define clz_optab (optab_table[OTI_clz])
#define ctz_optab (optab_table[OTI_ctz])
diff --git a/contrib/gcc/opts.c b/contrib/gcc/opts.c
index fb122ba..87f8984 100644
--- a/contrib/gcc/opts.c
+++ b/contrib/gcc/opts.c
@@ -59,6 +59,11 @@ bool extra_warnings;
bool warn_larger_than;
HOST_WIDE_INT larger_than_size;
+/* True to warn about any function whose frame size is larger
+ * than N bytes. */
+bool warn_frame_larger_than;
+HOST_WIDE_INT frame_larger_than_size;
+
/* Nonzero means warn about constructs which might not be
strict-aliasing safe. */
int warn_strict_aliasing;
@@ -79,6 +84,256 @@ enum debug_info_type write_symbols = NO_DEBUG;
the definitions of the different possible levels. */
enum debug_info_level debug_info_level = DINFO_LEVEL_NONE;
+/* A major contribution to object and executable size is debug
+ information size. A major contribution to debug information size
+ is struct descriptions replicated in several object files. The
+ following flags attempt to reduce this information. The basic
+ idea is to not emit struct debugging information in the current
+ compilation unit when that information will be generated by
+ another compilation unit.
+
+ Debug information for a struct defined in the current source
+ file should be generated in the object file. Likewise the
+ debug information for a struct defined in a header should be
+ generated in the object file of the corresponding source file.
+ Both of these case are handled when the base name of the file of
+ the struct definition matches the base name of the source file
+ of thet current compilation unit. This matching emits minimal
+ struct debugging information.
+
+ The base file name matching rule above will fail to emit debug
+ information for structs defined in system headers. So a second
+ category of files includes system headers in addition to files
+ with matching bases.
+
+ The remaining types of files are library headers and application
+ headers. We cannot currently distinguish these two types. */
+
+enum debug_struct_file
+{
+ DINFO_STRUCT_FILE_NONE, /* Debug no structs. */
+ DINFO_STRUCT_FILE_BASE, /* Debug structs defined in files with the
+ same base name as the compilation unit. */
+ DINFO_STRUCT_FILE_SYS, /* Also debug structs defined in system
+ header files. */
+ DINFO_STRUCT_FILE_ANY /* Debug structs defined in all files. */
+};
+
+/* Generic structs (e.g. templates not explicitly specialized)
+ may not have a compilation unit associated with them, and so
+ may need to be treated differently from ordinary structs.
+
+ Structs only handled by reference (indirectly), will also usually
+ not need as much debugging information. */
+
+static enum debug_struct_file debug_struct_ordinary[DINFO_USAGE_NUM_ENUMS]
+ = { DINFO_STRUCT_FILE_ANY, DINFO_STRUCT_FILE_ANY, DINFO_STRUCT_FILE_ANY };
+static enum debug_struct_file debug_struct_generic[DINFO_USAGE_NUM_ENUMS]
+ = { DINFO_STRUCT_FILE_ANY, DINFO_STRUCT_FILE_ANY, DINFO_STRUCT_FILE_ANY };
+
+/* Parse the -femit-struct-debug-detailed option value
+ and set the flag variables. */
+
+#define MATCH( prefix, string ) \
+ ((strncmp (prefix, string, sizeof prefix - 1) == 0) \
+ ? ((string += sizeof prefix - 1), 1) : 0)
+
+void
+set_struct_debug_option (const char *spec)
+{
+ /* various labels for comparison */
+ static char dfn_lbl[] = "dfn:", dir_lbl[] = "dir:", ind_lbl[] = "ind:";
+ static char ord_lbl[] = "ord:", gen_lbl[] = "gen:";
+ static char none_lbl[] = "none", any_lbl[] = "any";
+ static char base_lbl[] = "base", sys_lbl[] = "sys";
+
+ enum debug_struct_file files = DINFO_STRUCT_FILE_ANY;
+ /* Default is to apply to as much as possible. */
+ enum debug_info_usage usage = DINFO_USAGE_NUM_ENUMS;
+ int ord = 1, gen = 1;
+
+ /* What usage? */
+ if (MATCH (dfn_lbl, spec))
+ usage = DINFO_USAGE_DFN;
+ else if (MATCH (dir_lbl, spec))
+ usage = DINFO_USAGE_DIR_USE;
+ else if (MATCH (ind_lbl, spec))
+ usage = DINFO_USAGE_IND_USE;
+
+ /* Generics or not? */
+ if (MATCH (ord_lbl, spec))
+ gen = 0;
+ else if (MATCH (gen_lbl, spec))
+ ord = 0;
+
+ /* What allowable environment? */
+ if (MATCH (none_lbl, spec))
+ files = DINFO_STRUCT_FILE_NONE;
+ else if (MATCH (any_lbl, spec))
+ files = DINFO_STRUCT_FILE_ANY;
+ else if (MATCH (sys_lbl, spec))
+ files = DINFO_STRUCT_FILE_SYS;
+ else if (MATCH (base_lbl, spec))
+ files = DINFO_STRUCT_FILE_BASE;
+ else
+ error ("argument %qs to %<-femit-struct-debug-detailed%> not recognized",
+ spec);
+
+ /* Effect the specification. */
+ if (usage == DINFO_USAGE_NUM_ENUMS)
+ {
+ if (ord)
+ {
+ debug_struct_ordinary[DINFO_USAGE_DFN] = files;
+ debug_struct_ordinary[DINFO_USAGE_DIR_USE] = files;
+ debug_struct_ordinary[DINFO_USAGE_IND_USE] = files;
+ }
+ if (gen)
+ {
+ debug_struct_generic[DINFO_USAGE_DFN] = files;
+ debug_struct_generic[DINFO_USAGE_DIR_USE] = files;
+ debug_struct_generic[DINFO_USAGE_IND_USE] = files;
+ }
+ }
+ else
+ {
+ if (ord)
+ debug_struct_ordinary[usage] = files;
+ if (gen)
+ debug_struct_generic[usage] = files;
+ }
+
+ if (*spec == ',')
+ set_struct_debug_option (spec+1);
+ else
+ {
+ /* No more -femit-struct-debug-detailed specifications.
+ Do final checks. */
+ if (*spec != '\0')
+ error ("argument %qs to %<-femit-struct-debug-detailed%> unknown",
+ spec);
+ if (debug_struct_ordinary[DINFO_USAGE_DIR_USE]
+ < debug_struct_ordinary[DINFO_USAGE_IND_USE]
+ || debug_struct_generic[DINFO_USAGE_DIR_USE]
+ < debug_struct_generic[DINFO_USAGE_IND_USE])
+ error ("%<-femit-struct-debug-detailed=dir:...%> must allow at least"
+ " as much as %<-femit-struct-debug-detailed=ind:...%>");
+ }
+}
+
+/* Find the base name of a path, stripping off both directories and
+ a single final extension. */
+static int
+base_of_path (const char *path, const char **base_out)
+{
+ const char *base = path;
+ const char *dot = 0;
+ const char *p = path;
+ char c = *p;
+ while (c)
+ {
+ if (IS_DIR_SEPARATOR(c))
+ {
+ base = p + 1;
+ dot = 0;
+ }
+ else if (c == '.')
+ dot = p;
+ c = *++p;
+ }
+ if (!dot)
+ dot = p;
+ *base_out = base;
+ return dot - base;
+}
+
+/* Match the base name of a file to the base name of a compilation unit. */
+
+static const char *main_input_basename;
+static int main_input_baselength;
+
+static int
+matches_main_base (const char *path)
+{
+ /* Cache the last query. */
+ static const char *last_path = NULL;
+ static int last_match = 0;
+ if (path != last_path)
+ {
+ const char *base;
+ int length = base_of_path (path, &base);
+ last_path = path;
+ last_match = (length == main_input_baselength
+ && memcmp (base, main_input_basename, length) == 0);
+ }
+ return last_match;
+}
+
+#ifdef DEBUG_DEBUG_STRUCT
+
+static int
+dump_struct_debug (tree type, enum debug_info_usage usage,
+ enum debug_struct_file criterion, int generic,
+ int matches, int result)
+{
+ /* Find the type name. */
+ tree type_decl = TYPE_STUB_DECL (type);
+ tree t = type_decl;
+ const char *name = 0;
+ if (TREE_CODE (t) == TYPE_DECL)
+ t = DECL_NAME (t);
+ if (t)
+ name = IDENTIFIER_POINTER (t);
+
+ fprintf (stderr, " struct %d %s %s %s %s %d %p %s\n",
+ criterion,
+ DECL_IN_SYSTEM_HEADER (type_decl) ? "sys" : "usr",
+ matches ? "bas" : "hdr",
+ generic ? "gen" : "ord",
+ usage == DINFO_USAGE_DFN ? ";" :
+ usage == DINFO_USAGE_DIR_USE ? "." : "*",
+ result,
+ (void*) type_decl, name);
+ return result;
+}
+#define DUMP_GSTRUCT(type, usage, criterion, generic, matches, result) \
+ dump_struct_debug (type, usage, criterion, generic, matches, result)
+
+#else
+
+#define DUMP_GSTRUCT(type, usage, criterion, generic, matches, result) \
+ (result)
+
+#endif
+
+
+bool
+should_emit_struct_debug (tree type, enum debug_info_usage usage)
+{
+ enum debug_struct_file criterion;
+ tree type_decl;
+ bool generic = lang_hooks.types.generic_p (type);
+
+ if (generic)
+ criterion = debug_struct_generic[usage];
+ else
+ criterion = debug_struct_ordinary[usage];
+
+ if (criterion == DINFO_STRUCT_FILE_NONE)
+ return DUMP_GSTRUCT (type, usage, criterion, generic, false, false);
+ if (criterion == DINFO_STRUCT_FILE_ANY)
+ return DUMP_GSTRUCT (type, usage, criterion, generic, false, true);
+
+ type_decl = TYPE_STUB_DECL (type);
+
+ if (criterion == DINFO_STRUCT_FILE_SYS && DECL_IN_SYSTEM_HEADER (type_decl))
+ return DUMP_GSTRUCT (type, usage, criterion, generic, false, true);
+
+ if (matches_main_base (DECL_SOURCE_FILE (type_decl)))
+ return DUMP_GSTRUCT (type, usage, criterion, generic, true, true);
+ return DUMP_GSTRUCT (type, usage, criterion, generic, false, false);
+}
+
/* Nonzero means use GNU-only extensions in the generated symbolic
debugging information. Currently, this only has an effect when
write_symbols is set to DBX_DEBUG, XCOFF_DEBUG, or DWARF_DEBUG. */
@@ -108,6 +363,15 @@ static bool flag_unroll_loops_set, flag_tracer_set;
static bool flag_value_profile_transformations_set;
static bool flag_peel_loops_set, flag_branch_probabilities_set;
+/* Functions excluded from profiling. */
+
+typedef char *char_p; /* For DEF_VEC_P. */
+DEF_VEC_P(char_p);
+DEF_VEC_ALLOC_P(char_p,heap);
+
+static VEC(char_p,heap) *flag_instrument_functions_exclude_functions;
+static VEC(char_p,heap) *flag_instrument_functions_exclude_files;
+
/* Input file names. */
const char **in_fnames;
unsigned num_in_fnames;
@@ -354,6 +618,87 @@ add_input_filename (const char *filename)
in_fnames[num_in_fnames - 1] = filename;
}
+/* Add functions or file names to a vector of names to exclude from
+ instrumentation. */
+
+static void
+add_instrument_functions_exclude_list (VEC(char_p,heap) **pvec,
+ const char* arg)
+{
+ char *tmp;
+ char *r;
+ char *w;
+ char *token_start;
+
+ /* We never free this string. */
+ tmp = xstrdup (arg);
+
+ r = tmp;
+ w = tmp;
+ token_start = tmp;
+
+ while (*r != '\0')
+ {
+ if (*r == ',')
+ {
+ *w++ = '\0';
+ ++r;
+ VEC_safe_push (char_p, heap, *pvec, token_start);
+ token_start = w;
+ }
+ if (*r == '\\' && r[1] == ',')
+ {
+ *w++ = ',';
+ r += 2;
+ }
+ else
+ *w++ = *r++;
+ }
+ if (*token_start != '\0')
+ VEC_safe_push (char_p, heap, *pvec, token_start);
+}
+
+/* Return whether we should exclude FNDECL from instrumentation. */
+
+bool
+flag_instrument_functions_exclude_p (tree fndecl)
+{
+ if (VEC_length (char_p, flag_instrument_functions_exclude_functions) > 0)
+ {
+ const char *name;
+ int i;
+ char *s;
+
+ name = lang_hooks.decl_printable_name (fndecl, 0);
+ for (i = 0;
+ VEC_iterate (char_p, flag_instrument_functions_exclude_functions,
+ i, s);
+ ++i)
+ {
+ if (strstr (name, s) != NULL)
+ return true;
+ }
+ }
+
+ if (VEC_length (char_p, flag_instrument_functions_exclude_files) > 0)
+ {
+ const char *name;
+ int i;
+ char *s;
+
+ name = DECL_SOURCE_FILE (fndecl);
+ for (i = 0;
+ VEC_iterate (char_p, flag_instrument_functions_exclude_files, i, s);
+ ++i)
+ {
+ if (strstr (name, s) != NULL)
+ return true;
+ }
+ }
+
+ return false;
+}
+
/* Decode and handle the vector of command line options. LANG_MASK
contains has a single bit set representing the current
language. */
@@ -370,7 +715,11 @@ handle_options (unsigned int argc, const char **argv, unsigned int lang_mask)
if (opt[0] != '-' || opt[1] == '\0')
{
if (main_input_filename == NULL)
+ {
main_input_filename = opt;
+ main_input_baselength
+ = base_of_path (main_input_filename, &main_input_basename);
+ }
add_input_filename (opt);
n = 1;
continue;
@@ -725,7 +1074,15 @@ common_handle_option (size_t scode, const char *arg, int value,
warn_larger_than = value != -1;
break;
+ case OPT_Wframe_larger_than_:
+ frame_larger_than_size = value;
+ warn_frame_larger_than = value != -1;
+ break;
+
case OPT_Wstrict_aliasing:
+ set_warn_strict_aliasing (value);
+ break;
+
case OPT_Wstrict_aliasing_:
warn_strict_aliasing = value;
break;
@@ -832,6 +1189,16 @@ common_handle_option (size_t scode, const char *arg, int value,
set_param_value ("max-inline-insns-auto", value / 2);
break;
+ case OPT_finstrument_functions_exclude_function_list_:
+ add_instrument_functions_exclude_list
+ (&flag_instrument_functions_exclude_functions, arg);
+ break;
+
+ case OPT_finstrument_functions_exclude_file_list_:
+ add_instrument_functions_exclude_list
+ (&flag_instrument_functions_exclude_files, arg);
+ break;
+
case OPT_fmessage_length_:
pp_set_line_maximum_length (global_dc->printer, value);
break;
@@ -1094,6 +1461,20 @@ set_Wunused (int setting)
warn_unused_value = setting;
}
+/* Used to set the level of strict aliasing warnings,
+ when no level is specified (i.e., when -Wstrict-aliasing, and not
+ -Wstrict-aliasing=level was given).
+ ONOFF is assumed to take value 1 when -Wstrict-aliasing is specified,
+ and 0 otherwise. After calling this function, wstrict_aliasing will be
+ set to the default value of -Wstrict_aliasing=level, currently 3. */
+void
+set_warn_strict_aliasing (int onoff)
+{
+ gcc_assert (onoff == 0 || onoff == 1);
+ if (onoff != 0)
+ warn_strict_aliasing = 3;
+}
+
/* The following routines are useful in setting all the flags that
-ffast-math and -fno-fast-math imply. */
void
diff --git a/contrib/gcc/postreload-gcse.c b/contrib/gcc/postreload-gcse.c
index 76b7b8c..3e3f805 100644
--- a/contrib/gcc/postreload-gcse.c
+++ b/contrib/gcc/postreload-gcse.c
@@ -197,8 +197,6 @@ static void dump_hash_table (FILE *);
static bool reg_killed_on_edge (rtx, edge);
static bool reg_used_on_edge (rtx, edge);
-static rtx reg_set_between_after_reload_p (rtx, rtx, rtx);
-static rtx reg_used_between_after_reload_p (rtx, rtx, rtx);
static rtx get_avail_load_store_reg (rtx);
static bool bb_has_well_behaved_predecessors (basic_block);
@@ -470,6 +468,22 @@ dump_hash_table (FILE *file)
fprintf (file, "\n");
}
+/* Return true if register X is recorded as being set by an instruction
+ whose CUID is greater than the one given. */
+
+static bool
+reg_changed_after_insn_p (rtx x, int cuid)
+{
+ unsigned int regno, end_regno;
+
+ regno = REGNO (x);
+ end_regno = END_HARD_REGNO (x);
+ do
+ if (reg_avail_info[regno] > cuid)
+ return true;
+ while (++regno < end_regno);
+ return false;
+}
/* Return nonzero if the operands of expression X are unchanged
1) from the start of INSN's basic block up to but not including INSN
@@ -493,14 +507,9 @@ oprs_unchanged_p (rtx x, rtx insn, bool after_insn)
/* We are called after register allocation. */
gcc_assert (REGNO (x) < FIRST_PSEUDO_REGISTER);
if (after_insn)
- /* If the last CUID setting the insn is less than the CUID of
- INSN, then reg X is not changed in or after INSN. */
- return reg_avail_info[REGNO (x)] < INSN_CUID (insn);
+ return !reg_changed_after_insn_p (x, INSN_CUID (insn) - 1);
else
- /* Reg X is not set before INSN in the current basic block if
- we have not yet recorded the CUID of an insn that touches
- the reg. */
- return reg_avail_info[REGNO (x)] == 0;
+ return !reg_changed_after_insn_p (x, 0);
case MEM:
if (load_killed_in_block_p (INSN_CUID (insn), x, after_insn))
@@ -717,12 +726,28 @@ record_opr_changes (rtx insn)
/* Finally, if this is a call, record all call clobbers. */
if (CALL_P (insn))
{
- unsigned int regno;
+ unsigned int regno, end_regno;
+ rtx link, x;
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, regno))
record_last_reg_set_info (insn, regno);
+ for (link = CALL_INSN_FUNCTION_USAGE (insn); link; link = XEXP (link, 1))
+ if (GET_CODE (XEXP (link, 0)) == CLOBBER)
+ {
+ x = XEXP (XEXP (link, 0), 0);
+ if (REG_P (x))
+ {
+ gcc_assert (HARD_REGISTER_P (x));
+ regno = REGNO (x);
+ end_regno = END_HARD_REGNO (x);
+ do
+ record_last_reg_set_info (insn, regno);
+ while (++regno < end_regno);
+ }
+ }
+
if (! CONST_OR_PURE_CALL_P (insn))
record_last_mem_set_info (insn);
}
@@ -856,96 +881,6 @@ reg_used_on_edge (rtx reg, edge e)
return false;
}
-
-/* Return the insn that sets register REG or clobbers it in between
- FROM_INSN and TO_INSN (exclusive of those two).
- Just like reg_set_between but for hard registers and not pseudos. */
-
-static rtx
-reg_set_between_after_reload_p (rtx reg, rtx from_insn, rtx to_insn)
-{
- rtx insn;
-
- /* We are called after register allocation. */
- gcc_assert (REG_P (reg) && REGNO (reg) < FIRST_PSEUDO_REGISTER);
-
- if (from_insn == to_insn)
- return NULL_RTX;
-
- for (insn = NEXT_INSN (from_insn);
- insn != to_insn;
- insn = NEXT_INSN (insn))
- if (INSN_P (insn))
- {
- if (set_of (reg, insn) != NULL_RTX)
- return insn;
- if ((CALL_P (insn)
- && call_used_regs[REGNO (reg)])
- || find_reg_fusage (insn, CLOBBER, reg))
- return insn;
-
- if (FIND_REG_INC_NOTE (insn, reg))
- return insn;
- }
-
- return NULL_RTX;
-}
-
-/* Return the insn that uses register REG in between FROM_INSN and TO_INSN
- (exclusive of those two). Similar to reg_used_between but for hard
- registers and not pseudos. */
-
-static rtx
-reg_used_between_after_reload_p (rtx reg, rtx from_insn, rtx to_insn)
-{
- rtx insn;
-
- /* We are called after register allocation. */
- gcc_assert (REG_P (reg) && REGNO (reg) < FIRST_PSEUDO_REGISTER);
-
- if (from_insn == to_insn)
- return NULL_RTX;
-
- for (insn = NEXT_INSN (from_insn);
- insn != to_insn;
- insn = NEXT_INSN (insn))
- if (INSN_P (insn))
- {
- if (reg_overlap_mentioned_p (reg, PATTERN (insn))
- || (CALL_P (insn)
- && call_used_regs[REGNO (reg)])
- || find_reg_fusage (insn, USE, reg)
- || find_reg_fusage (insn, CLOBBER, reg))
- return insn;
-
- if (FIND_REG_INC_NOTE (insn, reg))
- return insn;
- }
-
- return NULL_RTX;
-}
-
-/* Return true if REG is used, set, or killed between the beginning of
- basic block BB and UP_TO_INSN. Caches the result in reg_avail_info. */
-
-static bool
-reg_set_or_used_since_bb_start (rtx reg, basic_block bb, rtx up_to_insn)
-{
- rtx insn, start = PREV_INSN (BB_HEAD (bb));
-
- if (reg_avail_info[REGNO (reg)] != 0)
- return true;
-
- insn = reg_used_between_after_reload_p (reg, start, up_to_insn);
- if (! insn)
- insn = reg_set_between_after_reload_p (reg, start, up_to_insn);
-
- if (insn)
- reg_avail_info[REGNO (reg)] = INSN_CUID (insn);
-
- return insn != NULL_RTX;
-}
-
/* Return the loaded/stored register of a load/store instruction. */
static rtx
@@ -1037,7 +972,8 @@ eliminate_partially_redundant_load (basic_block bb, rtx insn,
/* Check that the loaded register is not used, set, or killed from the
beginning of the block. */
- if (reg_set_or_used_since_bb_start (dest, bb, insn))
+ if (reg_changed_after_insn_p (dest, 0)
+ || reg_used_between_p (dest, PREV_INSN (BB_HEAD (bb)), insn))
return;
/* Check potential for replacing load with copy for predecessors. */
@@ -1068,8 +1004,7 @@ eliminate_partially_redundant_load (basic_block bb, rtx insn,
avail_insn = NULL;
continue;
}
- if (! reg_set_between_after_reload_p (avail_reg, avail_insn,
- next_pred_bb_end))
+ if (!reg_set_between_p (avail_reg, avail_insn, next_pred_bb_end))
/* AVAIL_INSN remains non-null. */
break;
else
diff --git a/contrib/gcc/print-tree.c b/contrib/gcc/print-tree.c
index 57b07ac..ef87ab6 100644
--- a/contrib/gcc/print-tree.c
+++ b/contrib/gcc/print-tree.c
@@ -439,17 +439,15 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
|| DECL_INLINE (node) || DECL_BUILT_IN (node))
indent_to (file, indent + 3);
- if (TREE_CODE (node) != FUNCTION_DECL)
- {
- if (DECL_USER_ALIGN (node))
- fprintf (file, " user");
-
- fprintf (file, " align %d", DECL_ALIGN (node));
- if (TREE_CODE (node) == FIELD_DECL)
- fprintf (file, " offset_align " HOST_WIDE_INT_PRINT_UNSIGNED,
- DECL_OFFSET_ALIGN (node));
- }
- else if (DECL_BUILT_IN (node))
+ if (DECL_USER_ALIGN (node))
+ fprintf (file, " user");
+
+ fprintf (file, " align %d", DECL_ALIGN (node));
+ if (TREE_CODE (node) == FIELD_DECL)
+ fprintf (file, " offset_align " HOST_WIDE_INT_PRINT_UNSIGNED,
+ DECL_OFFSET_ALIGN (node));
+
+ if (TREE_CODE (node) == FUNCTION_DECL && DECL_BUILT_IN (node))
{
if (DECL_BUILT_IN_CLASS (node) == BUILT_IN_MD)
fprintf (file, " built-in BUILT_IN_MD %d", DECL_FUNCTION_CODE (node));
diff --git a/contrib/gcc/regs.h b/contrib/gcc/regs.h
index ee074b9..ed0725a 100644
--- a/contrib/gcc/regs.h
+++ b/contrib/gcc/regs.h
@@ -239,5 +239,41 @@ extern void allocate_reg_info (size_t, int, int);
/* Specify number of hard registers given machine mode occupy. */
extern unsigned char hard_regno_nregs[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
+/* Return an exclusive upper bound on the registers occupied by hard
+ register (reg:MODE REGNO). */
+
+static inline unsigned int
+end_hard_regno (enum machine_mode mode, unsigned int regno)
+{
+ return regno + hard_regno_nregs[regno][(int) mode];
+}
+
+/* Likewise for hard register X. */
+
+#define END_HARD_REGNO(X) end_hard_regno (GET_MODE (X), REGNO (X))
+
+/* Likewise for hard or pseudo register X. */
+
+#define END_REGNO(X) (HARD_REGISTER_P (X) ? END_HARD_REGNO (X) : REGNO (X) + 1)
+
+
+/* Return true if (reg:MODE REGNO) includes an element of REGS. */
+
+static inline bool
+overlaps_hard_reg_set_p (const HARD_REG_SET regs, enum machine_mode mode,
+ unsigned int regno)
+{
+ unsigned int end_regno;
+
+ if (TEST_HARD_REG_BIT (regs, regno))
+ return true;
+
+ end_regno = end_hard_regno (mode, regno);
+ while (++regno < end_regno)
+ if (TEST_HARD_REG_BIT (regs, regno))
+ return true;
+
+ return false;
+}
#endif /* GCC_REGS_H */
diff --git a/contrib/gcc/reload1.c b/contrib/gcc/reload1.c
index 20da1b6..30ea7f3 100644
--- a/contrib/gcc/reload1.c
+++ b/contrib/gcc/reload1.c
@@ -2555,6 +2555,7 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn,
case CTZ:
case POPCOUNT:
case PARITY:
+ case BSWAP:
new = eliminate_regs_1 (XEXP (x, 0), mem_mode, insn, false);
if (new != XEXP (x, 0))
return gen_rtx_fmt_e (code, GET_MODE (x), new);
@@ -2775,6 +2776,7 @@ elimination_effects (rtx x, enum machine_mode mem_mode)
case CTZ:
case POPCOUNT:
case PARITY:
+ case BSWAP:
elimination_effects (XEXP (x, 0), mem_mode);
return;
diff --git a/contrib/gcc/rtl.def b/contrib/gcc/rtl.def
index 847b51c..cb37f1a 100644
--- a/contrib/gcc/rtl.def
+++ b/contrib/gcc/rtl.def
@@ -567,6 +567,9 @@ DEF_RTL_EXPR(ABS, "abs", "e", RTX_UNARY)
/* Square root */
DEF_RTL_EXPR(SQRT, "sqrt", "e", RTX_UNARY)
+/* Swap bytes. */
+DEF_RTL_EXPR(BSWAP, "bswap", "e", RTX_UNARY)
+
/* Find first bit that is set.
Value is 1 + number of trailing zeros in the arg.,
or 0 if arg is 0. */
diff --git a/contrib/gcc/rtlanal.c b/contrib/gcc/rtlanal.c
index 54f2f72..4e513e8 100644
--- a/contrib/gcc/rtlanal.c
+++ b/contrib/gcc/rtlanal.c
@@ -748,8 +748,8 @@ reg_set_p (rtx reg, rtx insn)
|| (CALL_P (insn)
&& ((REG_P (reg)
&& REGNO (reg) < FIRST_PSEUDO_REGISTER
- && TEST_HARD_REG_BIT (regs_invalidated_by_call,
- REGNO (reg)))
+ && overlaps_hard_reg_set_p (regs_invalidated_by_call,
+ GET_MODE (reg), REGNO (reg)))
|| MEM_P (reg)
|| find_reg_fusage (insn, CLOBBER, reg)))))
return 1;
diff --git a/contrib/gcc/simplify-rtx.c b/contrib/gcc/simplify-rtx.c
index b088d92..531face 100644
--- a/contrib/gcc/simplify-rtx.c
+++ b/contrib/gcc/simplify-rtx.c
@@ -1044,6 +1044,9 @@ simplify_const_unary_operation (enum rtx_code code, enum machine_mode mode,
val &= 1;
break;
+ case BSWAP:
+ return 0;
+
case TRUNCATE:
val = arg0;
break;
@@ -4887,4 +4890,3 @@ simplify_rtx (rtx x)
}
return NULL;
}
-
diff --git a/contrib/gcc/toplev.c b/contrib/gcc/toplev.c
index 0b73a48..ab6a7ff 100644
--- a/contrib/gcc/toplev.c
+++ b/contrib/gcc/toplev.c
@@ -369,10 +369,6 @@ int align_labels_log;
int align_labels_max_skip;
int align_functions_log;
-/* Like align_functions_log above, but used by front-ends to force the
- minimum function alignment. Zero means no alignment is forced. */
-int force_align_functions_log;
-
typedef struct
{
const char *const string;
diff --git a/contrib/gcc/tree-flow.h b/contrib/gcc/tree-flow.h
index 1d03188..ac8d9d2 100644
--- a/contrib/gcc/tree-flow.h
+++ b/contrib/gcc/tree-flow.h
@@ -694,6 +694,8 @@ static inline bool overlap_subvar (unsigned HOST_WIDE_INT,
definition, a function with this prototype is called. */
typedef bool (*walk_use_def_chains_fn) (tree, tree, void *);
+/* In tree-ssa-alias-warnings.c */
+extern void strict_aliasing_warning_backend (void);
/* In tree-ssa.c */
extern void init_tree_ssa (void);
diff --git a/contrib/gcc/tree-ssa-alias-warnings.c b/contrib/gcc/tree-ssa-alias-warnings.c
new file mode 100644
index 0000000..0c78752
--- /dev/null
+++ b/contrib/gcc/tree-ssa-alias-warnings.c
@@ -0,0 +1,1036 @@
+/* Strict aliasing checks.
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Contributed by Silvius Rus <rus@google.com>.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING. If not, write to
+ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "alloc-pool.h"
+#include "tree.h"
+#include "tree-dump.h"
+#include "tree-flow.h"
+#include "params.h"
+#include "function.h"
+#include "expr.h"
+#include "toplev.h"
+#include "diagnostic.h"
+#include "tree-ssa-structalias.h"
+#include "tree-ssa-propagate.h"
+#include "langhooks.h"
+
+/* Module to issue a warning when a program uses data through a type
+ different from the type through which the data were defined.
+ Implements -Wstrict-aliasing and -Wstrict-aliasing=n.
+ These checks only happen when -fstrict-aliasing is present.
+
+ The idea is to use the compiler to identify occurrences of nonstandard
+ aliasing, and report them to programmers. Programs free of such aliasing
+ are more portable, maintainable, and can usually be optimized better.
+
+ The current, as of April 2007, C and C++ language standards forbid
+ accessing data of type A through an lvalue of another type B,
+ with certain exceptions. See the C Standard ISO/IEC 9899:1999,
+ section 6.5, paragraph 7, and the C++ Standard ISO/IEC 14882:1998,
+ section 3.10, paragraph 15.
+
+ Example 1:*a is used as int but was defined as a float, *b.
+ int* a = ...;
+ float* b = reinterpret_cast<float*> (a);
+ *b = 2.0;
+ return *a
+
+ Unfortunately, the problem is in general undecidable if we take into
+ account arithmetic expressions such as array indices or pointer arithmetic.
+ (It is at least as hard as Peano arithmetic decidability.)
+ Even ignoring arithmetic, the problem is still NP-hard, because it is
+ at least as hard as flow-insensitive may-alias analysis, which was proved
+ NP-hard by Horwitz et al, TOPLAS 1997.
+
+ It is clear that we need to choose some heuristics.
+ Unfortunately, various users have different goals which correspond to
+ different time budgets so a common approach will not suit all.
+ We present the user with three effort/accuracy levels. By accuracy, we mean
+ a common-sense mix of low count of false positives with a
+ reasonably low number of false negatives. We are heavily biased
+ towards a low count of false positives.
+ The effort (compilation time) is likely to increase with the level.
+
+ -Wstrict-aliasing=1
+ ===================
+ Most aggressive, least accurate. Possibly useful when higher levels
+ do not warn but -fstrict-aliasing still breaks the code, as
+ it has very few false negatives.
+ Warn for all bad pointer conversions, even if never dereferenced.
+ Implemented in the front end (c-common.c).
+ Uses alias_sets_might_conflict to compare types.
+
+ -Wstrict-aliasing=2
+ ===================
+ Aggressive, not too precise.
+ May still have many false positives (not as many as level 1 though),
+ and few false negatives (but possibly more than level 1).
+ Runs only in the front end. Uses alias_sets_might_conflict to
+ compare types. Does not check for pointer dereferences.
+ Only warns when an address is taken. Warns about incomplete type punning.
+
+ -Wstrict-aliasing=3 (default)
+ ===================
+ Should have very few false positives and few false negatives.
+ Takes care of the common punn+dereference pattern in the front end:
+ *(int*)&some_float.
+ Takes care of multiple statement cases in the back end,
+ using flow-sensitive points-to information (-O required).
+ Uses alias_sets_conflict_p to compare types and only warns
+ when the converted pointer is dereferenced.
+ Does not warn about incomplete type punning.
+
+ Future improvements can be included by adding higher levels.
+
+ In summary, expression level analysis is performed in the front-end,
+ and multiple-statement analysis is performed in the backend.
+ The remainder of this discussion is only about the backend analysis.
+
+ This implementation uses flow-sensitive points-to information.
+ Flow-sensitivity refers to accesses to the pointer, and not the object
+ pointed. For instance, we do not warn about the following case.
+
+ Example 2.
+ int* a = (int*)malloc (...);
+ float* b = reinterpret_cast<float*> (a);
+ *b = 2.0;
+ a = (int*)malloc (...);
+ return *a;
+
+ In SSA, it becomes clear that the INT value *A_2 referenced in the
+ return statement is not aliased to the FLOAT defined through *B_1.
+ int* a_1 = (int*)malloc (...);
+ float* b_1 = reinterpret_cast<float*> (a_1);
+ *b_1 = 2.0;
+ a_2 = (int*)malloc (...);
+ return *a_2;
+
+
+ Algorithm Outline
+ =================
+
+ ForEach (ptr, object) in the points-to table
+ If (incompatible_types (*ptr, object))
+ If (referenced (ptr, current function)
+ and referenced (object, current function))
+ Issue warning (ptr, object, reference locations)
+
+ The complexity is:
+ O (sizeof (points-to table)
+ + sizeof (function body) * lookup_time (points-to table))
+
+ Pointer dereference locations are looked up on demand. The search is
+ a single scan of the function body, in which all references to pointers
+ and objects in the points-to table are recorded. However, this dominant
+ time factor occurs rarely, only when cross-type aliasing was detected.
+
+
+ Limitations of the Proposed Implementation
+ ==========================================
+
+ 1. We do not catch the following case, because -fstrict-aliasing will
+ associate different tags with MEM while building points-to information,
+ thus before we get to analyze it.
+ XXX: this could be solved by either running with -fno-strict-aliasing
+ or by recording the points-to information before splitting the orignal
+ tag based on type.
+
+ Example 3.
+ void* mem = malloc (...);
+ int* pi = reinterpret_cast<int*> (mem);
+ float* b = reinterpret_cast<float*> (mem);
+ *b = 2.0;
+ return *pi+1;
+
+ 2. We do not check whether the two conflicting (de)references can
+ reach each other in the control flow sense. If we fixed limitation
+ 1, we would wrongly issue a warning in the following case.
+
+ Example 4.
+ void* raw = malloc (...);
+ if (...) {
+ float* b = reinterpret_cast<float*> (raw);
+ *b = 2.0;
+ return (int)*b;
+ } else {
+ int* a = reinterpret_cast<int*> (raw);
+ *a = 1;
+ return *a;
+
+ 3. Only simple types are compared, thus no structures, unions or classes
+ are analyzed. A first attempt to deal with structures introduced much
+ complication and has not showed much improvement in preliminary tests,
+ so it was left out.
+
+ 4. All analysis is intraprocedural. */
+
+
+/* Local declarations. */
+static void find_references_in_function (void);
+
+
+
+/* Get main type of tree TYPE, stripping array dimensions and qualifiers. */
+
+static tree
+get_main_type (tree type)
+{
+ while (TREE_CODE (type) == ARRAY_TYPE)
+ type = TREE_TYPE (type);
+ return TYPE_MAIN_VARIANT (type);
+}
+
+
+/* Get the type of the given object. If IS_PTR is true, get the type of the
+ object pointed to or referenced by OBJECT instead.
+ For arrays, return the element type. Ignore all qualifiers. */
+
+static tree
+get_otype (tree object, bool is_ptr)
+{
+ tree otype = TREE_TYPE (object);
+
+ if (is_ptr)
+ {
+ gcc_assert (POINTER_TYPE_P (otype));
+ otype = TREE_TYPE (otype);
+ }
+ return get_main_type (otype);
+}
+
+
+/* Return true if tree TYPE is struct, class or union. */
+
+static bool
+struct_class_union_p (tree type)
+{
+ return (TREE_CODE (type) == RECORD_TYPE
+ || TREE_CODE (type) == UNION_TYPE
+ || TREE_CODE (type) == QUAL_UNION_TYPE);
+}
+
+
+
+/* Keep data during a search for an aliasing site.
+ RHS = object or pointer aliased. No LHS is specified because we are only
+ looking in the UseDef paths of a given variable, so LHS will always be
+ an SSA name of the same variable.
+ When IS_RHS_POINTER = true, we are looking for ... = RHS. Otherwise,
+ we are looking for ... = &RHS.
+ SITE is the output of a search, non-NULL if the search succeeded. */
+
+struct alias_match
+{
+ tree rhs;
+ bool is_rhs_pointer;
+ tree site;
+};
+
+
+/* Callback for find_alias_site. Return true if the right hand site
+ of STMT matches DATA. */
+
+static bool
+find_alias_site_helper (tree var ATTRIBUTE_UNUSED, tree stmt, void *data)
+{
+ struct alias_match *match = (struct alias_match *) data;
+ tree rhs_pointer = get_rhs (stmt);
+ tree to_match = NULL_TREE;
+
+ while (TREE_CODE (rhs_pointer) == NOP_EXPR
+ || TREE_CODE (rhs_pointer) == CONVERT_EXPR
+ || TREE_CODE (rhs_pointer) == VIEW_CONVERT_EXPR)
+ rhs_pointer = TREE_OPERAND (rhs_pointer, 0);
+
+ if (!rhs_pointer)
+ /* Not a type conversion. */
+ return false;
+
+ if (TREE_CODE (rhs_pointer) == ADDR_EXPR && !match->is_rhs_pointer)
+ to_match = TREE_OPERAND (rhs_pointer, 0);
+ else if (POINTER_TYPE_P (rhs_pointer) && match->is_rhs_pointer)
+ to_match = rhs_pointer;
+
+ if (to_match != match->rhs)
+ /* Type conversion, but not a name match. */
+ return false;
+
+ /* Found it. */
+ match->site = stmt;
+ return true;
+}
+
+
+/* Find the statement where OBJECT1 gets aliased to OBJECT2.
+ If IS_PTR2 is true, consider OBJECT2 to be the name of a pointer or
+ reference rather than the actual aliased object.
+ For now, just implement the case where OBJECT1 is an SSA name defined
+ by a PHI statement. */
+
+static tree
+find_alias_site (tree object1, bool is_ptr1 ATTRIBUTE_UNUSED,
+ tree object2, bool is_ptr2)
+{
+ struct alias_match match;
+
+ match.rhs = object2;
+ match.is_rhs_pointer = is_ptr2;
+ match.site = NULL_TREE;
+
+ if (TREE_CODE (object1) != SSA_NAME)
+ return NULL_TREE;
+
+ walk_use_def_chains (object1, find_alias_site_helper, &match, false);
+ return match.site;
+}
+
+
+/* Structure to store temporary results when trying to figure out whether
+ an object is referenced. Just its presence in the text is not enough,
+ as we may just be taking its address. */
+
+struct match_info
+{
+ tree object;
+ bool is_ptr;
+ /* The difference between the number of references to OBJECT
+ and the number of occurences of &OBJECT. */
+ int found;
+};
+
+
+/* Return the base if EXPR is an SSA name. Return EXPR otherwise. */
+
+static tree
+get_ssa_base (tree expr)
+{
+ if (TREE_CODE (expr) == SSA_NAME)
+ return SSA_NAME_VAR (expr);
+ else
+ return expr;
+}
+
+
+/* Record references to objects and pointer dereferences across some piece of
+ code. The number of references is recorded for each item.
+ References to an object just to take its address are not counted.
+ For instance, if PTR is a pointer and OBJ is an object:
+ 1. Expression &obj + *ptr will have the following reference match structure:
+ ptrs: <ptr, 1>
+ objs: <ptr, 1>
+ OBJ does not appear as referenced because we just take its address.
+ 2. Expression ptr + *ptr will have the following reference match structure:
+ ptrs: <ptr, 1>
+ objs: <ptr, 2>
+ PTR shows up twice as an object, but is dereferenced only once.
+
+ The elements of the hash tables are tree_map objects. */
+struct reference_matches
+{
+ htab_t ptrs;
+ htab_t objs;
+};
+
+
+/* Return the match, if any. Otherwise, return NULL_TREE. It will
+ return NULL_TREE even when a match was found, if the value associated
+ to KEY is NULL_TREE. */
+
+static inline tree
+match (htab_t ref_map, tree key)
+{
+ struct tree_map to_find;
+ struct tree_map *found;
+ void **slot = NULL;
+
+ to_find.from = key;
+ to_find.hash = htab_hash_pointer (key);
+ slot = htab_find_slot (ref_map, &to_find, NO_INSERT);
+
+ if (!slot)
+ return NULL_TREE;
+
+ found = (struct tree_map *) *slot;
+ return found->to;
+}
+
+
+/* Set the entry corresponding to KEY, but only if the entry
+ already exists and its value is NULL_TREE. Otherwise, do nothing. */
+
+static inline void
+maybe_add_match (htab_t ref_map, struct tree_map *key)
+{
+ struct tree_map *found = htab_find (ref_map, key);
+
+ if (found && !found->to)
+ found->to = key->to;
+}
+
+
+/* Add an entry to HT, with key T and value NULL_TREE. */
+
+static void
+add_key (htab_t ht, tree t, alloc_pool references_pool)
+{
+ void **slot;
+ struct tree_map *tp = pool_alloc (references_pool);
+
+ tp->from = t;
+ tp->to = NULL_TREE;
+ tp->hash = htab_hash_pointer(tp->from);
+
+ slot = htab_find_slot (ht, tp, INSERT);
+ *slot = (void *) tp;
+}
+
+
+/* Some memory to keep the objects in the reference table. */
+
+static alloc_pool ref_table_alloc_pool = NULL;
+
+
+/* Get some memory to keep the objects in the reference table. */
+
+static inline alloc_pool
+reference_table_alloc_pool (bool build)
+{
+ if (ref_table_alloc_pool || !build)
+ return ref_table_alloc_pool;
+
+ ref_table_alloc_pool =
+ create_alloc_pool ("ref_table_alloc_pool", sizeof (struct tree_map), 20);
+
+ return ref_table_alloc_pool;
+}
+
+
+/* Initialize the reference table by adding all pointers in the points-to
+ table as keys, and NULL_TREE as associated values. */
+
+static struct reference_matches *
+build_reference_table (void)
+{
+ unsigned int i;
+ struct reference_matches *ref_table = NULL;
+ alloc_pool references_pool = reference_table_alloc_pool (true);
+
+ ref_table = XNEW (struct reference_matches);
+ ref_table->objs = htab_create (10, tree_map_hash, tree_map_eq, NULL);
+ ref_table->ptrs = htab_create (10, tree_map_hash, tree_map_eq, NULL);
+
+ for (i = 1; i < num_ssa_names; i++)
+ {
+ tree ptr = ssa_name (i);
+ struct ptr_info_def *pi;
+
+ if (ptr == NULL_TREE)
+ continue;
+
+ pi = SSA_NAME_PTR_INFO (ptr);
+
+ if (!SSA_NAME_IN_FREE_LIST (ptr) && pi && pi->name_mem_tag)
+ {
+ /* Add pointer to the interesting dereference list. */
+ add_key (ref_table->ptrs, ptr, references_pool);
+
+ /* Add all aliased names to the interesting reference list. */
+ if (pi->pt_vars)
+ {
+ unsigned ix;
+ bitmap_iterator bi;
+
+ EXECUTE_IF_SET_IN_BITMAP (pi->pt_vars, 0, ix, bi)
+ {
+ tree alias = referenced_var (ix);
+ add_key (ref_table->objs, alias, references_pool);
+ }
+ }
+ }
+ }
+
+ return ref_table;
+}
+
+
+/* Reference table. */
+
+static struct reference_matches *ref_table = NULL;
+
+
+/* Clean up the reference table if allocated. */
+
+static void
+maybe_free_reference_table (void)
+{
+ if (ref_table)
+ {
+ htab_delete (ref_table->ptrs);
+ htab_delete (ref_table->objs);
+ free (ref_table);
+ ref_table = NULL;
+ }
+
+ if (ref_table_alloc_pool)
+ {
+ free_alloc_pool (ref_table_alloc_pool);
+ ref_table_alloc_pool = NULL;
+ }
+}
+
+
+/* Get the reference table. Initialize it if needed. */
+
+static inline struct reference_matches *
+reference_table (bool build)
+{
+ if (ref_table || !build)
+ return ref_table;
+
+ ref_table = build_reference_table ();
+ find_references_in_function ();
+ return ref_table;
+}
+
+
+/* Callback for find_references_in_function.
+ Check whether *TP is an object reference or pointer dereference for the
+ variables given in ((struct match_info*)DATA)->OBJS or
+ ((struct match_info*)DATA)->PTRS. The total number of references
+ is stored in the same structures. */
+
+static tree
+find_references_in_tree_helper (tree *tp,
+ int *walk_subtrees ATTRIBUTE_UNUSED,
+ void *data)
+{
+ struct tree_map match;
+ static int parent_tree_code = ERROR_MARK;
+
+ /* Do not report references just for the purpose of taking an address.
+ XXX: we rely on the fact that the tree walk is in preorder
+ and that ADDR_EXPR is not a leaf, thus cannot be carried over across
+ walks. */
+ if (parent_tree_code == ADDR_EXPR)
+ goto finish;
+
+ match.to = (tree) data;
+
+ if (TREE_CODE (*tp) == INDIRECT_REF)
+ {
+ match.from = TREE_OPERAND (*tp, 0);
+ match.hash = htab_hash_pointer (match.from);
+ maybe_add_match (reference_table (true)->ptrs, &match);
+ }
+ else
+ {
+ match.from = *tp;
+ match.hash = htab_hash_pointer (match.from);
+ maybe_add_match (reference_table (true)->objs, &match);
+ }
+
+finish:
+ parent_tree_code = TREE_CODE (*tp);
+ return NULL_TREE;
+}
+
+
+/* Find all the references to aliased variables in the current function. */
+
+static void
+find_references_in_function (void)
+{
+ basic_block bb;
+ block_stmt_iterator i;
+
+ FOR_EACH_BB (bb)
+ for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
+ walk_tree (bsi_stmt_ptr (i), find_references_in_tree_helper,
+ (void *) *bsi_stmt_ptr (i), NULL);
+}
+
+
+/* Find the reference site for OBJECT.
+ If IS_PTR is true, look for derferences of OBJECT instead.
+ XXX: only the first site is returned in the current
+ implementation. If there are no matching sites, return NULL_TREE. */
+
+static tree
+reference_site (tree object, bool is_ptr)
+{
+ if (is_ptr)
+ return match (reference_table (true)->ptrs, object);
+ else
+ return match (reference_table (true)->objs, object);
+}
+
+
+/* Try to get more location info when something is missing.
+ OBJECT1 and OBJECT2 are aliased names. If IS_PTR1 or IS_PTR2, the alias
+ is on the memory referenced or pointed to by OBJECT1 and OBJECT2.
+ ALIAS_SITE, DEREF_SITE1 and DEREF_SITE2 are the statements where the
+ alias takes place (some pointer assignment usually) and where the
+ alias is referenced through OBJECT1 and OBJECT2 respectively.
+ REF_TYPE1 and REF_TYPE2 will return the type of the reference at the
+ respective sites. Only the first matching reference is returned for
+ each name. If no statement is found, the function header is returned. */
+
+static void
+maybe_find_missing_stmts (tree object1, bool is_ptr1,
+ tree object2, bool is_ptr2,
+ tree *alias_site,
+ tree *deref_site1,
+ tree *deref_site2)
+{
+ if (object1 && object2)
+ {
+ if (!*alias_site || !EXPR_HAS_LOCATION (*alias_site))
+ *alias_site = find_alias_site (object1, is_ptr1, object2, is_ptr2);
+
+ if (!*deref_site1 || !EXPR_HAS_LOCATION (*deref_site1))
+ *deref_site1 = reference_site (object1, is_ptr1);
+
+ if (!*deref_site2 || !EXPR_HAS_LOCATION (*deref_site2))
+ *deref_site2 = reference_site (object2, is_ptr2);
+ }
+
+ /* If we could not find the alias site, set it to one of the dereference
+ sites, if available. */
+ if (!*alias_site)
+ {
+ if (*deref_site1)
+ *alias_site = *deref_site1;
+ else if (*deref_site2)
+ *alias_site = *deref_site2;
+ }
+
+ /* If we could not find the dereference sites, set them to the alias site,
+ if known. */
+ if (!*deref_site1 && *alias_site)
+ *deref_site1 = *alias_site;
+ if (!*deref_site2 && *alias_site)
+ *deref_site2 = *alias_site;
+}
+
+
+/* Callback for find_first_artificial_name.
+ Find out if there are no artificial names at tree node *T. */
+
+static tree
+ffan_walker (tree *t,
+ int *go_below ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED)
+{
+ if (TREE_CODE (*t) == VAR_DECL || TREE_CODE (*t) == PARM_DECL)
+ if (DECL_ARTIFICIAL (*t))
+ return *t;
+
+ return NULL_TREE;
+}
+
+/* Return the first artificial name within EXPR, or NULL_TREE if
+ none exists. */
+
+static tree
+find_first_artificial_name (tree expr)
+{
+ return walk_tree_without_duplicates (&expr, ffan_walker, NULL);
+}
+
+
+/* Get a name from the original program for VAR. */
+
+static const char *
+get_var_name (tree var)
+{
+ if (TREE_CODE (var) == SSA_NAME)
+ return get_var_name (get_ssa_base (var));
+
+ if (find_first_artificial_name (var))
+ return "{unknown}";
+
+ if (TREE_CODE (var) == VAR_DECL || TREE_CODE (var) == PARM_DECL)
+ if (DECL_NAME (var))
+ return IDENTIFIER_POINTER (DECL_NAME (var));
+
+ return "{unknown}";
+}
+
+
+/* Return true if VAR contains an artificial name. */
+
+static bool
+contains_artificial_name_p (tree var)
+{
+ if (TREE_CODE (var) == SSA_NAME)
+ return contains_artificial_name_p (get_ssa_base (var));
+
+ return find_first_artificial_name (var) != NULL_TREE;
+}
+
+
+/* Return "*" if OBJECT is not the actual alias but a pointer to it, or
+ "" otherwise.
+ IS_PTR is true when OBJECT is not the actual alias.
+ In addition to checking IS_PTR, we also make sure that OBJECT is a pointer
+ since IS_PTR would also be true for C++ references, but we should only
+ print a * before a pointer and not before a reference. */
+
+static const char *
+get_maybe_star_prefix (tree object, bool is_ptr)
+{
+ gcc_assert (object);
+ return (is_ptr
+ && TREE_CODE (TREE_TYPE (object)) == POINTER_TYPE) ? "*" : "";
+}
+
+
+/* Callback for contains_node_type_p.
+ Returns true if *T has tree code *(int*)DATA. */
+
+static tree
+contains_node_type_p_callback (tree *t,
+ int *go_below ATTRIBUTE_UNUSED,
+ void *data)
+{
+ return ((int) TREE_CODE (*t) == *((int *) data)) ? *t : NULL_TREE;
+}
+
+
+/* Return true if T contains a node with tree code TYPE. */
+
+static bool
+contains_node_type_p (tree t, int type)
+{
+ return (walk_tree_without_duplicates (&t, contains_node_type_p_callback,
+ (void *) &type)
+ != NULL_TREE);
+}
+
+
+/* Return true if a warning was issued in the front end at STMT. */
+
+static bool
+already_warned_in_frontend_p (tree stmt)
+{
+ tree rhs_pointer;
+
+ if (stmt == NULL_TREE)
+ return false;
+
+ rhs_pointer = get_rhs (stmt);
+
+ if ((TREE_CODE (rhs_pointer) == NOP_EXPR
+ || TREE_CODE (rhs_pointer) == CONVERT_EXPR
+ || TREE_CODE (rhs_pointer) == VIEW_CONVERT_EXPR)
+ && TREE_NO_WARNING (rhs_pointer))
+ return true;
+ else
+ return false;
+}
+
+
+/* Return true if and only if TYPE is a function or method pointer type,
+ or pointer to a pointer to ... to a function or method. */
+
+static bool
+is_method_pointer (tree type)
+{
+ while (TREE_CODE (type) == POINTER_TYPE)
+ type = TREE_TYPE (type);
+ return TREE_CODE (type) == METHOD_TYPE || TREE_CODE (type) == FUNCTION_TYPE;
+}
+
+
+/* Issue a -Wstrict-aliasing warning.
+ OBJECT1 and OBJECT2 are aliased names.
+ If IS_PTR1 and/or IS_PTR2 is true, then the corresponding name
+ OBJECT1/OBJECT2 is a pointer or reference to the aliased memory,
+ rather than actual storage.
+ ALIAS_SITE is a statement where the alias took place. In the most common
+ case, that is where a pointer was assigned to the address of an object. */
+
+static bool
+strict_aliasing_warn (tree alias_site,
+ tree object1, bool is_ptr1,
+ tree object2, bool is_ptr2,
+ bool filter_artificials)
+{
+ tree ref_site1 = NULL_TREE;
+ tree ref_site2 = NULL_TREE;
+ const char *name1;
+ const char *name2;
+ location_t alias_loc;
+ location_t ref1_loc;
+ location_t ref2_loc;
+ gcc_assert (object1);
+ gcc_assert (object2);
+
+ if (contains_artificial_name_p (object1)
+ || contains_artificial_name_p (object2))
+ return false;
+
+ name1 = get_var_name (object1);
+ name2 = get_var_name (object2);
+
+ if (is_method_pointer (get_main_type (TREE_TYPE (object2))))
+ return false;
+
+ maybe_find_missing_stmts (object1, is_ptr1, object2, is_ptr2, &alias_site,
+ &ref_site1, &ref_site2);
+
+ if (!alias_site)
+ return false;
+
+ if (EXPR_HAS_LOCATION (alias_site))
+ alias_loc = EXPR_LOCATION (alias_site);
+ else
+ return false;
+
+ if (EXPR_HAS_LOCATION (ref_site1))
+ ref1_loc = EXPR_LOCATION (ref_site1);
+ else
+ ref1_loc = alias_loc;
+
+ if (EXPR_HAS_LOCATION (ref_site2))
+ ref2_loc = EXPR_LOCATION (ref_site2);
+ else
+ ref2_loc = alias_loc;
+
+ if (already_warned_in_frontend_p (alias_site))
+ return false;
+
+ /* If they are not SSA names, but contain SSA names, drop the warning
+ because it cannot be displayed well.
+ Also drop it if they both contain artificials.
+ XXX: this is a hack, must figure out a better way to display them. */
+ if (filter_artificials)
+ if ((find_first_artificial_name (get_ssa_base (object1))
+ && find_first_artificial_name (get_ssa_base (object2)))
+ || (TREE_CODE (object1) != SSA_NAME
+ && contains_node_type_p (object1, SSA_NAME))
+ || (TREE_CODE (object2) != SSA_NAME
+ && contains_node_type_p (object2, SSA_NAME)))
+ return false;
+
+ /* XXX: In the following format string, %s:%d should be replaced by %H.
+ However, in my tests only the first %H printed ok, while the
+ second and third were printed as blanks. */
+ warning (OPT_Wstrict_aliasing,
+ "%Hlikely type-punning may break strict-aliasing rules: "
+ "object %<%s%s%> of main type %qT is referenced at or around "
+ "%s:%d and may be "
+ "aliased to object %<%s%s%> of main type %qT which is referenced "
+ "at or around %s:%d.",
+ &alias_loc,
+ get_maybe_star_prefix (object1, is_ptr1),
+ name1, get_otype (object1, is_ptr1),
+ LOCATION_FILE (ref1_loc), LOCATION_LINE (ref1_loc),
+ get_maybe_star_prefix (object2, is_ptr2),
+ name2, get_otype (object2, is_ptr2),
+ LOCATION_FILE (ref2_loc), LOCATION_LINE (ref2_loc));
+
+ return true;
+}
+
+
+
+/* Return true when any objects of TYPE1 and TYPE2 respectively
+ may not be aliased according to the language standard. */
+
+static bool
+nonstandard_alias_types_p (tree type1, tree type2)
+{
+ HOST_WIDE_INT set1;
+ HOST_WIDE_INT set2;
+
+ if (VOID_TYPE_P (type1) || VOID_TYPE_P (type2))
+ return false;
+
+ set1 = get_alias_set (type1);
+ set2 = get_alias_set (type2);
+ return !alias_sets_conflict_p (set1, set2);
+}
+
+
+
+/* Returns true if the given name is a struct field tag (SFT). */
+
+static bool
+struct_field_tag_p (tree var)
+{
+ return TREE_CODE (var) == STRUCT_FIELD_TAG;
+}
+
+
+/* Returns true when *PTR may not be aliased to ALIAS.
+ See C standard 6.5p7 and C++ standard 3.10p15.
+ If PTR_PTR is true, ALIAS represents a pointer or reference to the
+ aliased storage rather than its actual name. */
+
+static bool
+nonstandard_alias_p (tree ptr, tree alias, bool ptr_ptr)
+{
+ /* Find the types to compare. */
+ tree ptr_type = get_otype (ptr, true);
+ tree alias_type = get_otype (alias, ptr_ptr);
+
+ /* XXX: for now, say it's OK if the alias escapes.
+ Not sure this is needed in general, but otherwise GCC will not
+ bootstrap. */
+ if (var_ann (get_ssa_base (alias))->escape_mask != NO_ESCAPE)
+ return false;
+
+ /* XXX: don't get into structures for now. It brings much complication
+ and little benefit. */
+ if (struct_class_union_p (ptr_type) || struct_class_union_p (alias_type))
+ return false;
+
+ /* XXX: In 4.2.1, field resolution in alias is not as good as in pre-4.3
+ This fixes problems found during the backport, where a pointer to the
+ first field of a struct appears to be aliased to the whole struct. */
+ if (struct_field_tag_p (alias))
+ return false;
+
+ /* If they are both SSA names of artificials, let it go, the warning
+ is too confusing. */
+ if (find_first_artificial_name (ptr) && find_first_artificial_name (alias))
+ return false;
+
+ /* Compare the types. */
+ return nonstandard_alias_types_p (ptr_type, alias_type);
+}
+
+
+/* Return true when we should skip analysis for pointer PTR based on the
+ fact that their alias information *PI is not considered relevant. */
+
+static bool
+skip_this_pointer (tree ptr ATTRIBUTE_UNUSED, struct ptr_info_def *pi)
+{
+ /* If it is not dereferenced, it is not a problem (locally). */
+ if (!pi->is_dereferenced)
+ return true;
+
+ /* This would probably cause too many false positives. */
+ if (pi->value_escapes_p || pi->pt_anything)
+ return true;
+
+ return false;
+}
+
+
+/* Find aliasing to named objects for pointer PTR. */
+
+static void
+dsa_named_for (tree ptr)
+{
+ struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
+
+ if (pi)
+ {
+ if (skip_this_pointer (ptr, pi))
+ return;
+
+ /* For all the variables it could be aliased to. */
+ if (pi->pt_vars)
+ {
+ unsigned ix;
+ bitmap_iterator bi;
+
+ EXECUTE_IF_SET_IN_BITMAP (pi->pt_vars, 0, ix, bi)
+ {
+ tree alias = referenced_var (ix);
+
+ if (is_global_var (alias))
+ continue;
+
+ if (nonstandard_alias_p (ptr, alias, false))
+ strict_aliasing_warn (SSA_NAME_DEF_STMT (ptr),
+ ptr, true, alias, false, true);
+ }
+ }
+ }
+}
+
+
+/* Detect and report strict aliasing violation of named objects. */
+
+static void
+detect_strict_aliasing_named (void)
+{
+ unsigned int i;
+
+ for (i = 1; i < num_ssa_names; i++)
+ {
+ tree ptr = ssa_name (i);
+ struct ptr_info_def *pi;
+
+ if (ptr == NULL_TREE)
+ continue;
+
+ pi = SSA_NAME_PTR_INFO (ptr);
+
+ if (!SSA_NAME_IN_FREE_LIST (ptr) && pi && pi->name_mem_tag)
+ dsa_named_for (ptr);
+ }
+}
+
+
+/* Return false only the first time I see each instance of FUNC. */
+
+static bool
+processed_func_p (tree func)
+{
+ static htab_t seen = NULL;
+ void **slot;
+
+ if (!seen)
+ seen = htab_create (100, htab_hash_pointer, htab_eq_pointer, NULL);
+
+ slot = htab_find_slot (seen, func, INSERT);
+ gcc_assert (slot);
+
+ if (*slot)
+ return true;
+
+ *slot = func;
+ return false;
+}
+
+
+/* Detect and warn about type-punning using points-to information. */
+
+void
+strict_aliasing_warning_backend (void)
+{
+ if (!(flag_strict_aliasing
+ && warn_strict_aliasing == 3
+ && !processed_func_p (current_function_decl)))
+ return;
+
+ detect_strict_aliasing_named ();
+ maybe_free_reference_table ();
+}
diff --git a/contrib/gcc/tree-ssa-alias.c b/contrib/gcc/tree-ssa-alias.c
index 04c45ebd..c700733 100644
--- a/contrib/gcc/tree-ssa-alias.c
+++ b/contrib/gcc/tree-ssa-alias.c
@@ -652,7 +652,7 @@ static unsigned int
compute_may_aliases (void)
{
struct alias_info *ai;
-
+
memset (&alias_stats, 0, sizeof (alias_stats));
/* Initialize aliasing information. */
@@ -710,6 +710,9 @@ compute_may_aliases (void)
dump_alias_info (dump_file);
}
+ /* Report strict aliasing violations. */
+ strict_aliasing_warning_backend ();
+
/* Deallocate memory used by aliasing data structures. */
delete_alias_info (ai);
diff --git a/contrib/gcc/tree-ssa-propagate.c b/contrib/gcc/tree-ssa-propagate.c
index e085911..1a8a614 100644
--- a/contrib/gcc/tree-ssa-propagate.c
+++ b/contrib/gcc/tree-ssa-propagate.c
@@ -1,5 +1,5 @@
/* Generic SSA value propagation engine.
- Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@redhat.com>
This file is part of GCC.
@@ -176,6 +176,8 @@ cfg_blocks_empty_p (void)
static void
cfg_blocks_add (basic_block bb)
{
+ bool head = false;
+
gcc_assert (bb != ENTRY_BLOCK_PTR && bb != EXIT_BLOCK_PTR);
gcc_assert (!TEST_BIT (bb_in_list, bb->index));
@@ -198,12 +200,26 @@ cfg_blocks_add (basic_block bb)
cfg_blocks_head = 0;
VEC_safe_grow (basic_block, heap, cfg_blocks, 2 * cfg_blocks_tail);
}
- else
+ /* Minor optimization: we prefer to see blocks with more
+ predecessors later, because there is more of a chance that
+ the incoming edges will be executable. */
+ else if (EDGE_COUNT (bb->preds)
+ >= EDGE_COUNT (VEC_index (basic_block, cfg_blocks,
+ cfg_blocks_head)->preds))
cfg_blocks_tail = ((cfg_blocks_tail + 1)
% VEC_length (basic_block, cfg_blocks));
+ else
+ {
+ if (cfg_blocks_head == 0)
+ cfg_blocks_head = VEC_length (basic_block, cfg_blocks);
+ --cfg_blocks_head;
+ head = true;
+ }
}
- VEC_replace (basic_block, cfg_blocks, cfg_blocks_tail, bb);
+ VEC_replace (basic_block, cfg_blocks,
+ head ? cfg_blocks_head : cfg_blocks_tail,
+ bb);
SET_BIT (bb_in_list, bb->index);
}
diff --git a/contrib/gcc/tree-vrp.c b/contrib/gcc/tree-vrp.c
index 4626485..f97bd61 100644
--- a/contrib/gcc/tree-vrp.c
+++ b/contrib/gcc/tree-vrp.c
@@ -2509,12 +2509,18 @@ adjust_range_with_scev (value_range_t *vr, struct loop *loop, tree stmt,
true))
return;
+ type = TREE_TYPE (var);
+
+ /* If we see a pointer type starting at a constant, then we have an
+ unusual ivopt. It may legitimately wrap. */
+ if (POINTER_TYPE_P (type) && is_gimple_min_invariant (init))
+ return;
+
/* We use TYPE_MIN_VALUE and TYPE_MAX_VALUE here instead of
negative_overflow_infinity and positive_overflow_infinity,
because we have concluded that the loop probably does not
wrap. */
- type = TREE_TYPE (var);
if (POINTER_TYPE_P (type) || !TYPE_MIN_VALUE (type))
tmin = lower_bound_in_type (type, type);
else
@@ -4914,7 +4920,7 @@ simplify_div_or_mod_using_ranges (tree stmt, tree rhs, enum tree_code rhs_code)
{
bool sop = false;
- val = compare_range_with_value (GT_EXPR, vr, integer_zero_node, &sop);
+ val = compare_range_with_value (GE_EXPR, vr, integer_zero_node, &sop);
if (val
&& sop
diff --git a/contrib/gcc/tree.c b/contrib/gcc/tree.c
index a4f0616..8e0b801 100644
--- a/contrib/gcc/tree.c
+++ b/contrib/gcc/tree.c
@@ -541,9 +541,13 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
DECL_IN_SYSTEM_HEADER (t) = in_system_header;
if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
{
- if (code != FUNCTION_DECL)
+ if (code == FUNCTION_DECL)
+ {
+ DECL_ALIGN (t) = FUNCTION_BOUNDARY;
+ DECL_MODE (t) = FUNCTION_MODE;
+ }
+ else
DECL_ALIGN (t) = 1;
- DECL_USER_ALIGN (t) = 0;
/* We have not yet computed the alias set for this declaration. */
DECL_POINTER_ALIAS_SET (t) = -1;
}
@@ -1881,14 +1885,13 @@ expr_align (tree t)
align1 = expr_align (TREE_OPERAND (t, 2));
return MIN (align0, align1);
+ /* FIXME: LABEL_DECL and CONST_DECL never have DECL_ALIGN set
+ meaningfully, it's always 1. */
case LABEL_DECL: case CONST_DECL:
case VAR_DECL: case PARM_DECL: case RESULT_DECL:
- if (DECL_ALIGN (t) != 0)
- return DECL_ALIGN (t);
- break;
-
case FUNCTION_DECL:
- return FUNCTION_BOUNDARY;
+ gcc_assert (DECL_ALIGN (t) != 0);
+ return DECL_ALIGN (t);
default:
break;
@@ -3174,8 +3177,6 @@ build_decl_stat (enum tree_code code, tree name, tree type MEM_STAT_DECL)
if (code == VAR_DECL || code == PARM_DECL || code == RESULT_DECL)
layout_decl (t, 0);
- else if (code == FUNCTION_DECL)
- DECL_MODE (t) = FUNCTION_MODE;
return t;
}
@@ -6044,41 +6045,48 @@ clean_symbol_name (char *p)
*p = '_';
}
-/* Generate a name for a function unique to this translation unit.
+/* Generate a name for a special-purpose function function.
+ The generated name may need to be unique across the whole link.
TYPE is some string to identify the purpose of this function to the
- linker or collect2. */
+ linker or collect2; it must start with an uppercase letter,
+ one of:
+ I - for constructors
+ D - for destructors
+ N - for C++ anonymous namespaces
+ F - for DWARF unwind frame information. */
tree
-get_file_function_name_long (const char *type)
+get_file_function_name (const char *type)
{
char *buf;
const char *p;
char *q;
+ /* If we already have a name we know to be unique, just use that. */
if (first_global_object_name)
+ p = first_global_object_name;
+ /* If the target is handling the constructors/destructors, they
+ will be local to this file and the name is only necessary for
+ debugging purposes. */
+ else if ((type[0] == 'I' || type[0] == 'D') && targetm.have_ctors_dtors)
{
- p = first_global_object_name;
-
- /* For type 'F', the generated name must be unique not only to this
- translation unit but also to any given link. Since global names
- can be overloaded, we concatenate the first global object name
- with a string derived from the file name of this object. */
- if (!strcmp (type, "F"))
- {
- const char *file = main_input_filename;
-
- if (! file)
- file = input_filename;
-
- q = alloca (strlen (p) + 10);
- sprintf (q, "%s_%08X", p, crc32_string (0, file));
-
- p = q;
- }
+ const char *file = main_input_filename;
+ if (! file)
+ file = input_filename;
+ /* Just use the file's basename, because the full pathname
+ might be quite long. */
+ p = strrchr (file, '/');
+ if (p)
+ p++;
+ else
+ p = file;
+ p = q = ASTRDUP (p);
+ clean_symbol_name (q);
}
else
{
- /* We don't have anything that we know to be unique to this translation
+ /* Otherwise, the name must be unique across the entire link.
+ We don't have anything that we know to be unique to this translation
unit, so use what we do have and throw in some randomness. */
unsigned len;
const char *name = weak_global_object_name;
@@ -6110,20 +6118,6 @@ get_file_function_name_long (const char *type)
return get_identifier (buf);
}
-
-/* If KIND=='I', return a suitable global initializer (constructor) name.
- If KIND=='D', return a suitable global clean-up (destructor) name. */
-
-tree
-get_file_function_name (int kind)
-{
- char p[2];
-
- p[0] = kind;
- p[1] = 0;
-
- return get_file_function_name_long (p);
-}
#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
@@ -6585,6 +6579,10 @@ build_common_tree_nodes_2 (int short_double)
long_double_ptr_type_node = build_pointer_type (long_double_type_node);
integer_ptr_type_node = build_pointer_type (integer_type_node);
+ /* Fixed size integer types. */
+ uint32_type_node = build_nonstandard_integer_type (32, true);
+ uint64_type_node = build_nonstandard_integer_type (64, true);
+
/* Decimal float types. */
dfloat32_type_node = make_node (REAL_TYPE);
TYPE_PRECISION (dfloat32_type_node) = DECIMAL32_TYPE_SIZE;
diff --git a/contrib/gcc/tree.h b/contrib/gcc/tree.h
index 97090be..6cfc3d3 100644
--- a/contrib/gcc/tree.h
+++ b/contrib/gcc/tree.h
@@ -1084,6 +1084,11 @@ extern void omp_clause_range_check_failed (const tree, const char *, int,
#define TREE_OVERFLOW(NODE) (CST_CHECK (NODE)->common.public_flag)
+/* TREE_OVERFLOW can only be true for EXPR of CONSTANT_CLASS_P. */
+
+#define TREE_OVERFLOW_P(EXPR) \
+ (CONSTANT_CLASS_P (EXPR) && TREE_OVERFLOW (EXPR))
+
/* In a VAR_DECL, FUNCTION_DECL, NAMESPACE_DECL or TYPE_DECL,
nonzero means name is to be accessible from outside this module.
In an IDENTIFIER_NODE, nonzero means an external declaration
@@ -2421,13 +2426,11 @@ struct tree_struct_field_tag GTY(())
/* Likewise for the size in bytes. */
#define DECL_SIZE_UNIT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size_unit)
/* Holds the alignment required for the datum, in bits. */
-#define DECL_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.u1.a.align)
+#define DECL_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.align)
/* The alignment of NODE, in bytes. */
#define DECL_ALIGN_UNIT(NODE) (DECL_ALIGN (NODE) / BITS_PER_UNIT)
-/* For FIELD_DECLs, off_align holds the number of low-order bits of
- DECL_FIELD_OFFSET which are known to be always zero.
- DECL_OFFSET_ALIGN thus returns the alignment that DECL_FIELD_OFFSET
- has. */
+/* Set if the alignment of this DECL has been set by the user, for
+ example with an 'aligned' attribute. */
#define DECL_USER_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.user_align)
/* Holds the machine mode corresponding to the declaration of a variable or
field. Always equal to TYPE_MODE (TREE_TYPE (decl)) except for a
@@ -2438,7 +2441,8 @@ struct tree_struct_field_tag GTY(())
operation it is. Note, however, that this field is overloaded, with
DECL_BUILT_IN_CLASS as the discriminant, so the latter must always be
checked before any access to the former. */
-#define DECL_FUNCTION_CODE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_common.u1.f)
+#define DECL_FUNCTION_CODE(NODE) \
+ (FUNCTION_DECL_CHECK (NODE)->function_decl.function_code)
#define DECL_DEBUG_EXPR_IS_FROM(NODE) \
(DECL_COMMON_CHECK (NODE)->decl_common.debug_expr_is_from)
@@ -2576,20 +2580,9 @@ struct tree_decl_common GTY(())
unsigned gimple_reg_flag : 1;
unsigned call_clobbered_flag : 1;
- union tree_decl_u1 {
- /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is
- DECL_FUNCTION_CODE. */
- enum built_in_function f;
- /* In a FUNCTION_DECL for which DECL_BUILT_IN does not hold, this
- is used by language-dependent code. */
- HOST_WIDE_INT i;
- /* DECL_ALIGN and DECL_OFFSET_ALIGN. (These are not used for
- FUNCTION_DECLs). */
- struct tree_decl_u1_a {
- unsigned int align : 24;
- unsigned int off_align : 8;
- } a;
- } GTY ((skip)) u1;
+ unsigned int align : 24;
+ /* DECL_OFFSET_ALIGN, used only for FIELD_DECLs. */
+ unsigned int off_align : 8;
tree size_unit;
tree initial;
@@ -2674,11 +2667,11 @@ struct tree_decl_with_rtl GTY(())
DECL_OFFSET_ALIGN thus returns the alignment that DECL_FIELD_OFFSET
has. */
#define DECL_OFFSET_ALIGN(NODE) \
- (((unsigned HOST_WIDE_INT)1) << FIELD_DECL_CHECK (NODE)->decl_common.u1.a.off_align)
+ (((unsigned HOST_WIDE_INT)1) << FIELD_DECL_CHECK (NODE)->decl_common.off_align)
/* Specify that DECL_ALIGN(NODE) is a multiple of X. */
#define SET_DECL_OFFSET_ALIGN(NODE, X) \
- (FIELD_DECL_CHECK (NODE)->decl_common.u1.a.off_align = exact_log2 ((X) & -(X)))
+ (FIELD_DECL_CHECK (NODE)->decl_common.off_align = exact_log2 ((X) & -(X)))
/* 1 if the alignment for this type was requested by "aligned" attribute,
0 if it is the default for this type. */
@@ -3091,6 +3084,10 @@ struct tree_function_decl GTY(())
{
struct tree_decl_non_common common;
+ /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is
+ DECL_FUNCTION_CODE. Otherwise unused. */
+ enum built_in_function function_code;
+
unsigned static_ctor_flag : 1;
unsigned static_dtor_flag : 1;
unsigned uninlinable : 1;
@@ -3240,6 +3237,9 @@ enum tree_index
TI_UINTDI_TYPE,
TI_UINTTI_TYPE,
+ TI_UINT32_TYPE,
+ TI_UINT64_TYPE,
+
TI_INTEGER_ZERO,
TI_INTEGER_ONE,
TI_INTEGER_MINUS_ONE,
@@ -3315,6 +3315,9 @@ extern GTY(()) tree global_trees[TI_MAX];
#define unsigned_intDI_type_node global_trees[TI_UINTDI_TYPE]
#define unsigned_intTI_type_node global_trees[TI_UINTTI_TYPE]
+#define uint32_type_node global_trees[TI_UINT32_TYPE]
+#define uint64_type_node global_trees[TI_UINT64_TYPE]
+
#define integer_zero_node global_trees[TI_INTEGER_ZERO]
#define integer_one_node global_trees[TI_INTEGER_ONE]
#define integer_minus_one_node global_trees[TI_INTEGER_MINUS_ONE]
@@ -4180,7 +4183,7 @@ extern GTY(()) const char * current_function_func_begin_label;
/* In tree.c */
extern unsigned crc32_string (unsigned, const char *);
extern void clean_symbol_name (char *);
-extern tree get_file_function_name_long (const char *);
+extern tree get_file_function_name (const char *);
extern tree get_callee_fndecl (tree);
extern void change_decl_assembler_name (tree, tree);
extern int type_num_arguments (tree);
@@ -4523,10 +4526,6 @@ extern void gimplify_function_tree (tree);
extern const char *get_name (tree);
extern tree unshare_expr (tree);
extern void sort_case_labels (tree);
-
-/* If KIND=='I', return a suitable global initializer (constructor) name.
- If KIND=='D', return a suitable global clean-up (destructor) name. */
-extern tree get_file_function_name (int);
/* Interface of the DWARF2 unwind info support. */
diff --git a/contrib/gcc/varasm.c b/contrib/gcc/varasm.c
index 21b6904..ef3a83a 100644
--- a/contrib/gcc/varasm.c
+++ b/contrib/gcc/varasm.c
@@ -1383,7 +1383,7 @@ assemble_start_function (tree decl, const char *fnname)
if (flag_reorder_blocks_and_partition)
{
switch_to_section (unlikely_text_section ());
- assemble_align (FUNCTION_BOUNDARY);
+ assemble_align (DECL_ALIGN (decl));
ASM_OUTPUT_LABEL (asm_out_file, cfun->cold_section_label);
/* When the function starts with a cold section, we need to explicitly
@@ -1393,7 +1393,7 @@ assemble_start_function (tree decl, const char *fnname)
&& BB_PARTITION (ENTRY_BLOCK_PTR->next_bb) == BB_COLD_PARTITION)
{
switch_to_section (text_section);
- assemble_align (FUNCTION_BOUNDARY);
+ assemble_align (DECL_ALIGN (decl));
ASM_OUTPUT_LABEL (asm_out_file, cfun->hot_section_label);
hot_label_written = true;
first_function_block_is_cold = true;
@@ -1424,18 +1424,17 @@ assemble_start_function (tree decl, const char *fnname)
ASM_OUTPUT_LABEL (asm_out_file, cfun->hot_section_label);
/* Tell assembler to move to target machine's alignment for functions. */
- align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT);
- if (align < force_align_functions_log)
- align = force_align_functions_log;
+ align = floor_log2 (DECL_ALIGN (decl) / BITS_PER_UNIT);
if (align > 0)
{
ASM_OUTPUT_ALIGN (asm_out_file, align);
}
/* Handle a user-specified function alignment.
- Note that we still need to align to FUNCTION_BOUNDARY, as above,
+ Note that we still need to align to DECL_ALIGN, as above,
because ASM_OUTPUT_MAX_SKIP_ALIGN might not do any alignment at all. */
- if (align_functions_log > align
+ if (! DECL_USER_ALIGN (decl)
+ && align_functions_log > align
&& cfun->function_frequency != FUNCTION_FREQUENCY_UNLIKELY_EXECUTED)
{
#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN
OpenPOWER on IntegriCloud