1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-14 14:55:41 +00:00

gcc: another round of merges from the gcc pre-43 branch.

Bring The following revisions from the gcc43 branch[1]:

118360, 118361, 118363, 118576, 119820,
123906, 125246, and 125721.

They all have in common that the were merged long ago
into Apple's gcc and should help improve the general
quality of the compiler and make it easier to bring
new features from Apple's gcc42.

For details please review the additions to the files:
gcc/ChangeLog.gcc43
gcc/cp/ChangeLog.gcc43 (new, adds previous revisions)

Reference:
[1] http://gcc.gnu.org/viewcvs/gcc/trunk/?pathrev=126700

Obtained from:	gcc pre4.3 (GPLv2) branch
MFC after:	3 weeks
This commit is contained in:
Pedro F. Giffuni 2013-11-21 16:38:57 +00:00
parent e941e1e94a
commit 2bd5e058b7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=258428
46 changed files with 804 additions and 428 deletions

View File

@ -10,6 +10,12 @@
* doc/extend.texi: Document the 0b-prefixed binary integer * doc/extend.texi: Document the 0b-prefixed binary integer
constant extension. constant extension.
2007-05-31 Eric Christopher <echristo@apple.com>
* 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-24 Richard Sandiford <rsandifo@nildram.co.uk> (r125037) 2007-05-24 Richard Sandiford <rsandifo@nildram.co.uk> (r125037)
* postreload-gcse.c (reg_changed_after_insn_p): New function. * postreload-gcse.c (reg_changed_after_insn_p): New function.
@ -99,6 +105,12 @@
(dwarf2out_imported_module_or_decl): Suppress struct debug (dwarf2out_imported_module_or_decl): Suppress struct debug
information using should_emit_struct_debug when appropriate. 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) 2007-04-12 Richard Guenther <rguenther@suse.de> (r123736)
PR tree-optimization/24689 PR tree-optimization/24689
@ -333,6 +345,28 @@
* doc/invoke.texi (Warning Options): Update -Wparentheses * doc/invoke.texi (Warning Options): Update -Wparentheses
description. 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) 2006-12-02 H.J. Lu <hongjiu.lu@intel.com> (r119454 - partial)
PR target/30040 PR target/30040
@ -371,6 +405,30 @@
(override_options): Add entries for Core2. (override_options): Add entries for Core2.
(ix86_issue_rate): Add case 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) 2006-10-31 Geoffrey Keating <geoffk@apple.com> (r118356)
* c-decl.c (grokdeclarator): Don't set DECL_EXTERNAL on * c-decl.c (grokdeclarator): Don't set DECL_EXTERNAL on
@ -521,3 +579,51 @@
* builtins.c (fold_builtin_classify): Fix typo. * 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.

View File

@ -822,7 +822,8 @@ REAL_H = real.h $(MACHMODE_H)
# IN_GCC distinguishes between code compiled into GCC itself and other # IN_GCC distinguishes between code compiled into GCC itself and other
# programs built during a bootstrap. # 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@ INTERNAL_CFLAGS = -DIN_GCC @CROSS@
# This is the variable actually used when we compile. If you change this, # This is the variable actually used when we compile. If you change this,

View File

@ -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_ULONGLONG, long_long_unsigned_type_node)
DEF_PRIMITIVE_TYPE (BT_INTMAX, intmax_type_node) DEF_PRIMITIVE_TYPE (BT_INTMAX, intmax_type_node)
DEF_PRIMITIVE_TYPE (BT_UINTMAX, uintmax_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_WORD, (*lang_hooks.types.type_for_mode) (word_mode, 0))
DEF_PRIMITIVE_TYPE (BT_FLOAT, float_type_node) DEF_PRIMITIVE_TYPE (BT_FLOAT, float_type_node)
DEF_PRIMITIVE_TYPE (BT_DOUBLE, double_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_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_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_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) 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_POINTER_TYPE (BT_PTR_FN_VOID_VAR, BT_FN_VOID_VAR)
DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE, DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE,
BT_PTR, BT_PTR_FN_VOID_VAR, BT_PTR, BT_SIZE) BT_PTR, BT_PTR_FN_VOID_VAR, BT_PTR, BT_SIZE)

View File

@ -4589,6 +4589,30 @@ expand_builtin_alloca (tree arglist, rtx target)
return result; 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. /* 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 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. function in-line. If convenient, the result should be placed in TARGET.
@ -5877,6 +5901,14 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
expand_stack_restore (TREE_VALUE (arglist)); expand_stack_restore (TREE_VALUE (arglist));
return const0_rtx; 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_INT_FN (BUILT_IN_FFS):
case BUILT_IN_FFSIMAX: case BUILT_IN_FFSIMAX:
target = expand_builtin_unop (target_mode, arglist, target, target = expand_builtin_unop (target_mode, arglist, target,
@ -7539,6 +7571,67 @@ fold_builtin_bitop (tree fndecl, tree arglist)
return NULL_TREE; 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. */ /* Return true if EXPR is the real constant contained in VALUE. */
static bool static bool
@ -9053,6 +9146,10 @@ fold_builtin_1 (tree fndecl, tree arglist, bool ignore)
CASE_FLT_FN (BUILT_IN_LLRINT): CASE_FLT_FN (BUILT_IN_LLRINT):
return fold_fixed_mathfn (fndecl, arglist); 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_FFS):
CASE_INT_FN (BUILT_IN_CLZ): CASE_INT_FN (BUILT_IN_CLZ):
CASE_INT_FN (BUILT_IN_CTZ): CASE_INT_FN (BUILT_IN_CTZ):

View File

@ -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, "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_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_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_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_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) DEF_GCC_BUILTIN (BUILT_IN_CLZ, "clz", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST)

View File

@ -1676,7 +1676,7 @@ cgraph_build_static_cdtor (char which, tree body, int priority)
tree decl, name, resdecl; tree decl, name, resdecl;
sprintf (which_buf, "%c_%d", which, counter++); 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, decl = build_decl (FUNCTION_DECL, name,
build_function_type (void_type_node, void_list_node)); build_function_type (void_type_node, void_list_node));

View File

@ -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 the utilities are not correct for a cross-compiler; we have to hope that
cross-versions are in the proper directories. */ cross-versions are in the proper directories. */
#ifdef CROSS_COMPILE #ifdef CROSS_DIRECTORY_STRUCTURE
#undef OBJECT_FORMAT_COFF #undef OBJECT_FORMAT_COFF
#undef MD_EXEC_PREFIX #undef MD_EXEC_PREFIX
#undef REAL_LD_FILE_NAME #undef REAL_LD_FILE_NAME
@ -553,7 +553,7 @@ is_ctor_dtor (const char *s)
static struct path_prefix cpath, path; 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 /* This is the name of the target machine. We use it to form the name
of the files to execute. */ 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 strip_suffix = "strip";
static const char *const gstrip_suffix = "gstrip"; 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 /* If we look for a program in the compiler directories, we just use
the short name, since these directories are already system-specific. the short name, since these directories are already system-specific.
But it we look for a program in the system directories, we need to But it we look for a program in the system directories, we need to
@ -775,7 +775,7 @@ main (int argc, char **argv)
#endif #endif
const char *const full_strip_suffix = strip_suffix; const char *const full_strip_suffix = strip_suffix;
const char *const full_gstrip_suffix = gstrip_suffix; const char *const full_gstrip_suffix = gstrip_suffix;
#endif /* CROSS_COMPILE */ #endif /* CROSS_DIRECTORY_STRUCTURE */
const char *arg; const char *arg;
FILE *outf; FILE *outf;
@ -957,7 +957,7 @@ main (int argc, char **argv)
c_file_name = getenv ("COLLECT_GCC"); c_file_name = getenv ("COLLECT_GCC");
if (c_file_name == 0) if (c_file_name == 0)
{ {
#ifdef CROSS_COMPILE #ifdef CROSS_DIRECTORY_STRUCTURE
c_file_name = concat (target_machine, "-gcc", NULL); c_file_name = concat (target_machine, "-gcc", NULL);
#else #else
c_file_name = "gcc"; c_file_name = "gcc";

View File

@ -135,7 +135,7 @@ Boston, MA 02110-1301, USA. */
for the BeOS include files relative to TOOL_INCLUDE_DIR. Yes, we for the BeOS include files relative to TOOL_INCLUDE_DIR. Yes, we
use ANSI string concatenation here (FIXME) */ use ANSI string concatenation here (FIXME) */
#ifndef CROSS_COMPILE #ifndef CROSS_DIRECTORY_STRUCTURE
#undef INCLUDE_DEFAULTS #undef INCLUDE_DEFAULTS
#define INCLUDE_DEFAULTS \ #define INCLUDE_DEFAULTS \
{ \ { \
@ -177,7 +177,7 @@ Boston, MA 02110-1301, USA. */
{ "/boot/develop/headers", 0, 0, 0 }, \ { "/boot/develop/headers", 0, 0, 0 }, \
{ 0, 0, 0, 0 } \ { 0, 0, 0, 0 } \
} }
#else /* CROSS_COMPILE */ #else /* CROSS_DIRECTORY_STRUCTURE */
#undef INCLUDE_DEFAULTS #undef INCLUDE_DEFAULTS
#define INCLUDE_DEFAULTS \ #define INCLUDE_DEFAULTS \
{ \ { \

View File

@ -146,7 +146,7 @@ char cygwin_tool_include_dir[sizeof (TOOL_INCLUDE_DIR) + 1
#undef TOOL_INCLUDE_DIR #undef TOOL_INCLUDE_DIR
#define TOOL_INCLUDE_DIR ((const char *) cygwin_tool_include_dir) #define TOOL_INCLUDE_DIR ((const char *) cygwin_tool_include_dir)
#ifndef CROSS_COMPILE #ifndef CROSS_DIRECTORY_STRUCTURE
#undef STANDARD_INCLUDE_DIR #undef STANDARD_INCLUDE_DIR
#define STANDARD_INCLUDE_DIR "/usr/include" #define STANDARD_INCLUDE_DIR "/usr/include"
char cygwin_standard_include_dir[sizeof (STANDARD_INCLUDE_DIR) + 1 char cygwin_standard_include_dir[sizeof (STANDARD_INCLUDE_DIR) + 1

View File

@ -1089,6 +1089,8 @@ const int x86_cmpxchg = ~m_386;
const int x86_cmpxchg8b = ~(m_386 | m_486); const int x86_cmpxchg8b = ~(m_386 | m_486);
/* Exchange and add was added for 80486. */ /* Exchange and add was added for 80486. */
const int x86_xadd = ~m_386; 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; const int x86_pad_returns = m_ATHLON_K8_AMDFAM10 | m_CORE2 | m_GENERIC;
/* In case the average insn count for single function invocation is /* In case the average insn count for single function invocation is

View File

@ -168,6 +168,7 @@ extern const int x86_use_bt;
extern const int x86_cmpxchg, x86_cmpxchg8b, x86_xadd; extern const int x86_cmpxchg, x86_cmpxchg8b, x86_xadd;
extern const int x86_use_incdec; extern const int x86_use_incdec;
extern const int x86_pad_returns; extern const int x86_pad_returns;
extern const int x86_bswap;
extern const int x86_partial_flag_reg_stall; extern const int x86_partial_flag_reg_stall;
extern int x86_prefetch_sse, x86_cmpxchg16b; 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_CMPXCHG8B (x86_cmpxchg8b & (1 << ix86_arch))
#define TARGET_CMPXCHG16B (x86_cmpxchg16b) #define TARGET_CMPXCHG16B (x86_cmpxchg16b)
#define TARGET_XADD (x86_xadd & (1 << ix86_arch)) #define TARGET_XADD (x86_xadd & (1 << ix86_arch))
#define TARGET_BSWAP (x86_bswap & (1 << ix86_arch))
#ifndef TARGET_64BIT_DEFAULT #ifndef TARGET_64BIT_DEFAULT
#define TARGET_64BIT_DEFAULT 0 #define TARGET_64BIT_DEFAULT 0

View File

@ -14718,6 +14718,24 @@
(set_attr "type" "bitmanip") (set_attr "type" "bitmanip")
(set_attr "mode" "SI")]) (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" (define_expand "clzdi2"
[(parallel [(parallel
[(set (match_operand:DI 0 "register_operand" "") [(set (match_operand:DI 0 "register_operand" "")

View File

@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA. */
#undef THREAD_MODEL_SPEC #undef THREAD_MODEL_SPEC
#define THREAD_MODEL_SPEC "posix" #define THREAD_MODEL_SPEC "posix"
#ifdef CROSS_COMPILE #ifdef CROSS_DIRECTORY_STRUCTURE
#define SYSROOT_SUFFIX_SPEC "x86" #define SYSROOT_SUFFIX_SPEC "x86"
#endif #endif

View File

@ -124,14 +124,14 @@
/* #define ASM_SPEC "-u %(asm_cpu)" */ /* #define ASM_SPEC "-u %(asm_cpu)" */
/* Default location of syscalls.exp under AIX */ /* Default location of syscalls.exp under AIX */
#ifndef CROSS_COMPILE #ifndef CROSS_DIRECTORY_STRUCTURE
#define LINK_SYSCALLS_SPEC "-bI:/lib/syscalls.exp" #define LINK_SYSCALLS_SPEC "-bI:/lib/syscalls.exp"
#else #else
#define LINK_SYSCALLS_SPEC "" #define LINK_SYSCALLS_SPEC ""
#endif #endif
/* Default location of libg.exp under AIX */ /* Default location of libg.exp under AIX */
#ifndef CROSS_COMPILE #ifndef CROSS_DIRECTORY_STRUCTURE
#define LINK_LIBG_SPEC "-bexport:/usr/lib/libg.exp" #define LINK_LIBG_SPEC "-bexport:/usr/lib/libg.exp"
#else #else
#define LINK_LIBG_SPEC "" #define LINK_LIBG_SPEC ""

View File

@ -634,7 +634,7 @@ extern int fixuplabelno;
%{profile: -p}" %{profile: -p}"
/* Don't put -Y P,<path> for cross compilers. */ /* Don't put -Y P,<path> for cross compilers. */
#ifndef CROSS_COMPILE #ifndef CROSS_DIRECTORY_STRUCTURE
#define LINK_PATH_SPEC "\ #define LINK_PATH_SPEC "\
%{!R*:%{L*:-R %*}} \ %{!R*:%{L*:-R %*}} \
%{!nostdlib: %{!YP,*: \ %{!nostdlib: %{!YP,*: \

View File

@ -84,7 +84,7 @@ Boston, MA 02110-1301, USA.
/* Under svr4, the normal location of the `ld' and `as' programs is the /* Under svr4, the normal location of the `ld' and `as' programs is the
/usr/ccs/bin directory. */ /usr/ccs/bin directory. */
#ifndef CROSS_COMPILE #ifndef CROSS_DIRECTORY_STRUCTURE
#undef MD_EXEC_PREFIX #undef MD_EXEC_PREFIX
#define MD_EXEC_PREFIX "/usr/ccs/bin/" #define MD_EXEC_PREFIX "/usr/ccs/bin/"
#endif #endif
@ -92,7 +92,7 @@ Boston, MA 02110-1301, USA.
/* Under svr4, the normal location of the various *crt*.o files is the /* Under svr4, the normal location of the various *crt*.o files is the
/usr/ccs/lib directory. */ /usr/ccs/lib directory. */
#ifndef CROSS_COMPILE #ifndef CROSS_DIRECTORY_STRUCTURE
#undef MD_STARTFILE_PREFIX #undef MD_STARTFILE_PREFIX
#define MD_STARTFILE_PREFIX "/usr/ccs/lib/" #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
#endif #endif
@ -136,7 +136,7 @@ Boston, MA 02110-1301, USA.
not being done. */ not being done. */
#undef LINK_SPEC #undef LINK_SPEC
#ifdef CROSS_COMPILE #ifdef CROSS_DIRECTORY_STRUCTURE
#define LINK_SPEC "%{h*} %{v:-V} \ #define LINK_SPEC "%{h*} %{v:-V} \
%{b} \ %{b} \
%{static:-dn -Bstatic} \ %{static:-dn -Bstatic} \

View File

@ -13151,7 +13151,8 @@ for f in $build_xm_file; do
esac esac
done 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. # Also use all.cross instead of all.internal and adjust SYSTEM_HEADER_DIR.
CROSS= CROSS=
ALL=all.internal ALL=all.internal
@ -13168,7 +13169,7 @@ fi
if test x$host != x$target if test x$host != x$target
then then
CROSS="-DCROSS_COMPILE" CROSS="-DCROSS_DIRECTORY_STRUCTURE"
ALL=all.cross ALL=all.cross
SYSTEM_HEADER_DIR=$build_system_header_dir SYSTEM_HEADER_DIR=$build_system_header_dir
case "$host","$target" in case "$host","$target" in

View File

@ -1729,7 +1729,8 @@ for f in $build_xm_file; do
esac esac
done 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. # Also use all.cross instead of all.internal and adjust SYSTEM_HEADER_DIR.
CROSS= AC_SUBST(CROSS) CROSS= AC_SUBST(CROSS)
ALL=all.internal AC_SUBST(ALL) ALL=all.internal AC_SUBST(ALL)
@ -1746,7 +1747,7 @@ fi
if test x$host != x$target if test x$host != x$target
then then
CROSS="-DCROSS_COMPILE" CROSS="-DCROSS_DIRECTORY_STRUCTURE"
ALL=all.cross ALL=all.cross
SYSTEM_HEADER_DIR=$build_system_header_dir SYSTEM_HEADER_DIR=$build_system_header_dir
case "$host","$target" in case "$host","$target" in

View File

@ -433,7 +433,7 @@ coverage_checksum_string (unsigned chksum, const char *string)
char *dup = NULL; char *dup = NULL;
/* Look for everything that looks if it were produced by /* 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 that may result from flag_random_seed. This is not critical
as the checksums are used only for sanity checking. */ as the checksums are used only for sanity checking. */
for (i = 0; string[i]; i++) for (i = 0; string[i]; i++)

View File

@ -0,0 +1,28 @@
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-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.
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.

View File

@ -1698,10 +1698,6 @@ determine_visibility (tree decl)
class can influence the visibility of the DECL. */ class can influence the visibility of the DECL. */
if (DECL_CLASS_SCOPE_P (decl)) if (DECL_CLASS_SCOPE_P (decl))
class_type = DECL_CONTEXT (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 else
{ {
/* Not a class member. */ /* Not a class member. */
@ -1787,7 +1783,8 @@ determine_visibility (tree decl)
{ {
/* Propagate anonymity from type to decl. */ /* Propagate anonymity from type to decl. */
int tvis = type_visibility (TREE_TYPE (decl)); int tvis = type_visibility (TREE_TYPE (decl));
if (tvis == VISIBILITY_ANON) if (tvis == VISIBILITY_ANON
|| ! DECL_VISIBILITY_SPECIFIED (decl))
constrain_visibility (decl, tvis); constrain_visibility (decl, tvis);
} }
} }
@ -2326,7 +2323,7 @@ start_objects (int method_type, int initp)
sprintf (type, "%c", method_type); sprintf (type, "%c", method_type);
fndecl = build_lang_decl (FUNCTION_DECL, fndecl = build_lang_decl (FUNCTION_DECL,
get_file_function_name_long (type), get_file_function_name (type),
build_function_type (void_type_node, build_function_type (void_type_node,
void_list_node)); void_list_node));
start_preparsed_function (fndecl, /*attrs=*/NULL_TREE, SF_PRE_PARSED); 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. */ to scan the object file to find its ctor/dtor routine. */
TREE_PUBLIC (current_function_decl) = ! targetm.have_ctors_dtors; 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. */ /* Mark this declaration as used to avoid spurious warnings. */
TREE_USED (current_function_decl) = 1; TREE_USED (current_function_decl) = 1;

View File

@ -61,6 +61,24 @@ tree global_namespace;
unit. */ unit. */
static GTY(()) tree anonymous_namespace_name; 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 /* 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 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) if (anon)
{ {
/* The name of anonymous namespace is unique for the translation name = get_anonymous_namespace_name();
unit. */
if (!anonymous_namespace_name)
anonymous_namespace_name = get_file_function_name ('N');
name = anonymous_namespace_name;
d = IDENTIFIER_NAMESPACE_VALUE (name); d = IDENTIFIER_NAMESPACE_VALUE (name);
if (d) if (d)
/* Reopening anonymous namespace. */ /* Reopening anonymous namespace. */

View File

@ -33,7 +33,7 @@ Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#define STANDARD_INCLUDE_COMPONENT 0 #define STANDARD_INCLUDE_COMPONENT 0
#endif #endif
#if defined (CROSS_COMPILE) && !defined (TARGET_SYSTEM_ROOT) #if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
# undef LOCAL_INCLUDE_DIR # undef LOCAL_INCLUDE_DIR
# undef SYSTEM_INCLUDE_DIR # undef SYSTEM_INCLUDE_DIR
# undef STANDARD_INCLUDE_DIR # undef STANDARD_INCLUDE_DIR

View File

@ -6146,6 +6146,16 @@ Similar to @code{__builtin_powi}, except the argument and return types
are @code{long double}. are @code{long double}.
@end deftypefn @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 @node Target Builtins
@section Built-in Functions Specific to Particular Target Machines @section Built-in Functions Specific to Particular Target Machines

View File

@ -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}. These functions return the number of bits set in @var{a}.
@end deftypefn @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 @node Soft float library routines
@section Routines for floating point emulation @section Routines for floating point emulation
@cindex soft float library @cindex soft float library
@ -728,4 +733,3 @@ document me!
@deftypefn {Runtime Function} void __clear_cache (char *@var{beg}, char *@var{end}) @deftypefn {Runtime Function} void __clear_cache (char *@var{beg}, char *@var{end})
This function clears the instruction cache between @var{beg} and @var{end}. This function clears the instruction cache between @var{beg} and @var{end}.
@end deftypefn @end deftypefn

View File

@ -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 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 integer of mode @var{m}. The mode of @var{x} will usually be an integer
mode. 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 @end table
@node Comparisons @node Comparisons

View File

@ -2030,7 +2030,7 @@ switch_to_eh_frame_section (void)
/* We have no special eh_frame section. Put the information in /* We have no special eh_frame section. Put the information in
the data section and emit special labels to guide collect2. */ the data section and emit special labels to guide collect2. */
switch_to_section (data_section); 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)); ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));
targetm.asm_out.globalize_label (asm_out_file, targetm.asm_out.globalize_label (asm_out_file,
IDENTIFIER_POINTER (label)); IDENTIFIER_POINTER (label));

View File

@ -361,6 +361,8 @@ convert_move (rtx to, rtx from, int unsignedp)
gcc_assert (to_real == from_real); 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 /* If the source and destination are already the same, then there's
nothing to do. */ nothing to do. */
@ -4440,6 +4442,11 @@ store_expr (tree exp, rtx target, int call_param_p)
temp = convert_to_mode (GET_MODE (target), temp, unsignedp); temp = convert_to_mode (GET_MODE (target), temp, unsignedp);
emit_move_insn (target, temp); 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 else
convert_move (target, temp, unsignedp); convert_move (target, temp, unsignedp);
} }

View File

@ -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_FFS):
CASE_INT_FN (BUILT_IN_PARITY): CASE_INT_FN (BUILT_IN_PARITY):
CASE_INT_FN (BUILT_IN_POPCOUNT): CASE_INT_FN (BUILT_IN_POPCOUNT):
case BUILT_IN_BSWAP32:
case BUILT_IN_BSWAP64:
/* Always true. */ /* Always true. */
return 1; return 1;

View File

@ -240,7 +240,7 @@ static const char *spec_machine = DEFAULT_TARGET_MACHINE;
/* Nonzero if cross-compiling. /* Nonzero if cross-compiling.
When -b is used, the value comes from the `specs' file. */ When -b is used, the value comes from the `specs' file. */
#ifdef CROSS_COMPILE #ifdef CROSS_DIRECTORY_STRUCTURE
static const char *cross_compile = "1"; static const char *cross_compile = "1";
#else #else
static const char *cross_compile = "0"; static const char *cross_compile = "0";
@ -1469,7 +1469,7 @@ static const char *gcc_libexec_prefix;
#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" #define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
#endif #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_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX #undef MD_STARTFILE_PREFIX
#undef MD_STARTFILE_PREFIX_1 #undef MD_STARTFILE_PREFIX_1

View File

@ -959,6 +959,7 @@ check_attr_value (rtx exp, struct attr_desc *attr)
case CTZ: case CTZ:
case POPCOUNT: case POPCOUNT:
case PARITY: case PARITY:
case BSWAP:
XEXP (exp, 0) = check_attr_value (XEXP (exp, 0), attr); XEXP (exp, 0) = check_attr_value (XEXP (exp, 0), attr);
break; break;

View File

@ -148,6 +148,7 @@ static const char * const optabs[] =
"atan_optab->handlers[$A].insn_code = CODE_FOR_$(atan$a2$)", "atan_optab->handlers[$A].insn_code = CODE_FOR_$(atan$a2$)",
"strlen_optab->handlers[$A].insn_code = CODE_FOR_$(strlen$a$)", "strlen_optab->handlers[$A].insn_code = CODE_FOR_$(strlen$a$)",
"one_cmpl_optab->handlers[$A].insn_code = CODE_FOR_$(one_cmpl$a2$)", "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$)", "ffs_optab->handlers[$A].insn_code = CODE_FOR_$(ffs$a2$)",
"clz_optab->handlers[$A].insn_code = CODE_FOR_$(clz$a2$)", "clz_optab->handlers[$A].insn_code = CODE_FOR_$(clz$a2$)",
"ctz_optab->handlers[$A].insn_code = CODE_FOR_$(ctz$a2$)", "ctz_optab->handlers[$A].insn_code = CODE_FOR_$(ctz$a2$)",

View File

@ -274,3 +274,10 @@ GCC_4.2.0 {
__floatuntitf __floatuntitf
_Unwind_GetIPInfo _Unwind_GetIPInfo
} }
%inherit GCC_4.3 GCC_4.2.0
GCC_4.3.0 {
# byte swapping routines
__bswapsi2
__bswapdi2
}

View File

@ -492,6 +492,30 @@ __ashrdi3 (DWtype u, word_type b)
} }
#endif #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 #ifdef L_ffssi2
#undef int #undef int
int int

View File

@ -345,11 +345,13 @@ extern Wtype __addvSI3 (Wtype, Wtype);
extern Wtype __subvSI3 (Wtype, Wtype); extern Wtype __subvSI3 (Wtype, Wtype);
extern Wtype __mulvSI3 (Wtype, Wtype); extern Wtype __mulvSI3 (Wtype, Wtype);
extern Wtype __negvSI2 (Wtype); extern Wtype __negvSI2 (Wtype);
extern UWtype __bswapsi2 (UWtype);
extern DWtype __absvDI2 (DWtype); extern DWtype __absvDI2 (DWtype);
extern DWtype __addvDI3 (DWtype, DWtype); extern DWtype __addvDI3 (DWtype, DWtype);
extern DWtype __subvDI3 (DWtype, DWtype); extern DWtype __subvDI3 (DWtype, DWtype);
extern DWtype __mulvDI3 (DWtype, DWtype); extern DWtype __mulvDI3 (DWtype, DWtype);
extern DWtype __negvDI2 (DWtype); extern DWtype __negvDI2 (DWtype);
extern UDWtype __bswapdi2 (UDWtype);
#ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC #ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC
extern SItype __absvsi2 (SItype); extern SItype __absvsi2 (SItype);

View File

@ -29,11 +29,11 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#ifdef index #ifdef index
#undef index #undef index
#endif #endif
#ifndef CROSS_COMPILE #ifndef CROSS_DIRECTORY_STRUCTURE
#include <a.out.h> #include <a.out.h>
#else #else
#include "mips/a.out.h" #include "mips/a.out.h"
#endif /* CROSS_COMPILE */ #endif /* CROSS_DIRECTORY_STRUCTURE */
/* Include getopt.h for the sake of getopt_long. */ /* Include getopt.h for the sake of getopt_long. */
#include "getopt.h" #include "getopt.h"

View File

@ -667,11 +667,11 @@ main (void)
#include <signal.h> #include <signal.h>
#ifndef CROSS_COMPILE #ifndef CROSS_DIRECTORY_STRUCTURE
#include <a.out.h> #include <a.out.h>
#else #else
#include "mips/a.out.h" #include "mips/a.out.h"
#endif /* CROSS_COMPILE */ #endif /* CROSS_DIRECTORY_STRUCTURE */
#include "gstab.h" #include "gstab.h"

View File

@ -91,7 +91,7 @@ lib2funcs='_muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3
_ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab
_popcountsi2 _popcountdi2 _paritysi2 _paritydi2 _powisf2 _powidf2 _popcountsi2 _popcountdi2 _paritysi2 _paritydi2 _powisf2 _powidf2
_powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3 _powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3
_divxc3 _divtc3' _divxc3 _divtc3 _bswapsi2 _bswapdi2'
if [ "$LIB2_SIDITI_CONV_FUNCS" ]; then if [ "$LIB2_SIDITI_CONV_FUNCS" ]; then
for func in $swfloatfuncs; do for func in $swfloatfuncs; do

View File

@ -2591,6 +2591,10 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
goto try_libcall; goto try_libcall;
} }
/* We can't widen a bswap. */
if (unoptab == bswap_optab)
goto try_libcall;
if (CLASS_HAS_WIDER_MODES_P (class)) if (CLASS_HAS_WIDER_MODES_P (class))
for (wider_mode = GET_MODE_WIDER_MODE (mode); for (wider_mode = GET_MODE_WIDER_MODE (mode);
wider_mode != VOIDmode; wider_mode != VOIDmode;
@ -5253,6 +5257,7 @@ init_optabs (void)
absv_optab = init_optabv (ABS); absv_optab = init_optabv (ABS);
addcc_optab = init_optab (UNKNOWN); addcc_optab = init_optab (UNKNOWN);
one_cmpl_optab = init_optab (NOT); one_cmpl_optab = init_optab (NOT);
bswap_optab = init_optab (BSWAP);
ffs_optab = init_optab (FFS); ffs_optab = init_optab (FFS);
clz_optab = init_optab (CLZ); clz_optab = init_optab (CLZ);
ctz_optab = init_optab (CTZ); 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_FLOAT, MODE_DECIMAL_FLOAT);
init_interclass_conv_libfuncs (trunc_optab, "trunc", MODE_DECIMAL_FLOAT, MODE_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. /* 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. */ Don't define any libcall for float complex, so that cabs will be used. */
if (complex_double_type_node) if (complex_double_type_node)

View File

@ -146,6 +146,8 @@ enum optab_index
/* Abs value */ /* Abs value */
OTI_abs, OTI_abs,
OTI_absv, OTI_absv,
/* Byteswap */
OTI_bswap,
/* Bitwise not */ /* Bitwise not */
OTI_one_cmpl, OTI_one_cmpl,
/* Bit scanning and counting */ /* Bit scanning and counting */
@ -315,6 +317,7 @@ extern GTY(()) optab optab_table[OTI_MAX];
#define abs_optab (optab_table[OTI_abs]) #define abs_optab (optab_table[OTI_abs])
#define absv_optab (optab_table[OTI_absv]) #define absv_optab (optab_table[OTI_absv])
#define one_cmpl_optab (optab_table[OTI_one_cmpl]) #define one_cmpl_optab (optab_table[OTI_one_cmpl])
#define bswap_optab (optab_table[OTI_bswap])
#define ffs_optab (optab_table[OTI_ffs]) #define ffs_optab (optab_table[OTI_ffs])
#define clz_optab (optab_table[OTI_clz]) #define clz_optab (optab_table[OTI_clz])
#define ctz_optab (optab_table[OTI_ctz]) #define ctz_optab (optab_table[OTI_ctz])

View File

@ -2555,6 +2555,7 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn,
case CTZ: case CTZ:
case POPCOUNT: case POPCOUNT:
case PARITY: case PARITY:
case BSWAP:
new = eliminate_regs_1 (XEXP (x, 0), mem_mode, insn, false); new = eliminate_regs_1 (XEXP (x, 0), mem_mode, insn, false);
if (new != XEXP (x, 0)) if (new != XEXP (x, 0))
return gen_rtx_fmt_e (code, GET_MODE (x), new); 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 CTZ:
case POPCOUNT: case POPCOUNT:
case PARITY: case PARITY:
case BSWAP:
elimination_effects (XEXP (x, 0), mem_mode); elimination_effects (XEXP (x, 0), mem_mode);
return; return;

View File

@ -567,6 +567,9 @@ DEF_RTL_EXPR(ABS, "abs", "e", RTX_UNARY)
/* Square root */ /* Square root */
DEF_RTL_EXPR(SQRT, "sqrt", "e", RTX_UNARY) DEF_RTL_EXPR(SQRT, "sqrt", "e", RTX_UNARY)
/* Swap bytes. */
DEF_RTL_EXPR(BSWAP, "bswap", "e", RTX_UNARY)
/* Find first bit that is set. /* Find first bit that is set.
Value is 1 + number of trailing zeros in the arg., Value is 1 + number of trailing zeros in the arg.,
or 0 if arg is 0. */ or 0 if arg is 0. */

View File

@ -1044,6 +1044,9 @@ simplify_const_unary_operation (enum rtx_code code, enum machine_mode mode,
val &= 1; val &= 1;
break; break;
case BSWAP:
return 0;
case TRUNCATE: case TRUNCATE:
val = arg0; val = arg0;
break; break;
@ -4887,4 +4890,3 @@ simplify_rtx (rtx x)
} }
return NULL; return NULL;
} }

View File

@ -1,5 +1,5 @@
/* Generic SSA value propagation engine. /* 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> Contributed by Diego Novillo <dnovillo@redhat.com>
This file is part of GCC. This file is part of GCC.
@ -176,6 +176,8 @@ cfg_blocks_empty_p (void)
static void static void
cfg_blocks_add (basic_block bb) cfg_blocks_add (basic_block bb)
{ {
bool head = false;
gcc_assert (bb != ENTRY_BLOCK_PTR && bb != EXIT_BLOCK_PTR); gcc_assert (bb != ENTRY_BLOCK_PTR && bb != EXIT_BLOCK_PTR);
gcc_assert (!TEST_BIT (bb_in_list, bb->index)); gcc_assert (!TEST_BIT (bb_in_list, bb->index));
@ -198,12 +200,26 @@ cfg_blocks_add (basic_block bb)
cfg_blocks_head = 0; cfg_blocks_head = 0;
VEC_safe_grow (basic_block, heap, cfg_blocks, 2 * cfg_blocks_tail); 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) cfg_blocks_tail = ((cfg_blocks_tail + 1)
% VEC_length (basic_block, cfg_blocks)); % 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); SET_BIT (bb_in_list, bb->index);
} }

View File

@ -6044,41 +6044,48 @@ clean_symbol_name (char *p)
*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 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 tree
get_file_function_name_long (const char *type) get_file_function_name (const char *type)
{ {
char *buf; char *buf;
const char *p; const char *p;
char *q; char *q;
/* If we already have a name we know to be unique, just use that. */
if (first_global_object_name) if (first_global_object_name)
{
p = first_global_object_name; p = first_global_object_name;
/* If the target is handling the constructors/destructors, they
/* For type 'F', the generated name must be unique not only to this will be local to this file and the name is only necessary for
translation unit but also to any given link. Since global names debugging purposes. */
can be overloaded, we concatenate the first global object name else if ((type[0] == 'I' || type[0] == 'D') && targetm.have_ctors_dtors)
with a string derived from the file name of this object. */
if (!strcmp (type, "F"))
{ {
const char *file = main_input_filename; const char *file = main_input_filename;
if (! file) if (! file)
file = input_filename; file = input_filename;
/* Just use the file's basename, because the full pathname
q = alloca (strlen (p) + 10); might be quite long. */
sprintf (q, "%s_%08X", p, crc32_string (0, file)); p = strrchr (file, '/');
if (p)
p = q; p++;
} else
p = file;
p = q = ASTRDUP (p);
clean_symbol_name (q);
} }
else 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. */ unit, so use what we do have and throw in some randomness. */
unsigned len; unsigned len;
const char *name = weak_global_object_name; const char *name = weak_global_object_name;
@ -6110,20 +6117,6 @@ get_file_function_name_long (const char *type)
return get_identifier (buf); 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) #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
@ -6585,6 +6578,10 @@ build_common_tree_nodes_2 (int short_double)
long_double_ptr_type_node = build_pointer_type (long_double_type_node); long_double_ptr_type_node = build_pointer_type (long_double_type_node);
integer_ptr_type_node = build_pointer_type (integer_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. */ /* Decimal float types. */
dfloat32_type_node = make_node (REAL_TYPE); dfloat32_type_node = make_node (REAL_TYPE);
TYPE_PRECISION (dfloat32_type_node) = DECIMAL32_TYPE_SIZE; TYPE_PRECISION (dfloat32_type_node) = DECIMAL32_TYPE_SIZE;

View File

@ -3245,6 +3245,9 @@ enum tree_index
TI_UINTDI_TYPE, TI_UINTDI_TYPE,
TI_UINTTI_TYPE, TI_UINTTI_TYPE,
TI_UINT32_TYPE,
TI_UINT64_TYPE,
TI_INTEGER_ZERO, TI_INTEGER_ZERO,
TI_INTEGER_ONE, TI_INTEGER_ONE,
TI_INTEGER_MINUS_ONE, TI_INTEGER_MINUS_ONE,
@ -3320,6 +3323,9 @@ extern GTY(()) tree global_trees[TI_MAX];
#define unsigned_intDI_type_node global_trees[TI_UINTDI_TYPE] #define unsigned_intDI_type_node global_trees[TI_UINTDI_TYPE]
#define unsigned_intTI_type_node global_trees[TI_UINTTI_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_zero_node global_trees[TI_INTEGER_ZERO]
#define integer_one_node global_trees[TI_INTEGER_ONE] #define integer_one_node global_trees[TI_INTEGER_ONE]
#define integer_minus_one_node global_trees[TI_INTEGER_MINUS_ONE] #define integer_minus_one_node global_trees[TI_INTEGER_MINUS_ONE]
@ -4185,7 +4191,7 @@ extern GTY(()) const char * current_function_func_begin_label;
/* In tree.c */ /* In tree.c */
extern unsigned crc32_string (unsigned, const char *); extern unsigned crc32_string (unsigned, const char *);
extern void clean_symbol_name (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 tree get_callee_fndecl (tree);
extern void change_decl_assembler_name (tree, tree); extern void change_decl_assembler_name (tree, tree);
extern int type_num_arguments (tree); extern int type_num_arguments (tree);
@ -4528,10 +4534,6 @@ extern void gimplify_function_tree (tree);
extern const char *get_name (tree); extern const char *get_name (tree);
extern tree unshare_expr (tree); extern tree unshare_expr (tree);
extern void sort_case_labels (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. */ /* Interface of the DWARF2 unwind info support. */