summaryrefslogtreecommitdiffstats
path: root/contrib/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/FREEBSD-Xlist91
-rw-r--r--contrib/gcc/Makefile.in2
-rw-r--r--contrib/gcc/c-common.c115
-rw-r--r--contrib/gcc/c-tree.h2
-rw-r--r--contrib/gcc/cccp.114
-rw-r--r--contrib/gcc/cccp.c7
-rw-r--r--contrib/gcc/choose-temp.c12
-rw-r--r--contrib/gcc/config/alpha/alpha.c4638
-rw-r--r--contrib/gcc/config/alpha/elf.h2
-rw-r--r--contrib/gcc/config/alpha/freebsd.h259
-rw-r--r--contrib/gcc/config/alpha/x-alpha1
-rw-r--r--contrib/gcc/config/alpha/xm-alpha.h18
-rw-r--r--contrib/gcc/config/alpha/xm-freebsd.h4
-rw-r--r--contrib/gcc/config/freebsd.h628
-rw-r--r--contrib/gcc/config/i386/freebsd-elf.h257
-rw-r--r--contrib/gcc/config/i386/freebsd.h745
-rw-r--r--contrib/gcc/config/i386/freebsd.h.fixed745
-rw-r--r--contrib/gcc/config/i386/i386.c37
-rw-r--r--contrib/gcc/config/i386/i386.h2
-rw-r--r--contrib/gcc/config/i386/i386.md13
-rw-r--r--contrib/gcc/config/i386/x-freebsd3
-rw-r--r--contrib/gcc/config/xm-freebsd.h13
-rwxr-xr-xcontrib/gcc/configure465
-rw-r--r--contrib/gcc/cp/decl.c629
-rw-r--r--contrib/gcc/cp/except.c2
-rw-r--r--contrib/gcc/cp/g++.c2
-rw-r--r--contrib/gcc/cp/gxxint.texi234
-rw-r--r--contrib/gcc/cp/ptree.c8
-rw-r--r--contrib/gcc/cp/reno.texi2
-rw-r--r--contrib/gcc/dbxout.c12
-rw-r--r--contrib/gcc/dwarfout.c2
-rw-r--r--contrib/gcc/extend.texi7
-rw-r--r--contrib/gcc/final.c12
-rw-r--r--contrib/gcc/flags.h6
-rw-r--r--contrib/gcc/function.c74
-rw-r--r--contrib/gcc/gcc.1102
-rw-r--r--contrib/gcc/gcc.c72
-rw-r--r--contrib/gcc/ginclude/stdarg.h2
-rw-r--r--contrib/gcc/ginclude/stddef.h2
-rw-r--r--contrib/gcc/ginclude/varargs.h2
-rw-r--r--contrib/gcc/invoke.texi36
-rw-r--r--contrib/gcc/libgcc2.c2
-rw-r--r--contrib/gcc/objc/sendmsg.c2
-rw-r--r--contrib/gcc/pexecute.c4
-rw-r--r--contrib/gcc/print-tree.c2
-rw-r--r--contrib/gcc/reload.c2
-rw-r--r--contrib/gcc/toplev.c28
47 files changed, 3534 insertions, 5785 deletions
diff --git a/contrib/gcc/FREEBSD-Xlist b/contrib/gcc/FREEBSD-Xlist
new file mode 100644
index 0000000..45d283e
--- /dev/null
+++ b/contrib/gcc/FREEBSD-Xlist
@@ -0,0 +1,91 @@
+*.brik
+*FAQ
+*contrib
+*etc
+*faq.*
+*/include
+*/install*
+*libchill
+*libf2c
+*libiberty
+*libio
+*libobjc
+*libstdc++
+*lt*
+*missing
+*mkinstalldirs
+*move-if-change
+*symlink-tree
+*texinfo
+*ylwrap
+*gcc/.cvsignore
+*gcc/ABOUT*NLS
+*gcc/*ChangeLog.*
+*gcc/README.ACORN
+*gcc/README.ALTOS
+*gcc/README.APOLLO
+*gcc/README.C4X
+*gcc/README.FRESCO
+*gcc/README.NS32K
+*gcc/README.RS6000
+*gcc/README.X11
+*gcc/README.gnat
+*gcc/*.bat
+*gcc/*.com
+*gcc/*.info*
+*gcc/bi-parser.[ch]
+*gcc/c-gperf.h
+*gcc/c-parse.[chy]
+*gcc/cexp.c
+*gcc/cpp.aux
+*gcc/cpp.cps
+*gcc/cpp.fns
+*gcc/gcc.aux
+*gcc/gcc.cps
+*gcc/gcc.hlp
+*gcc/texinfo.tex
+*gcc/.gdbinit
+*gcc/install1.texi
+*gcc/intl
+*gcc/ch
+*gcc/cp/hash.h
+*gcc/cp/parse.[ch]
+*gcc/config/1750a
+*gcc/config/a29k
+*gcc/config/arc
+*gcc/config/arm
+*gcc/config/c4x
+*gcc/config/clipper
+*gcc/config/convex
+*gcc/config/dsp16xx
+*gcc/config/elxsi
+*gcc/config/fx80
+*gcc/config/gmicro
+*gcc/config/h8300
+*gcc/config/i370
+*gcc/config/i860
+*gcc/config/i960
+*gcc/config/m32r
+*gcc/config/m68k
+*gcc/config/m88k
+*gcc/config/mn10200
+*gcc/config/mn10300
+*gcc/config/msdos
+*gcc/config/ns32k
+*gcc/config/pa
+*gcc/config/pdp11
+*gcc/config/pyr
+*gcc/config/romp
+*gcc/config/rs6000
+*gcc/config/sh
+*gcc/config/spur
+*gcc/config/tahoe
+*gcc/config/v850
+*gcc/config/vax
+*gcc/config/we32k
+*gcc/config/winnt
+*gcc/fixinc
+*gcc/java
+*gcc/objc/objc-parse.[cy]
+*gcc/po
+*gcc/testsuite
diff --git a/contrib/gcc/Makefile.in b/contrib/gcc/Makefile.in
index 0240f72..b1f7b08 100644
--- a/contrib/gcc/Makefile.in
+++ b/contrib/gcc/Makefile.in
@@ -18,6 +18,8 @@
#the Free Software Foundation, 59 Temple Place - Suite 330,
#Boston MA 02111-1307, USA.
+# $FreeBSD$
+
# The targets for external use include:
# all, doc, proto, install, install-cross, install-cross-rest,
# uninstall, TAGS, mostlyclean, clean, distclean, maintainer-clean,
diff --git a/contrib/gcc/c-common.c b/contrib/gcc/c-common.c
index 59dd407..aeb08fd 100644
--- a/contrib/gcc/c-common.c
+++ b/contrib/gcc/c-common.c
@@ -18,6 +18,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
#include "config.h"
#include "system.h"
#include "tree.h"
@@ -64,7 +66,7 @@ static void add_attribute PROTO((enum attrs, const char *,
int, int, int));
static void init_attributes PROTO((void));
static void record_function_format PROTO((tree, tree, enum format_type,
- int, int));
+ int, int, int));
static void record_international_format PROTO((tree, tree, int));
static tree c_find_base_decl PROTO((tree));
static int default_valid_lang_attribute PROTO ((tree, tree, tree, tree));
@@ -715,6 +717,7 @@ decl_attributes (node, attributes, prefix_attributes)
= TREE_VALUE (TREE_CHAIN (TREE_CHAIN (args)));
int format_num;
int first_arg_num;
+ int null_format_ok;
enum format_type format_type;
tree argument;
int arg_num;
@@ -728,7 +731,7 @@ decl_attributes (node, attributes, prefix_attributes)
if (TREE_CODE (format_type_id) != IDENTIFIER_NODE)
{
- error ("unrecognized format specifier");
+ error_with_decl (decl, "unrecognized format specifier");
continue;
}
else
@@ -736,12 +739,26 @@ decl_attributes (node, attributes, prefix_attributes)
const char *p = IDENTIFIER_POINTER (format_type_id);
if (!strcmp (p, "printf") || !strcmp (p, "__printf__"))
+ {
format_type = printf_format_type;
+ null_format_ok = 0;
+ }
+ else if (!strcmp (p, "printf0") || !strcmp (p, "__printf0__"))
+ {
+ format_type = printf_format_type;
+ null_format_ok = 1;
+ }
else if (!strcmp (p, "scanf") || !strcmp (p, "__scanf__"))
+ {
format_type = scanf_format_type;
+ null_format_ok = 0;
+ }
else if (!strcmp (p, "strftime")
|| !strcmp (p, "__strftime__"))
+ {
format_type = strftime_format_type;
+ null_format_ok = 0;
+ }
else
{
warning ("`%s' is an unrecognized format function type", p);
@@ -812,7 +829,8 @@ decl_attributes (node, attributes, prefix_attributes)
record_function_format (DECL_NAME (decl),
DECL_ASSEMBLER_NAME (decl),
- format_type, format_num, first_arg_num);
+ format_type, null_format_ok, format_num,
+ first_arg_num);
break;
}
@@ -1090,6 +1108,11 @@ typedef struct {
} format_char_info;
static format_char_info print_char_table[] = {
+/* FreeBSD kernel extensions. */
+ { "D", 1, T_C, NULL, NULL, NULL, NULL, NULL, NULL, "-wp" },
+ { "b", 1, T_C, NULL, NULL, NULL, NULL, NULL, NULL, "-wp" },
+ { "rz", 0, T_I, NULL, NULL, T_L, NULL, NULL, NULL, "-wp0 +#" },
+#define unextended_print_char_table (print_char_table + 3)
{ "di", 0, T_I, T_I, T_I, T_L, T_LL, T_LL, T_ST, "-wp0 +" },
{ "oxX", 0, T_UI, T_UI, T_UI, T_UL, T_ULL, T_ULL, T_ST, "-wp0#" },
{ "u", 0, T_UI, T_UI, T_UI, T_UL, T_ULL, T_ULL, T_ST, "-wp0" },
@@ -1150,6 +1173,7 @@ typedef struct function_format_info
tree name; /* identifier such as "printf" */
tree assembler_name; /* optional mangled identifier (for C++) */
enum format_type format_type; /* type of format (printf, scanf, etc.) */
+ int null_format_ok; /* TRUE if the format string may be NULL */
int format_num; /* number of format argument */
int first_arg_num; /* number of first arg (zero for varargs) */
} function_format_info;
@@ -1182,25 +1206,25 @@ void
init_function_format_info ()
{
record_function_format (get_identifier ("printf"), NULL_TREE,
- printf_format_type, 1, 2);
+ printf_format_type, 0, 1, 2);
record_function_format (get_identifier ("fprintf"), NULL_TREE,
- printf_format_type, 2, 3);
+ printf_format_type, 0, 2, 3);
record_function_format (get_identifier ("sprintf"), NULL_TREE,
- printf_format_type, 2, 3);
+ printf_format_type, 0, 2, 3);
record_function_format (get_identifier ("scanf"), NULL_TREE,
- scanf_format_type, 1, 2);
+ scanf_format_type, 0, 1, 2);
record_function_format (get_identifier ("fscanf"), NULL_TREE,
- scanf_format_type, 2, 3);
+ scanf_format_type, 0, 2, 3);
record_function_format (get_identifier ("sscanf"), NULL_TREE,
- scanf_format_type, 2, 3);
+ scanf_format_type, 0, 2, 3);
record_function_format (get_identifier ("vprintf"), NULL_TREE,
- printf_format_type, 1, 0);
+ printf_format_type, 0, 1, 0);
record_function_format (get_identifier ("vfprintf"), NULL_TREE,
- printf_format_type, 2, 0);
+ printf_format_type, 0, 2, 0);
record_function_format (get_identifier ("vsprintf"), NULL_TREE,
- printf_format_type, 2, 0);
+ printf_format_type, 0, 2, 0);
record_function_format (get_identifier ("strftime"), NULL_TREE,
- strftime_format_type, 3, 0);
+ strftime_format_type, 0, 3, 0);
record_international_format (get_identifier ("gettext"), NULL_TREE, 1);
record_international_format (get_identifier ("dgettext"), NULL_TREE, 2);
@@ -1217,11 +1241,12 @@ init_function_format_info ()
(e.g. for varargs such as vfprintf). */
static void
-record_function_format (name, assembler_name, format_type,
+record_function_format (name, assembler_name, format_type, null_format_ok,
format_num, first_arg_num)
tree name;
tree assembler_name;
enum format_type format_type;
+ int null_format_ok;
int format_num;
int first_arg_num;
{
@@ -1245,6 +1270,7 @@ record_function_format (name, assembler_name, format_type,
}
info->format_type = format_type;
+ info->null_format_ok = null_format_ok;
info->format_num = format_num;
info->first_arg_num = first_arg_num;
}
@@ -1398,7 +1424,8 @@ check_format_info (info, params)
if (integer_zerop (format_tree))
{
- warning ("null format string");
+ if (!info->null_format_ok)
+ warning ("null format string");
return;
}
if (TREE_CODE (format_tree) != ADDR_EXPR)
@@ -1569,12 +1596,13 @@ check_format_info (info, params)
It will work on most machines, because size_t and int
have the same mode. But might as well warn anyway,
since it will fail on other machines. */
+ /* XXX should we allow unsigned ints here? */
if ((TYPE_MAIN_VARIANT (TREE_TYPE (cur_param))
!= integer_type_node)
&&
(TYPE_MAIN_VARIANT (TREE_TYPE (cur_param))
!= unsigned_type_node))
- warning ("field width is not type int (arg %d)", arg_num);
+ warning ("precision is not type int (arg %d)", arg_num);
}
}
else
@@ -1619,6 +1647,53 @@ check_format_info (info, params)
}
}
}
+ if (*format_chars == 'b')
+ {
+ /* There should be an int arg to control the string arg. */
+ if (params == 0)
+ {
+ tfaff ();
+ return;
+ }
+ if (info->first_arg_num != 0)
+ {
+ cur_param = TREE_VALUE (params);
+ params = TREE_CHAIN (params);
+ ++arg_num;
+ if ((TYPE_MAIN_VARIANT (TREE_TYPE (cur_param))
+ != integer_type_node)
+ &&
+ (TYPE_MAIN_VARIANT (TREE_TYPE (cur_param))
+ != unsigned_type_node))
+ {
+ warning ("bitmap is not type int (arg %d)", arg_num);
+ }
+ }
+ }
+ if (*format_chars == 'D')
+ {
+ /* There should be an unsigned char * arg before the string arg. */
+ if (params == 0)
+ {
+ tfaff ();
+ return;
+ }
+ if (info->first_arg_num != 0)
+ {
+ cur_param = TREE_VALUE (params);
+ params = TREE_CHAIN (params);
+ ++arg_num;
+ cur_type = TREE_TYPE (cur_param);
+ if (TREE_CODE (cur_type) != POINTER_TYPE
+ || TYPE_MAIN_VARIANT (TREE_TYPE (cur_type))
+ != unsigned_char_type_node)
+ {
+ warning ("ethernet address is not type unsigned char *"
+ " (arg %d)",
+ arg_num);
+ }
+ }
+ }
aflag = 0;
@@ -1626,7 +1701,8 @@ check_format_info (info, params)
{
if (*format_chars == 'h' || *format_chars == 'l')
length_char = *format_chars++;
- else if (*format_chars == 'q' || *format_chars == 'L')
+ else if ((*format_chars == 'q' || *format_chars == 'L')
+ && !flag_format_extensions)
{
length_char = *format_chars++;
if (pedantic)
@@ -1688,7 +1764,8 @@ check_format_info (info, params)
switch (info->format_type)
{
case printf_format_type:
- fci = print_char_table;
+ fci = flag_format_extensions ? print_char_table
+ : unextended_print_char_table;
break;
case scanf_format_type:
fci = scan_char_table;
@@ -1725,7 +1802,7 @@ check_format_info (info, params)
if (index (fci->flag_chars, '2') != 0)
warning ("`%%%c' yields only last 2 digits of year", format_char);
else if (index (fci->flag_chars, '3') != 0)
- warning ("`%%%c' yields only last 2 digits of year in some locales",
+ warning ("`%%%c' yields only last 2 digits of year in some locales on non-BSD systems",
format_char);
if (precise && index (fci->flag_chars, 'p') == 0)
warning ("precision used with `%c' format", format_char);
diff --git a/contrib/gcc/c-tree.h b/contrib/gcc/c-tree.h
index bcf325b..40c2f2d 100644
--- a/contrib/gcc/c-tree.h
+++ b/contrib/gcc/c-tree.h
@@ -18,6 +18,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
#ifndef _C_TREE_H
#define _C_TREE_H
diff --git a/contrib/gcc/cccp.1 b/contrib/gcc/cccp.1
index 84eb19e..442f0ab 100644
--- a/contrib/gcc/cccp.1
+++ b/contrib/gcc/cccp.1
@@ -1,13 +1,14 @@
+.\" $FreeBSD$
.\" Copyright (c) 1991, 1992, 1993 Free Software Foundation \-*-Text-*-
.\" See section COPYING for conditions for redistribution
-.TH cpp 1 "30apr1993" "GNU Tools" "GNU Tools"
+.TH cpp 1 "April 30, 1993" "FreeBSD" "GNU Tools"
.SH NAME
-cccp, cpp \- The GNU C-Compatible Compiler Preprocessor.
+cpp \- The GNU C-Compatible Compiler Preprocessor.
.SH SYNOPSIS
.hy 0
.na
.TP
-.B cccp
+.B cpp
.RB "[\|" \-$ "\|]"
.RB "[\|" \-A \c
.I predicate\c
@@ -143,13 +144,6 @@ Most often when you use the C preprocessor you will not have to invoke it
explicitly: the C compiler will do so automatically. However, the
preprocessor is sometimes useful individually.
-When you call the preprocessor individually, either name
-(\c
-.B cpp\c
-\& or \c
-.B cccp\c
-\&) will do\(em\&they are completely synonymous.
-
The C preprocessor expects two file names as arguments, \c
.I infile\c
\& and
diff --git a/contrib/gcc/cccp.c b/contrib/gcc/cccp.c
index 83f4dff..69cd93d 100644
--- a/contrib/gcc/cccp.c
+++ b/contrib/gcc/cccp.c
@@ -18,6 +18,9 @@ along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
+
#include "config.h"
#include "system.h"
@@ -5134,6 +5137,7 @@ remap_include_file (filename, searchptr)
register struct file_name_map *map;
register char *from;
+#ifndef FREEBSD_NATIVE
if (searchptr)
{
if (! searchptr->got_name_map)
@@ -5148,6 +5152,7 @@ remap_include_file (filename, searchptr)
if (! strcmp (map->map_from, from))
return map->map_to;
}
+#endif
from = base_name (filename);
@@ -5162,9 +5167,11 @@ remap_include_file (filename, searchptr)
bcopy (filename, dir, from - filename);
dir[from - filename] = '\0';
+#ifndef FREEBSD_NATIVE
for (map = read_name_map (dir); map; map = map->map_next)
if (! strcmp (map->map_from, from))
return map->map_to;
+#endif
}
return filename;
diff --git a/contrib/gcc/choose-temp.c b/contrib/gcc/choose-temp.c
index b1007bb..018f7d9 100644
--- a/contrib/gcc/choose-temp.c
+++ b/contrib/gcc/choose-temp.c
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA. */
/* This file lives in at least two places: libiberty and gcc.
Don't change one without the other. */
+/* $FreeBSD$ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -112,13 +114,14 @@ choose_temp_base ()
base = try (getenv ("TMP"), base);
base = try (getenv ("TEMP"), base);
+ base = try (tmp, base);
+
#ifdef P_tmpdir
base = try (P_tmpdir, base);
#endif
- /* Try /usr/tmp, then /tmp. */
+ /* Try /usr/tmp even though it usually doesn't exist on FreeBSD. */
base = try (usrtmp, base);
- base = try (tmp, base);
/* If all else fails, use the current directory! */
if (base == 0)
@@ -158,13 +161,14 @@ make_temp_file (suffix)
base = try (getenv ("TMP"), base);
base = try (getenv ("TEMP"), base);
+ base = try (tmp, base);
+
#ifdef P_tmpdir
base = try (P_tmpdir, base);
#endif
- /* Try /usr/tmp, then /tmp. */
+ /* Try /usr/tmp even though it usually doesn't exist on FreeBSD. */
base = try (usrtmp, base);
- base = try (tmp, base);
/* If all else fails, use the current directory! */
if (base == 0)
diff --git a/contrib/gcc/config/alpha/alpha.c b/contrib/gcc/config/alpha/alpha.c
index 2d62693..f7428c3 100644
--- a/contrib/gcc/config/alpha/alpha.c
+++ b/contrib/gcc/config/alpha/alpha.c
@@ -1,5 +1,5 @@
/* Subroutines used for code generation on the DEC Alpha.
- Copyright (C) 1992, 93-98, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GNU CC.
@@ -20,8 +20,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <stdio.h>
#include "config.h"
-#include "system.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -34,44 +34,9 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "recog.h"
#include "reload.h"
-#include "tree.h"
#include "expr.h"
#include "obstack.h"
-#include "except.h"
-#include "function.h"
-#include "toplev.h"
-
-/* External data. */
-extern char *version_string;
-extern int rtx_equal_function_value_matters;
-
-/* Specify which cpu to schedule for. */
-
-enum processor_type alpha_cpu;
-static const char * const alpha_cpu_name[] =
-{
- "ev4", "ev5", "ev6"
-};
-
-/* Specify how accurate floating-point traps need to be. */
-
-enum alpha_trap_precision alpha_tp;
-
-/* Specify the floating-point rounding mode. */
-
-enum alpha_fp_rounding_mode alpha_fprm;
-
-/* Specify which things cause traps. */
-
-enum alpha_fp_trap_mode alpha_fptm;
-
-/* Strings decoded into the above options. */
-
-const char *alpha_cpu_string; /* -mcpu= */
-const char *alpha_tp_string; /* -mtrap-precision=[p|s|i] */
-const char *alpha_fprm_string; /* -mfp-rounding-mode=[n|m|c|d] */
-const char *alpha_fptm_string; /* -mfp-trap-mode=[n|u|su|sui] */
-const char *alpha_mlat_string; /* -mmemory-latency= */
+#include "tree.h"
/* Save information from a "cmpxx" operation until the branch or scc is
emitted. */
@@ -79,238 +44,26 @@ const char *alpha_mlat_string; /* -mmemory-latency= */
rtx alpha_compare_op0, alpha_compare_op1;
int alpha_compare_fp_p;
-/* Define the information needed to modify the epilogue for EH. */
+/* Save the name of the current function as used by the assembler. This
+ is used by the epilogue. */
-rtx alpha_eh_epilogue_sp_ofs;
+char *alpha_function_name;
/* Non-zero if inside of a function, because the Alpha asm can't
handle .files inside of functions. */
static int inside_function = FALSE;
-/* If non-null, this rtx holds the return address for the function. */
-
-static rtx alpha_return_addr_rtx;
+/* Nonzero if the current function needs gp. */
-/* The number of cycles of latency we should assume on memory reads. */
+int alpha_function_needs_gp;
-int alpha_memory_latency = 3;
-
-/* Whether the function needs the GP. */
-
-static int alpha_function_needs_gp;
-
-/* The alias set for prologue/epilogue register save/restore. */
-
-static int alpha_sr_alias_set;
+extern char *version_string;
+extern int rtx_equal_function_value_matters;
/* Declarations of static functions. */
-static void alpha_set_memflags_1
- PROTO((rtx, int, int, int));
-static rtx alpha_emit_set_const_1
- PROTO((rtx, enum machine_mode, HOST_WIDE_INT, int));
-static void alpha_expand_unaligned_load_words
- PROTO((rtx *out_regs, rtx smem, HOST_WIDE_INT words, HOST_WIDE_INT ofs));
-static void alpha_expand_unaligned_store_words
- PROTO((rtx *out_regs, rtx smem, HOST_WIDE_INT words, HOST_WIDE_INT ofs));
-static void alpha_sa_mask
- PROTO((unsigned long *imaskP, unsigned long *fmaskP));
-static int alpha_does_function_need_gp
- PROTO((void));
-
-
-/* Get the number of args of a function in one of two ways. */
-#ifdef OPEN_VMS
-#define NUM_ARGS current_function_args_info.num_args
-#else
-#define NUM_ARGS current_function_args_info
-#endif
-
-#define REG_PV 27
-#define REG_RA 26
-
-/* Parse target option strings. */
-
-void
-override_options ()
-{
- alpha_tp = ALPHA_TP_PROG;
- alpha_fprm = ALPHA_FPRM_NORM;
- alpha_fptm = ALPHA_FPTM_N;
-
- if (TARGET_IEEE)
- {
- alpha_tp = ALPHA_TP_INSN;
- alpha_fptm = ALPHA_FPTM_SU;
- }
-
- if (TARGET_IEEE_WITH_INEXACT)
- {
- alpha_tp = ALPHA_TP_INSN;
- alpha_fptm = ALPHA_FPTM_SUI;
- }
-
- if (alpha_tp_string)
- {
- if (! strcmp (alpha_tp_string, "p"))
- alpha_tp = ALPHA_TP_PROG;
- else if (! strcmp (alpha_tp_string, "f"))
- alpha_tp = ALPHA_TP_FUNC;
- else if (! strcmp (alpha_tp_string, "i"))
- alpha_tp = ALPHA_TP_INSN;
- else
- error ("bad value `%s' for -mtrap-precision switch", alpha_tp_string);
- }
-
- if (alpha_fprm_string)
- {
- if (! strcmp (alpha_fprm_string, "n"))
- alpha_fprm = ALPHA_FPRM_NORM;
- else if (! strcmp (alpha_fprm_string, "m"))
- alpha_fprm = ALPHA_FPRM_MINF;
- else if (! strcmp (alpha_fprm_string, "c"))
- alpha_fprm = ALPHA_FPRM_CHOP;
- else if (! strcmp (alpha_fprm_string,"d"))
- alpha_fprm = ALPHA_FPRM_DYN;
- else
- error ("bad value `%s' for -mfp-rounding-mode switch",
- alpha_fprm_string);
- }
-
- if (alpha_fptm_string)
- {
- if (strcmp (alpha_fptm_string, "n") == 0)
- alpha_fptm = ALPHA_FPTM_N;
- else if (strcmp (alpha_fptm_string, "u") == 0)
- alpha_fptm = ALPHA_FPTM_U;
- else if (strcmp (alpha_fptm_string, "su") == 0)
- alpha_fptm = ALPHA_FPTM_SU;
- else if (strcmp (alpha_fptm_string, "sui") == 0)
- alpha_fptm = ALPHA_FPTM_SUI;
- else
- error ("bad value `%s' for -mfp-trap-mode switch", alpha_fptm_string);
- }
-
- alpha_cpu
- = TARGET_CPU_DEFAULT & MASK_CPU_EV6 ? PROCESSOR_EV6
- : (TARGET_CPU_DEFAULT & MASK_CPU_EV5 ? PROCESSOR_EV5 : PROCESSOR_EV4);
-
- if (alpha_cpu_string)
- {
- if (! strcmp (alpha_cpu_string, "ev4")
- || ! strcmp (alpha_cpu_string, "21064"))
- {
- alpha_cpu = PROCESSOR_EV4;
- target_flags &= ~ (MASK_BWX | MASK_MAX | MASK_FIX | MASK_CIX);
- }
- else if (! strcmp (alpha_cpu_string, "ev5")
- || ! strcmp (alpha_cpu_string, "21164"))
- {
- alpha_cpu = PROCESSOR_EV5;
- target_flags &= ~ (MASK_BWX | MASK_MAX | MASK_FIX | MASK_CIX);
- }
- else if (! strcmp (alpha_cpu_string, "ev56")
- || ! strcmp (alpha_cpu_string, "21164a"))
- {
- alpha_cpu = PROCESSOR_EV5;
- target_flags |= MASK_BWX;
- target_flags &= ~ (MASK_MAX | MASK_FIX | MASK_CIX);
- }
- else if (! strcmp (alpha_cpu_string, "pca56")
- || ! strcmp (alpha_cpu_string, "21164PC")
- || ! strcmp (alpha_cpu_string, "21164pc"))
- {
- alpha_cpu = PROCESSOR_EV5;
- target_flags |= MASK_BWX | MASK_MAX;
- target_flags &= ~ (MASK_FIX | MASK_CIX);
- }
- else if (! strcmp (alpha_cpu_string, "ev6")
- || ! strcmp (alpha_cpu_string, "21264"))
- {
- alpha_cpu = PROCESSOR_EV6;
- target_flags |= MASK_BWX | MASK_MAX | MASK_FIX;
- target_flags &= ~ (MASK_CIX);
- }
- else
- error ("bad value `%s' for -mcpu switch", alpha_cpu_string);
- }
-
- /* Do some sanity checks on the above options. */
-
- if ((alpha_fptm == ALPHA_FPTM_SU || alpha_fptm == ALPHA_FPTM_SUI)
- && alpha_tp != ALPHA_TP_INSN && alpha_cpu != PROCESSOR_EV6)
- {
- warning ("fp software completion requires -mtrap-precision=i");
- alpha_tp = ALPHA_TP_INSN;
- }
-
- if (TARGET_FLOAT_VAX)
- {
- if (alpha_fprm == ALPHA_FPRM_MINF || alpha_fprm == ALPHA_FPRM_DYN)
- {
- warning ("rounding mode not supported for VAX floats");
- alpha_fprm = ALPHA_FPRM_NORM;
- }
- if (alpha_fptm == ALPHA_FPTM_SUI)
- {
- warning ("trap mode not supported for VAX floats");
- alpha_fptm = ALPHA_FPTM_SU;
- }
- }
-
- {
- char *end;
- int lat;
-
- if (!alpha_mlat_string)
- alpha_mlat_string = "L1";
-
- if (ISDIGIT ((unsigned char)alpha_mlat_string[0])
- && (lat = strtol (alpha_mlat_string, &end, 10), *end == '\0'))
- ;
- else if ((alpha_mlat_string[0] == 'L' || alpha_mlat_string[0] == 'l')
- && ISDIGIT ((unsigned char)alpha_mlat_string[1])
- && alpha_mlat_string[2] == '\0')
- {
- static int const cache_latency[][4] =
- {
- { 3, 30, -1 }, /* ev4 -- Bcache is a guess */
- { 2, 12, 38 }, /* ev5 -- Bcache from PC164 LMbench numbers */
- { 3, 13, -1 }, /* ev6 -- Ho hum, doesn't exist yet */
- };
-
- lat = alpha_mlat_string[1] - '0';
- if (lat < 0 || lat > 3 || cache_latency[alpha_cpu][lat-1] == -1)
- {
- warning ("L%d cache latency unknown for %s",
- lat, alpha_cpu_name[alpha_cpu]);
- lat = 3;
- }
- else
- lat = cache_latency[alpha_cpu][lat-1];
- }
- else if (! strcmp (alpha_mlat_string, "main"))
- {
- /* Most current memories have about 370ns latency. This is
- a reasonable guess for a fast cpu. */
- lat = 150;
- }
- else
- {
- warning ("bad value `%s' for -mmemory-latency", alpha_mlat_string);
- lat = 3;
- }
-
- alpha_memory_latency = lat;
- }
-
- /* Default the definition of "small data" to 8 bytes. */
- if (!g_switch_set)
- g_switch_value = 8;
-
- /* Acquire a unique set number for our register saves and restores. */
- alpha_sr_alias_set = new_alias_set ();
-}
+static void alpha_set_memflags_1 PROTO((rtx, int, int, int));
+static void add_long_const PROTO((FILE *, HOST_WIDE_INT, int, int, int));
/* Returns 1 if VALUE is a mask that contains full bytes of zero or ones. */
@@ -370,10 +123,10 @@ reg_or_8bit_operand (op, mode)
int
cint8_operand (op, mode)
register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ enum machine_mode mode;
{
- return ((GET_CODE (op) == CONST_INT
- && (unsigned HOST_WIDE_INT) INTVAL (op) < 0x100));
+ return (GET_CODE (op) == CONST_INT
+ && (unsigned HOST_WIDE_INT) INTVAL (op) < 0x100);
}
/* Return 1 if the operand is a valid second operand to an add insn. */
@@ -384,9 +137,9 @@ add_operand (op, mode)
enum machine_mode mode;
{
if (GET_CODE (op) == CONST_INT)
- /* Constraints I, J, O and P are covered by K. */
return (CONST_OK_FOR_LETTER_P (INTVAL (op), 'K')
- || CONST_OK_FOR_LETTER_P (INTVAL (op), 'L'));
+ || CONST_OK_FOR_LETTER_P (INTVAL (op), 'L')
+ || CONST_OK_FOR_LETTER_P (INTVAL (op), 'O'));
return register_operand (op, mode);
}
@@ -400,8 +153,8 @@ sext_add_operand (op, mode)
enum machine_mode mode;
{
if (GET_CODE (op) == CONST_INT)
- return (CONST_OK_FOR_LETTER_P (INTVAL (op), 'I')
- || CONST_OK_FOR_LETTER_P (INTVAL (op), 'O'));
+ return ((unsigned HOST_WIDE_INT) INTVAL (op) < 255
+ || (unsigned HOST_WIDE_INT) (- INTVAL (op)) < 255);
return register_operand (op, mode);
}
@@ -411,7 +164,7 @@ sext_add_operand (op, mode)
int
const48_operand (op, mode)
register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ enum machine_mode mode;
{
return (GET_CODE (op) == CONST_INT
&& (INTVAL (op) == 4 || INTVAL (op) == 8));
@@ -456,11 +209,10 @@ or_operand (op, mode)
int
mode_width_operand (op, mode)
register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ enum machine_mode mode;
{
return (GET_CODE (op) == CONST_INT
- && (INTVAL (op) == 8 || INTVAL (op) == 16
- || INTVAL (op) == 32 || INTVAL (op) == 64));
+ && (INTVAL (op) == 8 || INTVAL (op) == 16 || INTVAL (op) == 32));
}
/* Return 1 if OP is a constant that is the width of an integral machine mode
@@ -469,24 +221,18 @@ mode_width_operand (op, mode)
int
mode_mask_operand (op, mode)
register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ enum machine_mode mode;
{
#if HOST_BITS_PER_WIDE_INT == 32
if (GET_CODE (op) == CONST_DOUBLE)
- return (CONST_DOUBLE_LOW (op) == -1
- && (CONST_DOUBLE_HIGH (op) == -1
- || CONST_DOUBLE_HIGH (op) == 0));
-#else
- if (GET_CODE (op) == CONST_DOUBLE)
- return (CONST_DOUBLE_LOW (op) == -1 && CONST_DOUBLE_HIGH (op) == 0);
+ return CONST_DOUBLE_HIGH (op) == 0 && CONST_DOUBLE_LOW (op) == -1;
#endif
return (GET_CODE (op) == CONST_INT
&& (INTVAL (op) == 0xff
|| INTVAL (op) == 0xffff
- || INTVAL (op) == (HOST_WIDE_INT)0xffffffff
#if HOST_BITS_PER_WIDE_INT == 64
- || INTVAL (op) == -1
+ || INTVAL (op) == 0xffffffff
#endif
));
}
@@ -496,7 +242,7 @@ mode_mask_operand (op, mode)
int
mul8_operand (op, mode)
register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ enum machine_mode mode;
{
return (GET_CODE (op) == CONST_INT
&& (unsigned HOST_WIDE_INT) INTVAL (op) < 64
@@ -524,18 +270,6 @@ reg_or_fp0_operand (op, mode)
return fp0_operand (op, mode) || register_operand (op, mode);
}
-/* Return 1 if OP is a hard floating-point register. */
-
-int
-hard_fp_register_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
-{
- return ((GET_CODE (op) == REG && REGNO_REG_CLASS (REGNO (op)) == FLOAT_REGS)
- || (GET_CODE (op) == SUBREG
- && hard_fp_register_operand (SUBREG_REG (op), mode)));
-}
-
/* Return 1 if OP is a register or a constant integer. */
@@ -544,8 +278,7 @@ reg_or_cint_operand (op, mode)
register rtx op;
enum machine_mode mode;
{
- return (GET_CODE (op) == CONST_INT
- || register_operand (op, mode));
+ return GET_CODE (op) == CONST_INT || register_operand (op, mode);
}
/* Return 1 if OP is something that can be reloaded into a register;
@@ -561,15 +294,12 @@ some_operand (op, mode)
switch (GET_CODE (op))
{
- case REG: case MEM: case CONST_DOUBLE: case CONST_INT: case LABEL_REF:
- case SYMBOL_REF: case CONST:
+ case REG: case MEM: case CONST_DOUBLE:
+ case CONST_INT: case LABEL_REF: case SYMBOL_REF: case CONST:
return 1;
case SUBREG:
return some_operand (SUBREG_REG (op), VOIDmode);
-
- default:
- break;
}
return 0;
@@ -593,7 +323,7 @@ input_operand (op, mode)
case LABEL_REF:
case SYMBOL_REF:
case CONST:
- /* This handles both the Windows/NT and OSF cases. */
+ /* This handles both the Windows/NT and OSF cases. */
return mode == ptr_mode || mode == DImode;
case REG:
@@ -604,20 +334,13 @@ input_operand (op, mode)
return 1;
/* ... fall through ... */
case MEM:
- return ((TARGET_BWX || (mode != HImode && mode != QImode))
- && general_operand (op, mode));
+ return mode != HImode && mode != QImode && general_operand (op, mode);
case CONST_DOUBLE:
return GET_MODE_CLASS (mode) == MODE_FLOAT && op == CONST0_RTX (mode);
case CONST_INT:
return mode == QImode || mode == HImode || add_operand (op, mode);
-
- case CONSTANT_P_RTX:
- return 1;
-
- default:
- break;
}
return 0;
@@ -629,7 +352,7 @@ input_operand (op, mode)
int
current_file_function_operand (op, mode)
rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ enum machine_mode mode;
{
return (GET_CODE (op) == SYMBOL_REF
&& ! profile_flag && ! profile_block_flag
@@ -647,9 +370,7 @@ call_operand (op, mode)
if (mode != Pmode)
return 0;
- return (GET_CODE (op) == SYMBOL_REF
- || (GET_CODE (op) == REG
- && (TARGET_OPEN_VMS || TARGET_WINDOWS_NT || REGNO (op) == 27)));
+ return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == REG);
}
/* Return 1 if OP is a valid Alpha comparison operator. Here we know which
@@ -669,37 +390,17 @@ alpha_comparison_operator (op, mode)
|| (mode == DImode && (code == LEU || code == LTU)));
}
-/* Return 1 if OP is a valid Alpha swapped comparison operator. */
-
-int
-alpha_swapped_comparison_operator (op, mode)
- register rtx op;
- enum machine_mode mode;
-{
- enum rtx_code code = GET_CODE (op);
-
- if (mode != GET_MODE (op) || GET_RTX_CLASS (code) != '<')
- return 0;
-
- code = swap_condition (code);
- return (code == EQ || code == LE || code == LT
- || (mode == DImode && (code == LEU || code == LTU)));
-}
-
/* Return 1 if OP is a signed comparison operation. */
int
signed_comparison_operator (op, mode)
register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ enum machine_mode mode;
{
switch (GET_CODE (op))
{
case EQ: case NE: case LE: case LT: case GE: case GT:
return 1;
-
- default:
- break;
}
return 0;
@@ -710,15 +411,12 @@ signed_comparison_operator (op, mode)
int
divmod_operator (op, mode)
register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ enum machine_mode mode;
{
switch (GET_CODE (op))
{
case DIV: case MOD: case UDIV: case UMOD:
return 1;
-
- default:
- break;
}
return 0;
@@ -728,49 +426,43 @@ divmod_operator (op, mode)
a constant. It must be a valid address. This means that we can do
this as an aligned reference plus some offset.
- Take into account what reload will do. */
+ Take into account what reload will do.
+
+ We could say that out-of-range stack slots are alignable, but that would
+ complicate get_aligned_mem and it isn't worth the trouble since few
+ functions have large stack space. */
int
aligned_memory_operand (op, mode)
register rtx op;
enum machine_mode mode;
{
- rtx base;
-
- if (reload_in_progress)
+ if (GET_CODE (op) == SUBREG)
{
- rtx tmp = op;
- if (GET_CODE (tmp) == SUBREG)
- tmp = SUBREG_REG (tmp);
- if (GET_CODE (tmp) == REG
- && REGNO (tmp) >= FIRST_PSEUDO_REGISTER)
- {
- op = reg_equiv_memory_loc[REGNO (tmp)];
- if (op == 0)
- return 0;
- }
+ if (GET_MODE (op) != mode)
+ return 0;
+ op = SUBREG_REG (op);
+ mode = GET_MODE (op);
}
- if (GET_CODE (op) != MEM
- || GET_MODE (op) != mode)
+ if (reload_in_progress && GET_CODE (op) == REG
+ && REGNO (op) >= FIRST_PSEUDO_REGISTER)
+ op = reg_equiv_mem[REGNO (op)];
+
+ if (GET_CODE (op) != MEM || GET_MODE (op) != mode
+ || ! memory_address_p (mode, XEXP (op, 0)))
return 0;
+
op = XEXP (op, 0);
- /* LEGITIMIZE_RELOAD_ADDRESS creates (plus (plus reg const_hi) const_lo)
- sorts of constructs. Dig for the real base register. */
- if (reload_in_progress
- && GET_CODE (op) == PLUS
- && GET_CODE (XEXP (op, 0)) == PLUS)
- base = XEXP (XEXP (op, 0), 0);
- else
- {
- if (! memory_address_p (mode, op))
- return 0;
- base = (GET_CODE (op) == PLUS ? XEXP (op, 0) : op);
- }
+ if (GET_CODE (op) == PLUS)
+ op = XEXP (op, 0);
- return (GET_CODE (base) == REG
- && REGNO_POINTER_ALIGN (REGNO (base)) >= 4);
+ return (GET_CODE (op) == REG
+ && (REGNO (op) == STACK_POINTER_REGNUM
+ || op == hard_frame_pointer_rtx
+ || (REGNO (op) >= FIRST_VIRTUAL_REGISTER
+ && REGNO (op) <= LAST_VIRTUAL_REGISTER)));
}
/* Similar, but return 1 if OP is a MEM which is not alignable. */
@@ -780,52 +472,34 @@ unaligned_memory_operand (op, mode)
register rtx op;
enum machine_mode mode;
{
- rtx base;
-
- if (reload_in_progress)
+ if (GET_CODE (op) == SUBREG)
{
- rtx tmp = op;
- if (GET_CODE (tmp) == SUBREG)
- tmp = SUBREG_REG (tmp);
- if (GET_CODE (tmp) == REG
- && REGNO (tmp) >= FIRST_PSEUDO_REGISTER)
- {
- op = reg_equiv_memory_loc[REGNO (tmp)];
- if (op == 0)
- return 0;
- }
+ if (GET_MODE (op) != mode)
+ return 0;
+ op = SUBREG_REG (op);
+ mode = GET_MODE (op);
}
- if (GET_CODE (op) != MEM
- || GET_MODE (op) != mode)
+ if (reload_in_progress && GET_CODE (op) == REG
+ && REGNO (op) >= FIRST_PSEUDO_REGISTER)
+ op = reg_equiv_mem[REGNO (op)];
+
+ if (GET_CODE (op) != MEM || GET_MODE (op) != mode)
return 0;
- op = XEXP (op, 0);
- /* LEGITIMIZE_RELOAD_ADDRESS creates (plus (plus reg const_hi) const_lo)
- sorts of constructs. Dig for the real base register. */
- if (reload_in_progress
- && GET_CODE (op) == PLUS
- && GET_CODE (XEXP (op, 0)) == PLUS)
- base = XEXP (XEXP (op, 0), 0);
- else
- {
- if (! memory_address_p (mode, op))
- return 0;
- base = (GET_CODE (op) == PLUS ? XEXP (op, 0) : op);
- }
+ op = XEXP (op, 0);
- return (GET_CODE (base) == REG
- && REGNO_POINTER_ALIGN (REGNO (base)) < 4);
-}
+ if (! memory_address_p (mode, op))
+ return 1;
-/* Return 1 if OP is either a register or an unaligned memory location. */
+ if (GET_CODE (op) == PLUS)
+ op = XEXP (op, 0);
-int
-reg_or_unaligned_mem_operand (op, mode)
- rtx op;
- enum machine_mode mode;
-{
- return register_operand (op, mode) || unaligned_memory_operand (op, mode);
+ return (GET_CODE (op) != REG
+ || (REGNO (op) != STACK_POINTER_REGNUM
+ && op != hard_frame_pointer_rtx
+ && (REGNO (op) < FIRST_VIRTUAL_REGISTER
+ || REGNO (op) > LAST_VIRTUAL_REGISTER)));
}
/* Return 1 if OP is any memory location. During reload a pseudo matches. */
@@ -833,7 +507,7 @@ reg_or_unaligned_mem_operand (op, mode)
int
any_memory_operand (op, mode)
register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ enum machine_mode mode;
{
return (GET_CODE (op) == MEM
|| (GET_CODE (op) == SUBREG && GET_CODE (SUBREG_REG (op)) == REG)
@@ -844,89 +518,9 @@ any_memory_operand (op, mode)
&& REGNO (SUBREG_REG (op)) >= FIRST_PSEUDO_REGISTER));
}
-/* Returns 1 if OP is not an eliminable register.
-
- This exists to cure a pathological abort in the s8addq (et al) patterns,
-
- long foo () { long t; bar(); return (long) &t * 26107; }
-
- which run afoul of a hack in reload to cure a (presumably) similar
- problem with lea-type instructions on other targets. But there is
- one of us and many of them, so work around the problem by selectively
- preventing combine from making the optimization. */
-
-int
-reg_not_elim_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
-{
- rtx inner = op;
- if (GET_CODE (op) == SUBREG)
- inner = SUBREG_REG (op);
- if (inner == frame_pointer_rtx || inner == arg_pointer_rtx)
- return 0;
-
- return register_operand (op, mode);
-}
-
-/* Return 1 is OP is a memory location that is not a reference (using
- an AND) to an unaligned location. Take into account what reload
- will do. */
-
-int
-normal_memory_operand (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
-{
- if (reload_in_progress)
- {
- rtx tmp = op;
- if (GET_CODE (tmp) == SUBREG)
- tmp = SUBREG_REG (tmp);
- if (GET_CODE (tmp) == REG
- && REGNO (tmp) >= FIRST_PSEUDO_REGISTER)
- {
- op = reg_equiv_memory_loc[REGNO (tmp)];
-
- /* This may not have been assigned an equivalent address if it will
- be eliminated. In that case, it doesn't matter what we do. */
- if (op == 0)
- return 1;
- }
- }
-
- return GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) != AND;
-}
-
-/* Accept a register, but not a subreg of any kind. This allows us to
- avoid pathological cases in reload wrt data movement common in
- int->fp conversion. */
-
-int
-reg_no_subreg_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
-{
- if (GET_CODE (op) == SUBREG)
- return 0;
- return register_operand (op, mode);
-}
-
-/* Return 1 if this function can directly return via $26. */
-
-int
-direct_return ()
-{
- return (! TARGET_OPEN_VMS && reload_completed && alpha_sa_size () == 0
- && get_frame_size () == 0
- && current_function_outgoing_args_size == 0
- && current_function_pretend_args_size == 0);
-}
-
/* REF is an alignable memory location. Place an aligned SImode
reference into *PALIGNED_MEM and the number of bits to shift into
- *PBITNUM. SCRATCH is a free register for use in reloading out
- of range stack slots. */
+ *PBITNUM. */
void
get_aligned_mem (ref, paligned_mem, pbitnum)
@@ -936,67 +530,67 @@ get_aligned_mem (ref, paligned_mem, pbitnum)
rtx base;
HOST_WIDE_INT offset = 0;
- if (GET_CODE (ref) != MEM)
- abort ();
-
- if (reload_in_progress
- && ! memory_address_p (GET_MODE (ref), XEXP (ref, 0)))
+ if (GET_CODE (ref) == SUBREG)
{
- base = find_replacement (&XEXP (ref, 0));
-
- if (! memory_address_p (GET_MODE (ref), base))
- abort ();
+ offset = SUBREG_WORD (ref) * UNITS_PER_WORD;
+ if (BYTES_BIG_ENDIAN)
+ offset -= (MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (ref)))
+ - MIN (UNITS_PER_WORD,
+ GET_MODE_SIZE (GET_MODE (SUBREG_REG (ref)))));
+ ref = SUBREG_REG (ref);
}
+
+ if (GET_CODE (ref) == REG)
+ ref = reg_equiv_mem[REGNO (ref)];
+
+ if (reload_in_progress)
+ base = find_replacement (&XEXP (ref, 0));
else
- {
- base = XEXP (ref, 0);
- }
+ base = XEXP (ref, 0);
if (GET_CODE (base) == PLUS)
offset += INTVAL (XEXP (base, 1)), base = XEXP (base, 0);
- *paligned_mem = gen_rtx_MEM (SImode, plus_constant (base, offset & ~3));
- MEM_COPY_ATTRIBUTES (*paligned_mem, ref);
+ *paligned_mem = gen_rtx (MEM, SImode,
+ plus_constant (base, offset & ~3));
+ MEM_IN_STRUCT_P (*paligned_mem) = MEM_IN_STRUCT_P (ref);
+ MEM_VOLATILE_P (*paligned_mem) = MEM_VOLATILE_P (ref);
RTX_UNCHANGING_P (*paligned_mem) = RTX_UNCHANGING_P (ref);
- /* Sadly, we cannot use alias sets here because we may overlap other
- data in a different alias set. */
- /* MEM_ALIAS_SET (*paligned_mem) = MEM_ALIAS_SET (ref); */
-
*pbitnum = GEN_INT ((offset & 3) * 8);
}
-/* Similar, but just get the address. Handle the two reload cases.
- Add EXTRA_OFFSET to the address we return. */
+/* Similar, but just get the address. Handle the two reload cases. */
rtx
-get_unaligned_address (ref, extra_offset)
+get_unaligned_address (ref)
rtx ref;
- int extra_offset;
{
rtx base;
HOST_WIDE_INT offset = 0;
- if (GET_CODE (ref) != MEM)
- abort ();
-
- if (reload_in_progress
- && ! memory_address_p (GET_MODE (ref), XEXP (ref, 0)))
+ if (GET_CODE (ref) == SUBREG)
{
- base = find_replacement (&XEXP (ref, 0));
-
- if (! memory_address_p (GET_MODE (ref), base))
- abort ();
+ offset = SUBREG_WORD (ref) * UNITS_PER_WORD;
+ if (BYTES_BIG_ENDIAN)
+ offset -= (MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (ref)))
+ - MIN (UNITS_PER_WORD,
+ GET_MODE_SIZE (GET_MODE (SUBREG_REG (ref)))));
+ ref = SUBREG_REG (ref);
}
+
+ if (GET_CODE (ref) == REG)
+ ref = reg_equiv_mem[REGNO (ref)];
+
+ if (reload_in_progress)
+ base = find_replacement (&XEXP (ref, 0));
else
- {
- base = XEXP (ref, 0);
- }
+ base = XEXP (ref, 0);
if (GET_CODE (base) == PLUS)
offset += INTVAL (XEXP (base, 1)), base = XEXP (base, 0);
- return plus_constant (base, offset + extra_offset);
+ return plus_constant (base, offset);
}
/* Subfunction of the following function. Update the flags of any MEM
@@ -1034,15 +628,6 @@ alpha_set_memflags_1 (x, in_struct_p, volatile_p, unchanging_p)
MEM_IN_STRUCT_P (x) = in_struct_p;
MEM_VOLATILE_P (x) = volatile_p;
RTX_UNCHANGING_P (x) = unchanging_p;
- /* Sadly, we cannot use alias sets because the extra aliasing
- produced by the AND interferes. Given that two-byte quantities
- are the only thing we would be able to differentiate anyway,
- there does not seem to be any point in convoluting the early
- out of the alias check. */
- /* MEM_ALIAS_SET (x) = alias_set; */
- break;
-
- default:
break;
}
}
@@ -1058,19 +643,14 @@ alpha_set_memflags (insn, ref)
rtx insn;
rtx ref;
{
- int in_struct_p, volatile_p, unchanging_p;
+ /* Note that it is always safe to get these flags, though they won't
+ be what we think if REF is not a MEM. */
+ int in_struct_p = MEM_IN_STRUCT_P (ref);
+ int volatile_p = MEM_VOLATILE_P (ref);
+ int unchanging_p = RTX_UNCHANGING_P (ref);
- if (GET_CODE (ref) != MEM)
- return;
-
- in_struct_p = MEM_IN_STRUCT_P (ref);
- volatile_p = MEM_VOLATILE_P (ref);
- unchanging_p = RTX_UNCHANGING_P (ref);
-
- /* This is only called from alpha.md, after having had something
- generated from one of the insn patterns. So if everything is
- zero, the pattern is already up-to-date. */
- if (! in_struct_p && ! volatile_p && ! unchanging_p)
+ if (GET_CODE (ref) != MEM
+ || (! in_struct_p && ! volatile_p && ! unchanging_p))
return;
alpha_set_memflags_1 (insn, in_struct_p, volatile_p, unchanging_p);
@@ -1089,26 +669,6 @@ alpha_emit_set_const (target, mode, c, n)
HOST_WIDE_INT c;
int n;
{
- rtx pat;
- int i;
-
- /* Try 1 insn, then 2, then up to N. */
- for (i = 1; i <= n; i++)
- if ((pat = alpha_emit_set_const_1 (target, mode, c, i)) != 0)
- return pat;
-
- return 0;
-}
-
-/* Internal routine for the above to check for N or below insns. */
-
-static rtx
-alpha_emit_set_const_1 (target, mode, c, n)
- rtx target;
- enum machine_mode mode;
- HOST_WIDE_INT c;
- int n;
-{
HOST_WIDE_INT new = c;
int i, bits;
/* Use a pseudo if highly optimizing and still generating RTL. */
@@ -1128,10 +688,12 @@ alpha_emit_set_const_1 (target, mode, c, n)
/* If this is a sign-extended 32-bit constant, we can do this in at most
three insns, so do it if we have enough insns left. We always have
- a sign-extended 32-bit constant when compiling on a narrow machine. */
+ a sign-extended 32-bit constant when compiling on a narrow machine.
+ Note that we cannot handle the constant 0x80000000. */
- if (HOST_BITS_PER_WIDE_INT != 64
- || c >> 31 == -1 || c >> 31 == 0)
+ if ((HOST_BITS_PER_WIDE_INT != 64
+ || c >> 31 == -1 || c >> 31 == 0)
+ && c != 0x80000000U)
{
HOST_WIDE_INT low = (c & 0xffff) - 2 * (c & 0x8000);
HOST_WIDE_INT tmp1 = c - low;
@@ -1150,19 +712,13 @@ alpha_emit_set_const_1 (target, mode, c, n)
}
if (c == low || (low == 0 && extra == 0))
- {
- /* We used to use copy_to_suggested_reg (GEN_INT (c), target, mode)
- but that meant that we can't handle INT_MIN on 32-bit machines
- (like NT/Alpha), because we recurse indefinitely through
- emit_move_insn to gen_movdi. So instead, since we know exactly
- what we want, create it explicitly. */
-
- if (target == NULL)
- target = gen_reg_rtx (mode);
- emit_insn (gen_rtx_SET (VOIDmode, target, GEN_INT (c)));
- return target;
- }
- else if (n >= 2 + (extra != 0))
+ return copy_to_suggested_reg (GEN_INT (c), target, mode);
+ else if (n >= 2 + (extra != 0)
+ /* We can't do this when SImode if HIGH required adjustment.
+ This is because the code relies on an implicit overflow
+ which is invisible to the RTL. We can thus get incorrect
+ code if the two ldah instructions are combined. */
+ && ! (mode == SImode && extra != 0))
{
temp = copy_to_suggested_reg (GEN_INT (low), subtarget, mode);
@@ -1228,7 +784,7 @@ alpha_emit_set_const_1 (target, mode, c, n)
for (; bits > 0; bits--)
if ((temp = (alpha_emit_set_const
(subtarget, mode,
- (unsigned HOST_WIDE_INT) (c >> bits), i))) != 0
+ (unsigned HOST_WIDE_INT) c >> bits, i))) != 0
|| ((temp = (alpha_emit_set_const
(subtarget, mode,
((unsigned HOST_WIDE_INT) c) >> bits, i)))
@@ -1239,11 +795,9 @@ alpha_emit_set_const_1 (target, mode, c, n)
/* Now try high-order zero bits. Here we try the shifted-in bits as
all zero and all ones. Be careful to avoid shifting outside the
mode and to avoid shifting outside the host wide int size. */
- /* On narrow hosts, don't shift a 1 into the high bit, since we'll
- confuse the recursive call and set all of the high 32 bits. */
if ((bits = (MIN (HOST_BITS_PER_WIDE_INT, GET_MODE_SIZE (mode) * 8)
- - floor_log2 (c) - 1 - (HOST_BITS_PER_WIDE_INT < 64))) > 0)
+ - floor_log2 (c) - 1)) > 0)
for (; bits > 0; bits--)
if ((temp = alpha_emit_set_const (subtarget, mode,
c << bits, i)) != 0
@@ -1275,1132 +829,6 @@ alpha_emit_set_const_1 (target, mode, c, n)
return 0;
}
-
-/* Having failed to find a 3 insn sequence in alpha_emit_set_const,
- fall back to a straight forward decomposition. We do this to avoid
- exponential run times encountered when looking for longer sequences
- with alpha_emit_set_const. */
-
-rtx
-alpha_emit_set_long_const (target, c1, c2)
- rtx target;
- HOST_WIDE_INT c1, c2;
-{
- HOST_WIDE_INT d1, d2, d3, d4;
-
- /* Decompose the entire word */
-#if HOST_BITS_PER_WIDE_INT >= 64
- if (c2 != -(c1 < 0))
- abort ();
- d1 = ((c1 & 0xffff) ^ 0x8000) - 0x8000;
- c1 -= d1;
- d2 = ((c1 & 0xffffffff) ^ 0x80000000) - 0x80000000;
- c1 = (c1 - d2) >> 32;
- d3 = ((c1 & 0xffff) ^ 0x8000) - 0x8000;
- c1 -= d3;
- d4 = ((c1 & 0xffffffff) ^ 0x80000000) - 0x80000000;
- if (c1 != d4)
- abort ();
-#else
- d1 = ((c1 & 0xffff) ^ 0x8000) - 0x8000;
- c1 -= d1;
- d2 = ((c1 & 0xffffffff) ^ 0x80000000) - 0x80000000;
- if (c1 != d2)
- abort ();
- c2 += (d2 < 0);
- d3 = ((c2 & 0xffff) ^ 0x8000) - 0x8000;
- c2 -= d3;
- d4 = ((c2 & 0xffffffff) ^ 0x80000000) - 0x80000000;
- if (c2 != d4)
- abort ();
-#endif
-
- /* Construct the high word */
- if (d4)
- {
- emit_move_insn (target, GEN_INT (d4));
- if (d3)
- emit_move_insn (target, gen_rtx_PLUS (DImode, target, GEN_INT (d3)));
- }
- else
- emit_move_insn (target, GEN_INT (d3));
-
- /* Shift it into place */
- emit_move_insn (target, gen_rtx_ASHIFT (DImode, target, GEN_INT (32)));
-
- /* Add in the low bits. */
- if (d2)
- emit_move_insn (target, gen_rtx_PLUS (DImode, target, GEN_INT (d2)));
- if (d1)
- emit_move_insn (target, gen_rtx_PLUS (DImode, target, GEN_INT (d1)));
-
- return target;
-}
-
-/* Generate the comparison for a conditional branch. */
-
-rtx
-alpha_emit_conditional_branch (code)
- enum rtx_code code;
-{
- enum rtx_code cmp_code, branch_code;
- enum machine_mode cmp_mode, branch_mode = VOIDmode;
- rtx op0 = alpha_compare_op0, op1 = alpha_compare_op1;
- rtx tem;
-
- /* The general case: fold the comparison code to the types of compares
- that we have, choosing the branch as necessary. */
- switch (code)
- {
- case EQ: case LE: case LT: case LEU: case LTU:
- /* We have these compares: */
- cmp_code = code, branch_code = NE;
- break;
-
- case NE:
- /* This must be reversed. */
- cmp_code = EQ, branch_code = EQ;
- break;
-
- case GE: case GT: case GEU: case GTU:
- /* For FP, we swap them, for INT, we reverse them. */
- if (alpha_compare_fp_p)
- {
- cmp_code = swap_condition (code);
- branch_code = NE;
- tem = op0, op0 = op1, op1 = tem;
- }
- else
- {
- cmp_code = reverse_condition (code);
- branch_code = EQ;
- }
- break;
-
- default:
- abort ();
- }
-
- if (alpha_compare_fp_p)
- {
- cmp_mode = DFmode;
- if (flag_fast_math)
- {
- /* When we are not as concerned about non-finite values, and we
- are comparing against zero, we can branch directly. */
- if (op1 == CONST0_RTX (DFmode))
- cmp_code = NIL, branch_code = code;
- else if (op0 == CONST0_RTX (DFmode))
- {
- /* Undo the swap we probably did just above. */
- tem = op0, op0 = op1, op1 = tem;
- branch_code = swap_condition (cmp_code);
- cmp_code = NIL;
- }
- }
- else
- {
- /* ??? We mark the the branch mode to be CCmode to prevent the
- compare and branch from being combined, since the compare
- insn follows IEEE rules that the branch does not. */
- branch_mode = CCmode;
- }
- }
- else
- {
- cmp_mode = DImode;
-
- /* The following optimizations are only for signed compares. */
- if (code != LEU && code != LTU && code != GEU && code != GTU)
- {
- /* Whee. Compare and branch against 0 directly. */
- if (op1 == const0_rtx)
- cmp_code = NIL, branch_code = code;
-
- /* We want to use cmpcc/bcc when we can, since there is a zero delay
- bypass between logicals and br/cmov on EV5. But we don't want to
- force valid immediate constants into registers needlessly. */
- else if (GET_CODE (op1) == CONST_INT)
- {
- HOST_WIDE_INT v = INTVAL (op1), n = -v;
-
- if (! CONST_OK_FOR_LETTER_P (v, 'I')
- && (CONST_OK_FOR_LETTER_P (n, 'K')
- || CONST_OK_FOR_LETTER_P (n, 'L')))
- {
- cmp_code = PLUS, branch_code = code;
- op1 = GEN_INT (n);
- }
- }
- }
- }
-
- /* Force op0 into a register. */
- if (GET_CODE (op0) != REG)
- op0 = force_reg (cmp_mode, op0);
-
- /* Emit an initial compare instruction, if necessary. */
- tem = op0;
- if (cmp_code != NIL)
- {
- tem = gen_reg_rtx (cmp_mode);
- emit_move_insn (tem, gen_rtx_fmt_ee (cmp_code, cmp_mode, op0, op1));
- }
-
- /* Return the branch comparison. */
- return gen_rtx_fmt_ee (branch_code, branch_mode, tem, CONST0_RTX (cmp_mode));
-}
-
-
-/* Rewrite a comparison against zero CMP of the form
- (CODE (cc0) (const_int 0)) so it can be written validly in
- a conditional move (if_then_else CMP ...).
- If both of the operands that set cc0 are non-zero we must emit
- an insn to perform the compare (it can't be done within
- the conditional move). */
-rtx
-alpha_emit_conditional_move (cmp, mode)
- rtx cmp;
- enum machine_mode mode;
-{
- enum rtx_code code = GET_CODE (cmp);
- enum rtx_code cmov_code = NE;
- rtx op0 = alpha_compare_op0;
- rtx op1 = alpha_compare_op1;
- enum machine_mode cmp_mode
- = (GET_MODE (op0) == VOIDmode ? DImode : GET_MODE (op0));
- enum machine_mode cmp_op_mode = alpha_compare_fp_p ? DFmode : DImode;
- enum machine_mode cmov_mode = VOIDmode;
- rtx tem;
-
- if (alpha_compare_fp_p != FLOAT_MODE_P (mode))
- return 0;
-
- /* We may be able to use a conditional move directly.
- This avoids emitting spurious compares. */
- if (signed_comparison_operator (cmp, cmp_op_mode)
- && (!alpha_compare_fp_p || flag_fast_math)
- && (op0 == CONST0_RTX (cmp_mode) || op1 == CONST0_RTX (cmp_mode)))
- return gen_rtx_fmt_ee (code, VOIDmode, op0, op1);
-
- /* We can't put the comparison insides a conditional move;
- emit a compare instruction and put that inside the
- conditional move. Make sure we emit only comparisons we have;
- swap or reverse as necessary. */
-
- switch (code)
- {
- case EQ: case LE: case LT: case LEU: case LTU:
- /* We have these compares: */
- break;
-
- case NE:
- /* This must be reversed. */
- code = reverse_condition (code);
- cmov_code = EQ;
- break;
-
- case GE: case GT: case GEU: case GTU:
- /* These must be swapped. Make sure the new first operand is in
- a register. */
- code = swap_condition (code);
- tem = op0, op0 = op1, op1 = tem;
- op0 = force_reg (cmp_mode, op0);
- break;
-
- default:
- abort ();
- }
-
- /* ??? We mark the branch mode to be CCmode to prevent the compare
- and cmov from being combined, since the compare insn follows IEEE
- rules that the cmov does not. */
- if (alpha_compare_fp_p && !flag_fast_math)
- cmov_mode = CCmode;
-
- tem = gen_reg_rtx (cmp_op_mode);
- emit_move_insn (tem, gen_rtx_fmt_ee (code, cmp_op_mode, op0, op1));
- return gen_rtx_fmt_ee (cmov_code, cmov_mode, tem, CONST0_RTX (cmp_op_mode));
-}
-
-/* Use ext[wlq][lh] as the Architecture Handbook describes for extracting
- unaligned data:
-
- unsigned: signed:
- word: ldq_u r1,X(r11) ldq_u r1,X(r11)
- ldq_u r2,X+1(r11) ldq_u r2,X+1(r11)
- lda r3,X(r11) lda r3,X+2(r11)
- extwl r1,r3,r1 extql r1,r3,r1
- extwh r2,r3,r2 extqh r2,r3,r2
- or r1.r2.r1 or r1,r2,r1
- sra r1,48,r1
-
- long: ldq_u r1,X(r11) ldq_u r1,X(r11)
- ldq_u r2,X+3(r11) ldq_u r2,X+3(r11)
- lda r3,X(r11) lda r3,X(r11)
- extll r1,r3,r1 extll r1,r3,r1
- extlh r2,r3,r2 extlh r2,r3,r2
- or r1.r2.r1 addl r1,r2,r1
-
- quad: ldq_u r1,X(r11)
- ldq_u r2,X+7(r11)
- lda r3,X(r11)
- extql r1,r3,r1
- extqh r2,r3,r2
- or r1.r2.r1
-*/
-
-void
-alpha_expand_unaligned_load (tgt, mem, size, ofs, sign)
- rtx tgt, mem;
- HOST_WIDE_INT size, ofs;
- int sign;
-{
- rtx meml, memh, addr, extl, exth;
- enum machine_mode mode;
-
- meml = gen_reg_rtx (DImode);
- memh = gen_reg_rtx (DImode);
- addr = gen_reg_rtx (DImode);
- extl = gen_reg_rtx (DImode);
- exth = gen_reg_rtx (DImode);
-
- emit_move_insn (meml,
- change_address (mem, DImode,
- gen_rtx_AND (DImode,
- plus_constant (XEXP (mem, 0),
- ofs),
- GEN_INT (-8))));
-
- emit_move_insn (memh,
- change_address (mem, DImode,
- gen_rtx_AND (DImode,
- plus_constant (XEXP (mem, 0),
- ofs + size - 1),
- GEN_INT (-8))));
-
- if (sign && size == 2)
- {
- emit_move_insn (addr, plus_constant (XEXP (mem, 0), ofs+2));
-
- emit_insn (gen_extxl (extl, meml, GEN_INT (64), addr));
- emit_insn (gen_extqh (exth, memh, addr));
-
- /* We must use tgt here for the target. Alpha-vms port fails if we use
- addr for the target, because addr is marked as a pointer and combine
- knows that pointers are always sign-extended 32 bit values. */
- addr = expand_binop (DImode, ior_optab, extl, exth, tgt, 1, OPTAB_WIDEN);
- addr = expand_binop (DImode, ashr_optab, addr, GEN_INT (48),
- addr, 1, OPTAB_WIDEN);
- }
- else
- {
- emit_move_insn (addr, plus_constant (XEXP (mem, 0), ofs));
- emit_insn (gen_extxl (extl, meml, GEN_INT (size*8), addr));
- switch (size)
- {
- case 2:
- emit_insn (gen_extwh (exth, memh, addr));
- mode = HImode;
- break;
-
- case 4:
- emit_insn (gen_extlh (exth, memh, addr));
- mode = SImode;
- break;
-
- case 8:
- emit_insn (gen_extqh (exth, memh, addr));
- mode = DImode;
- break;
- default:
- abort();
- }
-
- addr = expand_binop (mode, ior_optab, gen_lowpart (mode, extl),
- gen_lowpart (mode, exth), gen_lowpart (mode, tgt),
- sign, OPTAB_WIDEN);
- }
-
- if (addr != tgt)
- emit_move_insn (tgt, gen_lowpart(GET_MODE (tgt), addr));
-}
-
-/* Similarly, use ins and msk instructions to perform unaligned stores. */
-
-void
-alpha_expand_unaligned_store (dst, src, size, ofs)
- rtx dst, src;
- HOST_WIDE_INT size, ofs;
-{
- rtx dstl, dsth, addr, insl, insh, meml, memh;
-
- dstl = gen_reg_rtx (DImode);
- dsth = gen_reg_rtx (DImode);
- insl = gen_reg_rtx (DImode);
- insh = gen_reg_rtx (DImode);
-
- meml = change_address (dst, DImode,
- gen_rtx_AND (DImode,
- plus_constant (XEXP (dst, 0), ofs),
- GEN_INT (-8)));
- memh = change_address (dst, DImode,
- gen_rtx_AND (DImode,
- plus_constant (XEXP (dst, 0),
- ofs+size-1),
- GEN_INT (-8)));
-
- emit_move_insn (dsth, memh);
- emit_move_insn (dstl, meml);
- addr = copy_addr_to_reg (plus_constant (XEXP (dst, 0), ofs));
-
- if (src != const0_rtx)
- {
- emit_insn (gen_insxh (insh, gen_lowpart (DImode, src),
- GEN_INT (size*8), addr));
-
- switch (size)
- {
- case 2:
- emit_insn (gen_inswl (insl, gen_lowpart (HImode, src), addr));
- break;
- case 4:
- emit_insn (gen_insll (insl, gen_lowpart (SImode, src), addr));
- break;
- case 8:
- emit_insn (gen_insql (insl, src, addr));
- break;
- }
- }
-
- emit_insn (gen_mskxh (dsth, dsth, GEN_INT (size*8), addr));
-
- switch (size)
- {
- case 2:
- emit_insn (gen_mskxl (dstl, dstl, GEN_INT (0xffff), addr));
- break;
- case 4:
- emit_insn (gen_mskxl (dstl, dstl, GEN_INT (0xffffffff), addr));
- break;
- case 8:
- {
-#if HOST_BITS_PER_WIDE_INT == 32
- rtx msk = immed_double_const (0xffffffff, 0xffffffff, DImode);
-#else
- rtx msk = immed_double_const (0xffffffffffffffff, 0, DImode);
-#endif
- emit_insn (gen_mskxl (dstl, dstl, msk, addr));
- }
- break;
- }
-
- if (src != const0_rtx)
- {
- dsth = expand_binop (DImode, ior_optab, insh, dsth, dsth, 0, OPTAB_WIDEN);
- dstl = expand_binop (DImode, ior_optab, insl, dstl, dstl, 0, OPTAB_WIDEN);
- }
-
- /* Must store high before low for degenerate case of aligned. */
- emit_move_insn (memh, dsth);
- emit_move_insn (meml, dstl);
-}
-
-/* The block move code tries to maximize speed by separating loads and
- stores at the expense of register pressure: we load all of the data
- before we store it back out. There are two secondary effects worth
- mentioning, that this speeds copying to/from aligned and unaligned
- buffers, and that it makes the code significantly easier to write. */
-
-#define MAX_MOVE_WORDS 8
-
-/* Load an integral number of consecutive unaligned quadwords. */
-
-static void
-alpha_expand_unaligned_load_words (out_regs, smem, words, ofs)
- rtx *out_regs;
- rtx smem;
- HOST_WIDE_INT words, ofs;
-{
- rtx const im8 = GEN_INT (-8);
- rtx const i64 = GEN_INT (64);
- rtx ext_tmps[MAX_MOVE_WORDS], data_regs[MAX_MOVE_WORDS+1];
- rtx sreg, areg;
- HOST_WIDE_INT i;
-
- /* Generate all the tmp registers we need. */
- for (i = 0; i < words; ++i)
- {
- data_regs[i] = out_regs[i];
- ext_tmps[i] = gen_reg_rtx (DImode);
- }
- data_regs[words] = gen_reg_rtx (DImode);
-
- if (ofs != 0)
- smem = change_address (smem, GET_MODE (smem),
- plus_constant (XEXP (smem, 0), ofs));
-
- /* Load up all of the source data. */
- for (i = 0; i < words; ++i)
- {
- emit_move_insn (data_regs[i],
- change_address (smem, DImode,
- gen_rtx_AND (DImode,
- plus_constant (XEXP(smem,0),
- 8*i),
- im8)));
- }
- emit_move_insn (data_regs[words],
- change_address (smem, DImode,
- gen_rtx_AND (DImode,
- plus_constant (XEXP(smem,0),
- 8*words - 1),
- im8)));
-
- /* Extract the half-word fragments. Unfortunately DEC decided to make
- extxh with offset zero a noop instead of zeroing the register, so
- we must take care of that edge condition ourselves with cmov. */
-
- sreg = copy_addr_to_reg (XEXP (smem, 0));
- areg = expand_binop (DImode, and_optab, sreg, GEN_INT (7), NULL,
- 1, OPTAB_WIDEN);
- for (i = 0; i < words; ++i)
- {
- emit_insn (gen_extxl (data_regs[i], data_regs[i], i64, sreg));
-
- emit_insn (gen_extqh (ext_tmps[i], data_regs[i+1], sreg));
- emit_insn (gen_rtx_SET (VOIDmode, ext_tmps[i],
- gen_rtx_IF_THEN_ELSE (DImode,
- gen_rtx_EQ (DImode, areg,
- const0_rtx),
- const0_rtx, ext_tmps[i])));
- }
-
- /* Merge the half-words into whole words. */
- for (i = 0; i < words; ++i)
- {
- out_regs[i] = expand_binop (DImode, ior_optab, data_regs[i],
- ext_tmps[i], data_regs[i], 1, OPTAB_WIDEN);
- }
-}
-
-/* Store an integral number of consecutive unaligned quadwords. DATA_REGS
- may be NULL to store zeros. */
-
-static void
-alpha_expand_unaligned_store_words (data_regs, dmem, words, ofs)
- rtx *data_regs;
- rtx dmem;
- HOST_WIDE_INT words, ofs;
-{
- rtx const im8 = GEN_INT (-8);
- rtx const i64 = GEN_INT (64);
-#if HOST_BITS_PER_WIDE_INT == 32
- rtx const im1 = immed_double_const (0xffffffff, 0xffffffff, DImode);
-#else
- rtx const im1 = immed_double_const (0xffffffffffffffff, 0, DImode);
-#endif
- rtx ins_tmps[MAX_MOVE_WORDS];
- rtx st_tmp_1, st_tmp_2, dreg;
- rtx st_addr_1, st_addr_2;
- HOST_WIDE_INT i;
-
- /* Generate all the tmp registers we need. */
- if (data_regs != NULL)
- for (i = 0; i < words; ++i)
- ins_tmps[i] = gen_reg_rtx(DImode);
- st_tmp_1 = gen_reg_rtx(DImode);
- st_tmp_2 = gen_reg_rtx(DImode);
-
- if (ofs != 0)
- dmem = change_address (dmem, GET_MODE (dmem),
- plus_constant (XEXP (dmem, 0), ofs));
-
-
- st_addr_2 = change_address (dmem, DImode,
- gen_rtx_AND (DImode,
- plus_constant (XEXP(dmem,0),
- words*8 - 1),
- im8));
- st_addr_1 = change_address (dmem, DImode,
- gen_rtx_AND (DImode,
- XEXP (dmem, 0),
- im8));
-
- /* Load up the destination end bits. */
- emit_move_insn (st_tmp_2, st_addr_2);
- emit_move_insn (st_tmp_1, st_addr_1);
-
- /* Shift the input data into place. */
- dreg = copy_addr_to_reg (XEXP (dmem, 0));
- if (data_regs != NULL)
- {
- for (i = words-1; i >= 0; --i)
- {
- emit_insn (gen_insxh (ins_tmps[i], data_regs[i], i64, dreg));
- emit_insn (gen_insql (data_regs[i], data_regs[i], dreg));
- }
- for (i = words-1; i > 0; --i)
- {
- ins_tmps[i-1] = expand_binop (DImode, ior_optab, data_regs[i],
- ins_tmps[i-1], ins_tmps[i-1], 1,
- OPTAB_WIDEN);
- }
- }
-
- /* Split and merge the ends with the destination data. */
- emit_insn (gen_mskxh (st_tmp_2, st_tmp_2, i64, dreg));
- emit_insn (gen_mskxl (st_tmp_1, st_tmp_1, im1, dreg));
-
- if (data_regs != NULL)
- {
- st_tmp_2 = expand_binop (DImode, ior_optab, st_tmp_2, ins_tmps[words-1],
- st_tmp_2, 1, OPTAB_WIDEN);
- st_tmp_1 = expand_binop (DImode, ior_optab, st_tmp_1, data_regs[0],
- st_tmp_1, 1, OPTAB_WIDEN);
- }
-
- /* Store it all. */
- emit_move_insn (st_addr_2, st_tmp_2);
- for (i = words-1; i > 0; --i)
- {
- emit_move_insn (change_address (dmem, DImode,
- gen_rtx_AND (DImode,
- plus_constant(XEXP (dmem,0),
- i*8),
- im8)),
- data_regs ? ins_tmps[i-1] : const0_rtx);
- }
- emit_move_insn (st_addr_1, st_tmp_1);
-}
-
-
-/* Expand string/block move operations.
-
- operands[0] is the pointer to the destination.
- operands[1] is the pointer to the source.
- operands[2] is the number of bytes to move.
- operands[3] is the alignment. */
-
-int
-alpha_expand_block_move (operands)
- rtx operands[];
-{
- rtx bytes_rtx = operands[2];
- rtx align_rtx = operands[3];
- HOST_WIDE_INT orig_bytes = INTVAL (bytes_rtx);
- HOST_WIDE_INT bytes = orig_bytes;
- HOST_WIDE_INT src_align = INTVAL (align_rtx);
- HOST_WIDE_INT dst_align = src_align;
- rtx orig_src = operands[1];
- rtx orig_dst = operands[0];
- rtx data_regs[2*MAX_MOVE_WORDS+16];
- rtx tmp;
- int i, words, ofs, nregs = 0;
-
- if (bytes <= 0)
- return 1;
- if (bytes > MAX_MOVE_WORDS*8)
- return 0;
-
- /* Look for additional alignment information from recorded register info. */
-
- tmp = XEXP (orig_src, 0);
- if (GET_CODE (tmp) == REG)
- {
- if (REGNO_POINTER_ALIGN (REGNO (tmp)) > src_align)
- src_align = REGNO_POINTER_ALIGN (REGNO (tmp));
- }
- else if (GET_CODE (tmp) == PLUS
- && GET_CODE (XEXP (tmp, 0)) == REG
- && GET_CODE (XEXP (tmp, 1)) == CONST_INT)
- {
- HOST_WIDE_INT c = INTVAL (XEXP (tmp, 1));
- int a = REGNO_POINTER_ALIGN (REGNO (XEXP (tmp, 0)));
-
- if (a > src_align)
- {
- if (a >= 8 && c % 8 == 0)
- src_align = 8;
- else if (a >= 4 && c % 4 == 0)
- src_align = 4;
- else if (a >= 2 && c % 2 == 0)
- src_align = 2;
- }
- }
-
- tmp = XEXP (orig_dst, 0);
- if (GET_CODE (tmp) == REG)
- {
- if (REGNO_POINTER_ALIGN (REGNO (tmp)) > dst_align)
- dst_align = REGNO_POINTER_ALIGN (REGNO (tmp));
- }
- else if (GET_CODE (tmp) == PLUS
- && GET_CODE (XEXP (tmp, 0)) == REG
- && GET_CODE (XEXP (tmp, 1)) == CONST_INT)
- {
- HOST_WIDE_INT c = INTVAL (XEXP (tmp, 1));
- int a = REGNO_POINTER_ALIGN (REGNO (XEXP (tmp, 0)));
-
- if (a > dst_align)
- {
- if (a >= 8 && c % 8 == 0)
- dst_align = 8;
- else if (a >= 4 && c % 4 == 0)
- dst_align = 4;
- else if (a >= 2 && c % 2 == 0)
- dst_align = 2;
- }
- }
-
- /*
- * Load the entire block into registers.
- */
-
- if (GET_CODE (XEXP (orig_src, 0)) == ADDRESSOF)
- {
- enum machine_mode mode;
- tmp = XEXP (XEXP (orig_src, 0), 0);
-
- /* Don't use the existing register if we're reading more than
- is held in the register. Nor if there is not a mode that
- handles the exact size. */
- mode = mode_for_size (bytes * BITS_PER_UNIT, MODE_INT, 1);
- if (mode != BLKmode
- && GET_MODE_SIZE (GET_MODE (tmp)) >= bytes)
- {
- if (mode == TImode)
- {
- data_regs[nregs] = gen_lowpart (DImode, tmp);
- data_regs[nregs+1] = gen_highpart (DImode, tmp);
- nregs += 2;
- }
- else
- data_regs[nregs++] = gen_lowpart (mode, tmp);
- goto src_done;
- }
-
- /* No appropriate mode; fall back on memory. */
- orig_src = change_address (orig_src, GET_MODE (orig_src),
- copy_addr_to_reg (XEXP (orig_src, 0)));
- }
-
- ofs = 0;
- if (src_align >= 8 && bytes >= 8)
- {
- words = bytes / 8;
-
- for (i = 0; i < words; ++i)
- data_regs[nregs+i] = gen_reg_rtx(DImode);
-
- for (i = 0; i < words; ++i)
- {
- emit_move_insn (data_regs[nregs+i],
- change_address (orig_src, DImode,
- plus_constant (XEXP (orig_src, 0),
- ofs + i*8)));
- }
-
- nregs += words;
- bytes -= words * 8;
- ofs += words * 8;
- }
- if (src_align >= 4 && bytes >= 4)
- {
- words = bytes / 4;
-
- for (i = 0; i < words; ++i)
- data_regs[nregs+i] = gen_reg_rtx(SImode);
-
- for (i = 0; i < words; ++i)
- {
- emit_move_insn (data_regs[nregs+i],
- change_address (orig_src, SImode,
- plus_constant (XEXP (orig_src, 0),
- ofs + i*4)));
- }
-
- nregs += words;
- bytes -= words * 4;
- ofs += words * 4;
- }
- if (bytes >= 16)
- {
- words = bytes / 8;
-
- for (i = 0; i < words+1; ++i)
- data_regs[nregs+i] = gen_reg_rtx(DImode);
-
- alpha_expand_unaligned_load_words (data_regs + nregs, orig_src,
- words, ofs);
-
- nregs += words;
- bytes -= words * 8;
- ofs += words * 8;
- }
- if (!TARGET_BWX && bytes >= 8)
- {
- data_regs[nregs++] = tmp = gen_reg_rtx (DImode);
- alpha_expand_unaligned_load (tmp, orig_src, 8, ofs, 0);
- bytes -= 8;
- ofs += 8;
- }
- if (!TARGET_BWX && bytes >= 4)
- {
- data_regs[nregs++] = tmp = gen_reg_rtx (SImode);
- alpha_expand_unaligned_load (tmp, orig_src, 4, ofs, 0);
- bytes -= 4;
- ofs += 4;
- }
- if (bytes >= 2)
- {
- if (src_align >= 2)
- {
- do {
- data_regs[nregs++] = tmp = gen_reg_rtx (HImode);
- emit_move_insn (tmp,
- change_address (orig_src, HImode,
- plus_constant (XEXP (orig_src, 0),
- ofs)));
- bytes -= 2;
- ofs += 2;
- } while (bytes >= 2);
- }
- else if (!TARGET_BWX)
- {
- data_regs[nregs++] = tmp = gen_reg_rtx (HImode);
- alpha_expand_unaligned_load (tmp, orig_src, 2, ofs, 0);
- bytes -= 2;
- ofs += 2;
- }
- }
- while (bytes > 0)
- {
- data_regs[nregs++] = tmp = gen_reg_rtx (QImode);
- emit_move_insn (tmp,
- change_address (orig_src, QImode,
- plus_constant (XEXP (orig_src, 0),
- ofs)));
- bytes -= 1;
- ofs += 1;
- }
- src_done:
-
- if (nregs > (int)(sizeof(data_regs)/sizeof(*data_regs)))
- abort();
-
- /*
- * Now save it back out again.
- */
-
- i = 0, ofs = 0;
-
- if (GET_CODE (XEXP (orig_dst, 0)) == ADDRESSOF)
- {
- enum machine_mode mode;
- tmp = XEXP (XEXP (orig_dst, 0), 0);
-
- mode = mode_for_size (orig_bytes * BITS_PER_UNIT, MODE_INT, 1);
- if (GET_MODE (tmp) == mode)
- {
- if (nregs == 1)
- {
- emit_move_insn (tmp, data_regs[0]);
- i = 1;
- goto dst_done;
- }
- else if (nregs == 2 && mode == TImode)
- {
- /* Undo the subregging done above when copying between
- two TImode registers. */
- if (GET_CODE (data_regs[0]) == SUBREG
- && GET_MODE (SUBREG_REG (data_regs[0])) == TImode)
- {
- emit_move_insn (tmp, SUBREG_REG (data_regs[0]));
- }
- else
- {
- rtx seq;
-
- start_sequence ();
- emit_move_insn (gen_lowpart (DImode, tmp), data_regs[0]);
- emit_move_insn (gen_highpart (DImode, tmp), data_regs[1]);
- seq = get_insns ();
- end_sequence ();
-
- emit_no_conflict_block (seq, tmp, data_regs[0],
- data_regs[1], NULL_RTX);
- }
-
- i = 2;
- goto dst_done;
- }
- }
-
- /* ??? If nregs > 1, consider reconstructing the word in regs. */
- /* ??? Optimize mode < dst_mode with strict_low_part. */
-
- /* No appropriate mode; fall back on memory. We can speed things
- up by recognizing extra alignment information. */
- orig_dst = change_address (orig_dst, GET_MODE (orig_dst),
- copy_addr_to_reg (XEXP (orig_dst, 0)));
- dst_align = GET_MODE_SIZE (GET_MODE (tmp));
- }
-
- /* Write out the data in whatever chunks reading the source allowed. */
- if (dst_align >= 8)
- {
- while (i < nregs && GET_MODE (data_regs[i]) == DImode)
- {
- emit_move_insn (change_address (orig_dst, DImode,
- plus_constant (XEXP (orig_dst, 0),
- ofs)),
- data_regs[i]);
- ofs += 8;
- i++;
- }
- }
- if (dst_align >= 4)
- {
- /* If the source has remaining DImode regs, write them out in
- two pieces. */
- while (i < nregs && GET_MODE (data_regs[i]) == DImode)
- {
- tmp = expand_binop (DImode, lshr_optab, data_regs[i], GEN_INT (32),
- NULL_RTX, 1, OPTAB_WIDEN);
-
- emit_move_insn (change_address (orig_dst, SImode,
- plus_constant (XEXP (orig_dst, 0),
- ofs)),
- gen_lowpart (SImode, data_regs[i]));
- emit_move_insn (change_address (orig_dst, SImode,
- plus_constant (XEXP (orig_dst, 0),
- ofs+4)),
- gen_lowpart (SImode, tmp));
- ofs += 8;
- i++;
- }
-
- while (i < nregs && GET_MODE (data_regs[i]) == SImode)
- {
- emit_move_insn (change_address(orig_dst, SImode,
- plus_constant (XEXP (orig_dst, 0),
- ofs)),
- data_regs[i]);
- ofs += 4;
- i++;
- }
- }
- if (i < nregs && GET_MODE (data_regs[i]) == DImode)
- {
- /* Write out a remaining block of words using unaligned methods. */
-
- for (words = 1; i+words < nregs ; ++words)
- if (GET_MODE (data_regs[i+words]) != DImode)
- break;
-
- if (words == 1)
- alpha_expand_unaligned_store (orig_dst, data_regs[i], 8, ofs);
- else
- alpha_expand_unaligned_store_words (data_regs+i, orig_dst, words, ofs);
-
- i += words;
- ofs += words * 8;
- }
-
- /* Due to the above, this won't be aligned. */
- /* ??? If we have more than one of these, consider constructing full
- words in registers and using alpha_expand_unaligned_store_words. */
- while (i < nregs && GET_MODE (data_regs[i]) == SImode)
- {
- alpha_expand_unaligned_store (orig_dst, data_regs[i], 4, ofs);
- ofs += 4;
- i++;
- }
-
- if (dst_align >= 2)
- while (i < nregs && GET_MODE (data_regs[i]) == HImode)
- {
- emit_move_insn (change_address (orig_dst, HImode,
- plus_constant (XEXP (orig_dst, 0),
- ofs)),
- data_regs[i]);
- i++;
- ofs += 2;
- }
- else
- while (i < nregs && GET_MODE (data_regs[i]) == HImode)
- {
- alpha_expand_unaligned_store (orig_dst, data_regs[i], 2, ofs);
- i++;
- ofs += 2;
- }
- while (i < nregs && GET_MODE (data_regs[i]) == QImode)
- {
- emit_move_insn (change_address (orig_dst, QImode,
- plus_constant (XEXP (orig_dst, 0),
- ofs)),
- data_regs[i]);
- i++;
- ofs += 1;
- }
- dst_done:
-
- if (i != nregs)
- abort();
-
- return 1;
-}
-
-int
-alpha_expand_block_clear (operands)
- rtx operands[];
-{
- rtx bytes_rtx = operands[1];
- rtx align_rtx = operands[2];
- HOST_WIDE_INT bytes = INTVAL (bytes_rtx);
- HOST_WIDE_INT align = INTVAL (align_rtx);
- rtx orig_dst = operands[0];
- rtx tmp;
- HOST_WIDE_INT i, words, ofs = 0;
-
- if (bytes <= 0)
- return 1;
- if (bytes > MAX_MOVE_WORDS*8)
- return 0;
-
- /* Look for stricter alignment. */
-
- tmp = XEXP (orig_dst, 0);
- if (GET_CODE (tmp) == REG)
- {
- if (REGNO_POINTER_ALIGN (REGNO (tmp)) > align)
- align = REGNO_POINTER_ALIGN (REGNO (tmp));
- }
- else if (GET_CODE (tmp) == PLUS
- && GET_CODE (XEXP (tmp, 0)) == REG
- && GET_CODE (XEXP (tmp, 1)) == CONST_INT)
- {
- HOST_WIDE_INT c = INTVAL (XEXP (tmp, 1));
- int a = REGNO_POINTER_ALIGN (REGNO (XEXP (tmp, 0)));
-
- if (a > align)
- {
- if (a >= 8 && c % 8 == 0)
- align = 8;
- else if (a >= 4 && c % 4 == 0)
- align = 4;
- else if (a >= 2 && c % 2 == 0)
- align = 2;
- }
- }
- else if (GET_CODE (tmp) == ADDRESSOF)
- {
- enum machine_mode mode;
-
- mode = mode_for_size (bytes * BITS_PER_UNIT, MODE_INT, 1);
- if (GET_MODE (XEXP (tmp, 0)) == mode)
- {
- emit_move_insn (XEXP (tmp, 0), const0_rtx);
- return 1;
- }
-
- /* No appropriate mode; fall back on memory. */
- orig_dst = change_address (orig_dst, GET_MODE (orig_dst),
- copy_addr_to_reg (tmp));
- align = GET_MODE_SIZE (GET_MODE (XEXP (tmp, 0)));
- }
-
- /* Handle a block of contiguous words first. */
-
- if (align >= 8 && bytes >= 8)
- {
- words = bytes / 8;
-
- for (i = 0; i < words; ++i)
- {
- emit_move_insn (change_address(orig_dst, DImode,
- plus_constant (XEXP (orig_dst, 0),
- ofs + i*8)),
- const0_rtx);
- }
-
- bytes -= words * 8;
- ofs += words * 8;
- }
- if (align >= 4 && bytes >= 4)
- {
- words = bytes / 4;
-
- for (i = 0; i < words; ++i)
- {
- emit_move_insn (change_address (orig_dst, SImode,
- plus_constant (XEXP (orig_dst, 0),
- ofs + i*4)),
- const0_rtx);
- }
-
- bytes -= words * 4;
- ofs += words * 4;
- }
- if (bytes >= 16)
- {
- words = bytes / 8;
-
- alpha_expand_unaligned_store_words (NULL, orig_dst, words, ofs);
-
- bytes -= words * 8;
- ofs += words * 8;
- }
-
- /* Next clean up any trailing pieces. We know from the contiguous
- block move that there are no aligned SImode or DImode hunks left. */
-
- if (!TARGET_BWX && bytes >= 8)
- {
- alpha_expand_unaligned_store (orig_dst, const0_rtx, 8, ofs);
- bytes -= 8;
- ofs += 8;
- }
- if (!TARGET_BWX && bytes >= 4)
- {
- alpha_expand_unaligned_store (orig_dst, const0_rtx, 4, ofs);
- bytes -= 4;
- ofs += 4;
- }
- if (bytes >= 2)
- {
- if (align >= 2)
- {
- do {
- emit_move_insn (change_address (orig_dst, HImode,
- plus_constant (XEXP (orig_dst, 0),
- ofs)),
- const0_rtx);
- bytes -= 2;
- ofs += 2;
- } while (bytes >= 2);
- }
- else if (!TARGET_BWX)
- {
- alpha_expand_unaligned_store (orig_dst, const0_rtx, 2, ofs);
- bytes -= 2;
- ofs += 2;
- }
- }
- while (bytes > 0)
- {
- emit_move_insn (change_address (orig_dst, QImode,
- plus_constant (XEXP (orig_dst, 0),
- ofs)),
- const0_rtx);
- bytes -= 1;
- ofs += 1;
- }
-
- return 1;
-}
-
/* Adjust the cost of a scheduling dependency. Return the new cost of
a dependency LINK or INSN on DEP_INSN. COST is the current cost. */
@@ -2412,8 +840,7 @@ alpha_adjust_cost (insn, link, dep_insn, cost)
rtx dep_insn;
int cost;
{
- rtx set, set_src;
- enum attr_type insn_type, dep_insn_type;
+ rtx set;
/* If the dependence is an anti-dependence, there is no cost. For an
output dependence, there is sometimes a cost, but it doesn't seem
@@ -2422,224 +849,59 @@ alpha_adjust_cost (insn, link, dep_insn, cost)
if (REG_NOTE_KIND (link) != 0)
return 0;
- /* If we can't recognize the insns, we can't really do anything. */
- if (recog_memoized (insn) < 0 || recog_memoized (dep_insn) < 0)
- return cost;
-
- insn_type = get_attr_type (insn);
- dep_insn_type = get_attr_type (dep_insn);
-
- /* Bring in the user-defined memory latency. */
- if (dep_insn_type == TYPE_ILD
- || dep_insn_type == TYPE_FLD
- || dep_insn_type == TYPE_LDSYM)
- cost += alpha_memory_latency-1;
-
- switch (alpha_cpu)
- {
- case PROCESSOR_EV4:
- /* On EV4, if INSN is a store insn and DEP_INSN is setting the data
- being stored, we can sometimes lower the cost. */
-
- if ((insn_type == TYPE_IST || insn_type == TYPE_FST)
- && (set = single_set (dep_insn)) != 0
- && GET_CODE (PATTERN (insn)) == SET
- && rtx_equal_p (SET_DEST (set), SET_SRC (PATTERN (insn))))
- {
- switch (dep_insn_type)
- {
- case TYPE_ILD:
- case TYPE_FLD:
- /* No savings here. */
- return cost;
-
- case TYPE_IMUL:
- /* In these cases, we save one cycle. */
- return cost - 1;
-
- default:
- /* In all other cases, we save two cycles. */
- return MAX (0, cost - 2);
- }
- }
-
- /* Another case that needs adjustment is an arithmetic or logical
- operation. It's cost is usually one cycle, but we default it to
- two in the MD file. The only case that it is actually two is
- for the address in loads, stores, and jumps. */
-
- if (dep_insn_type == TYPE_IADD || dep_insn_type == TYPE_ILOG)
- {
- switch (insn_type)
- {
- case TYPE_ILD:
- case TYPE_IST:
- case TYPE_FLD:
- case TYPE_FST:
- case TYPE_JSR:
- return cost;
- default:
- return 1;
- }
- }
-
- /* The final case is when a compare feeds into an integer branch;
- the cost is only one cycle in that case. */
-
- if (dep_insn_type == TYPE_ICMP && insn_type == TYPE_IBR)
- return 1;
- break;
-
- case PROCESSOR_EV5:
- /* And the lord DEC saith: "A special bypass provides an effective
- latency of 0 cycles for an ICMP or ILOG insn producing the test
- operand of an IBR or ICMOV insn." */
+ /* If INSN is a store insn and DEP_INSN is setting the data being stored,
+ we can sometimes lower the cost. */
- if ((dep_insn_type == TYPE_ICMP || dep_insn_type == TYPE_ILOG)
- && (set = single_set (dep_insn)) != 0)
- {
- /* A branch only has one input. This must be it. */
- if (insn_type == TYPE_IBR)
- return 0;
- /* A conditional move has three, make sure it is the test. */
- if (insn_type == TYPE_ICMOV
- && GET_CODE (set_src = PATTERN (insn)) == SET
- && GET_CODE (set_src = SET_SRC (set_src)) == IF_THEN_ELSE
- && rtx_equal_p (SET_DEST (set), XEXP (set_src, 0)))
- return 0;
- }
+ if (recog_memoized (insn) >= 0 && get_attr_type (insn) == TYPE_ST
+ && (set = single_set (dep_insn)) != 0
+ && GET_CODE (PATTERN (insn)) == SET
+ && rtx_equal_p (SET_DEST (set), SET_SRC (PATTERN (insn))))
+ switch (get_attr_type (dep_insn))
+ {
+ case TYPE_LD:
+ /* No savings here. */
+ return cost;
+
+ case TYPE_IMULL:
+ case TYPE_IMULQ:
+ /* In these cases, we save one cycle. */
+ return cost - 2;
+
+ default:
+ /* In all other cases, we save two cycles. */
+ return MAX (0, cost - 4);
+ }
- /* "The multiplier is unable to receive data from IEU bypass paths.
- The instruction issues at the expected time, but its latency is
- increased by the time it takes for the input data to become
- available to the multiplier" -- which happens in pipeline stage
- six, when results are comitted to the register file. */
+ /* Another case that needs adjustment is an arithmetic or logical
+ operation. It's cost is usually one cycle, but we default it to
+ two in the MD file. The only case that it is actually two is
+ for the address in loads and stores. */
- if (insn_type == TYPE_IMUL)
- {
- switch (dep_insn_type)
- {
- /* These insns produce their results in pipeline stage five. */
- case TYPE_ILD:
- case TYPE_ICMOV:
- case TYPE_IMUL:
- case TYPE_MVI:
- return cost + 1;
-
- /* Other integer insns produce results in pipeline stage four. */
- default:
- return cost + 2;
- }
- }
- break;
+ if (recog_memoized (dep_insn) >= 0
+ && get_attr_type (dep_insn) == TYPE_IADDLOG)
+ switch (get_attr_type (insn))
+ {
+ case TYPE_LD:
+ case TYPE_ST:
+ return cost;
- case PROCESSOR_EV6:
- /* There is additional latency to move the result of (most) FP
- operations anywhere but the FP register file. */
+ default:
+ return 2;
+ }
- if ((insn_type == TYPE_FST || insn_type == TYPE_FTOI)
- && (dep_insn_type == TYPE_FADD ||
- dep_insn_type == TYPE_FMUL ||
- dep_insn_type == TYPE_FCMOV))
- return cost + 2;
+ /* The final case is when a compare feeds into an integer branch. The cost
+ is only one cycle in that case. */
- break;
- }
+ if (recog_memoized (dep_insn) >= 0
+ && get_attr_type (dep_insn) == TYPE_ICMP
+ && recog_memoized (insn) >= 0
+ && get_attr_type (insn) == TYPE_IBR)
+ return 2;
/* Otherwise, return the default cost. */
- return cost;
-}
-
-/* Functions to save and restore alpha_return_addr_rtx. */
-
-struct machine_function
-{
- rtx ra_rtx;
-};
-
-static void
-alpha_save_machine_status (p)
- struct function *p;
-{
- struct machine_function *machine =
- (struct machine_function *) xmalloc (sizeof (struct machine_function));
-
- p->machine = machine;
- machine->ra_rtx = alpha_return_addr_rtx;
-}
-
-static void
-alpha_restore_machine_status (p)
- struct function *p;
-{
- struct machine_function *machine = p->machine;
-
- alpha_return_addr_rtx = machine->ra_rtx;
-
- free (machine);
- p->machine = (struct machine_function *)0;
-}
-/* Do anything needed before RTL is emitted for each function. */
-
-void
-alpha_init_expanders ()
-{
- alpha_return_addr_rtx = NULL_RTX;
- alpha_eh_epilogue_sp_ofs = NULL_RTX;
-
- /* Arrange to save and restore machine status around nested functions. */
- save_machine_status = alpha_save_machine_status;
- restore_machine_status = alpha_restore_machine_status;
-}
-
-/* Start the ball rolling with RETURN_ADDR_RTX. */
-
-rtx
-alpha_return_addr (count, frame)
- int count;
- rtx frame ATTRIBUTE_UNUSED;
-{
- rtx init;
-
- if (count != 0)
- return const0_rtx;
-
- if (alpha_return_addr_rtx)
- return alpha_return_addr_rtx;
-
- /* No rtx yet. Invent one, and initialize it from $26 in the prologue. */
- alpha_return_addr_rtx = gen_reg_rtx (Pmode);
- init = gen_rtx_SET (VOIDmode, alpha_return_addr_rtx,
- gen_rtx_REG (Pmode, REG_RA));
-
- /* Emit the insn to the prologue with the other argument copies. */
- push_topmost_sequence ();
- emit_insn_after (init, get_insns ());
- pop_topmost_sequence ();
-
- return alpha_return_addr_rtx;
-}
-
-static int
-alpha_ra_ever_killed ()
-{
- rtx top;
-
-#ifdef ASM_OUTPUT_MI_THUNK
- if (current_function_is_thunk)
- return 0;
-#endif
- if (!alpha_return_addr_rtx)
- return regs_ever_live[REG_RA];
-
- push_topmost_sequence ();
- top = get_insns ();
- pop_topmost_sequence ();
-
- return reg_set_between_p (gen_rtx_REG (Pmode, REG_RA), top, NULL_RTX);
+ return cost;
}
-
/* Print an operand. Recognize special options, documented below. */
@@ -2653,115 +915,6 @@ print_operand (file, x, code)
switch (code)
{
- case '&':
- /* Generates fp-rounding mode suffix: nothing for normal, 'c' for
- chopped, 'm' for minus-infinity, and 'd' for dynamic rounding
- mode. alpha_fprm controls which suffix is generated. */
- switch (alpha_fprm)
- {
- case ALPHA_FPRM_NORM:
- break;
- case ALPHA_FPRM_MINF:
- fputc ('m', file);
- break;
- case ALPHA_FPRM_CHOP:
- fputc ('c', file);
- break;
- case ALPHA_FPRM_DYN:
- fputc ('d', file);
- break;
- }
- break;
-
- case '\'':
- /* Generates trap-mode suffix for instructions that accept the su
- suffix only (cmpt et al). */
- if (alpha_tp == ALPHA_TP_INSN)
- fputs ("su", file);
- break;
-
- case '`':
- /* Generates trap-mode suffix for instructions that accept the
- v and sv suffix. The only instruction that needs this is cvtql. */
- switch (alpha_fptm)
- {
- case ALPHA_FPTM_N:
- break;
- case ALPHA_FPTM_U:
- fputs ("v", file);
- break;
- case ALPHA_FPTM_SU:
- case ALPHA_FPTM_SUI:
- fputs ("sv", file);
- break;
- }
- break;
-
- case '(':
- /* Generates trap-mode suffix for instructions that accept the
- v, sv, and svi suffix. The only instruction that needs this
- is cvttq. */
- switch (alpha_fptm)
- {
- case ALPHA_FPTM_N:
- break;
- case ALPHA_FPTM_U:
- fputs ("v", file);
- break;
- case ALPHA_FPTM_SU:
- fputs ("sv", file);
- break;
- case ALPHA_FPTM_SUI:
- fputs ("svi", file);
- break;
- }
- break;
-
- case ')':
- /* Generates trap-mode suffix for instructions that accept the u, su,
- and sui suffix. This is the bulk of the IEEE floating point
- instructions (addt et al). */
- switch (alpha_fptm)
- {
- case ALPHA_FPTM_N:
- break;
- case ALPHA_FPTM_U:
- fputc ('u', file);
- break;
- case ALPHA_FPTM_SU:
- fputs ("su", file);
- break;
- case ALPHA_FPTM_SUI:
- fputs ("sui", file);
- break;
- }
- break;
-
- case '+':
- /* Generates trap-mode suffix for instructions that accept the sui
- suffix (cvtqt and cvtqs). */
- switch (alpha_fptm)
- {
- case ALPHA_FPTM_N:
- case ALPHA_FPTM_U:
- case ALPHA_FPTM_SU: /* cvtqt/cvtqs can't cause underflow */
- break;
- case ALPHA_FPTM_SUI:
- fputs ("sui", file);
- break;
- }
- break;
-
- case ',':
- /* Generates single precision instruction suffix. */
- fprintf (file, "%c", (TARGET_FLOAT_VAX ? 'f' : 's'));
- break;
-
- case '-':
- /* Generates double precision instruction suffix. */
- fprintf (file, "%c", (TARGET_FLOAT_VAX ? 'g' : 't'));
- break;
-
case 'r':
/* If this operand is the constant zero, write it as "$31". */
if (GET_CODE (x) == REG)
@@ -2789,7 +942,7 @@ print_operand (file, x, code)
if (GET_CODE (x) != CONST_INT)
output_operand_lossage ("invalid %%N value");
- fprintf (file, HOST_WIDE_INT_PRINT_DEC, ~ INTVAL (x));
+ fprintf (file, "%ld", ~ INTVAL (x));
break;
case 'P':
@@ -2797,7 +950,7 @@ print_operand (file, x, code)
if (GET_CODE (x) != CONST_INT)
output_operand_lossage ("invalid %%P value");
- fprintf (file, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT) 1 << INTVAL (x));
+ fprintf (file, "%ld", (HOST_WIDE_INT) 1 << INTVAL (x));
break;
case 'h':
@@ -2805,7 +958,7 @@ print_operand (file, x, code)
if (GET_CODE (x) != CONST_INT)
output_operand_lossage ("invalid %%h value");
- fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) >> 16);
+ fprintf (file, "%ld", INTVAL (x) >> 16);
break;
case 'L':
@@ -2813,8 +966,7 @@ print_operand (file, x, code)
if (GET_CODE (x) != CONST_INT)
output_operand_lossage ("invalid %%L value");
- fprintf (file, HOST_WIDE_INT_PRINT_DEC,
- (INTVAL (x) & 0xffff) - 2 * (INTVAL (x) & 0x8000));
+ fprintf (file, "%ld", (INTVAL (x) & 0xffff) - 2 * (INTVAL (x) & 0x8000));
break;
case 'm':
@@ -2836,7 +988,7 @@ print_operand (file, x, code)
if (value & 0xff)
mask |= (1 << (i + sizeof (int)));
- fprintf (file, HOST_WIDE_INT_PRINT_DEC, mask & 0xff);
+ fprintf (file, "%ld", mask & 0xff);
}
else if (GET_CODE (x) == CONST_INT)
@@ -2847,24 +999,20 @@ print_operand (file, x, code)
if (value & 0xff)
mask |= (1 << i);
- fprintf (file, HOST_WIDE_INT_PRINT_DEC, mask);
+ fprintf (file, "%ld", mask);
}
else
output_operand_lossage ("invalid %%m value");
break;
case 'M':
- /* 'b', 'w', 'l', or 'q' as the value of the constant. */
+ /* 'b', 'w', or 'l' as the value of the constant. */
if (GET_CODE (x) != CONST_INT
- || (INTVAL (x) != 8 && INTVAL (x) != 16
- && INTVAL (x) != 32 && INTVAL (x) != 64))
+ || (INTVAL (x) != 8 && INTVAL (x) != 16 && INTVAL (x) != 32))
output_operand_lossage ("invalid %%M value");
fprintf (file, "%s",
- (INTVAL (x) == 8 ? "b"
- : INTVAL (x) == 16 ? "w"
- : INTVAL (x) == 32 ? "l"
- : "q"));
+ INTVAL (x) == 8 ? "b" : INTVAL (x) == 16 ? "w" : "l");
break;
case 'U':
@@ -2873,24 +1021,14 @@ print_operand (file, x, code)
fprintf (file, "b");
else if (GET_CODE (x) == CONST_INT && INTVAL (x) == 0xffff)
fprintf (file, "w");
- else if (GET_CODE (x) == CONST_INT && INTVAL (x) == 0xffffffff)
- fprintf (file, "l");
#if HOST_BITS_PER_WIDE_INT == 32
else if (GET_CODE (x) == CONST_DOUBLE
&& CONST_DOUBLE_HIGH (x) == 0
&& CONST_DOUBLE_LOW (x) == -1)
fprintf (file, "l");
- else if (GET_CODE (x) == CONST_DOUBLE
- && CONST_DOUBLE_HIGH (x) == -1
- && CONST_DOUBLE_LOW (x) == -1)
- fprintf (file, "q");
#else
- else if (GET_CODE (x) == CONST_INT && INTVAL (x) == -1)
- fprintf (file, "q");
- else if (GET_CODE (x) == CONST_DOUBLE
- && CONST_DOUBLE_HIGH (x) == 0
- && CONST_DOUBLE_LOW (x) == -1)
- fprintf (file, "q");
+ else if (GET_CODE (x) == CONST_INT && INTVAL (x) == 0xffffffff)
+ fprintf (file, "l");
#endif
else
output_operand_lossage ("invalid %%U value");
@@ -2903,7 +1041,7 @@ print_operand (file, x, code)
&& (INTVAL (x) & 7) != 8)
output_operand_lossage ("invalid %%s value");
- fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) / 8);
+ fprintf (file, "%ld", INTVAL (x) / 8);
break;
case 'S':
@@ -2914,31 +1052,46 @@ print_operand (file, x, code)
&& (INTVAL (x) & 7) != 8)
output_operand_lossage ("invalid %%s value");
- fprintf (file, HOST_WIDE_INT_PRINT_DEC, (64 - INTVAL (x)) / 8);
+ fprintf (file, "%ld", (64 - INTVAL (x)) / 8);
break;
- case 'C': case 'D': case 'c': case 'd':
+ case 'C':
/* Write out comparison name. */
- {
- enum rtx_code c = GET_CODE (x);
-
- if (GET_RTX_CLASS (c) != '<')
- output_operand_lossage ("invalid %%C value");
-
- if (code == 'D')
- c = reverse_condition (c);
- else if (code == 'c')
- c = swap_condition (c);
- else if (code == 'd')
- c = swap_condition (reverse_condition (c));
-
- if (c == LEU)
- fprintf (file, "ule");
- else if (c == LTU)
- fprintf (file, "ult");
- else
- fprintf (file, "%s", GET_RTX_NAME (c));
- }
+ if (GET_RTX_CLASS (GET_CODE (x)) != '<')
+ output_operand_lossage ("invalid %%C value");
+
+ if (GET_CODE (x) == LEU)
+ fprintf (file, "ule");
+ else if (GET_CODE (x) == LTU)
+ fprintf (file, "ult");
+ else
+ fprintf (file, "%s", GET_RTX_NAME (GET_CODE (x)));
+ break;
+
+ case 'D':
+ /* Similar, but write reversed code. We can't get an unsigned code
+ here. */
+ if (GET_RTX_CLASS (GET_CODE (x)) != '<')
+ output_operand_lossage ("invalid %%D value");
+
+ fprintf (file, "%s", GET_RTX_NAME (reverse_condition (GET_CODE (x))));
+ break;
+
+ case 'c':
+ /* Similar to `c', but swap. We can't get unsigned here either. */
+ if (GET_RTX_CLASS (GET_CODE (x)) != '<')
+ output_operand_lossage ("invalid %%D value");
+
+ fprintf (file, "%s", GET_RTX_NAME (swap_condition (GET_CODE (x))));
+ break;
+
+ case 'd':
+ /* Similar, but reverse and swap. We can't get unsigned here either. */
+ if (GET_RTX_CLASS (GET_CODE (x)) != '<')
+ output_operand_lossage ("invalid %%D value");
+
+ fprintf (file, "%s",
+ GET_RTX_NAME (swap_condition (reverse_condition ((GET_CODE (x))))));
break;
case 'E':
@@ -2982,100 +1135,6 @@ print_operand (file, x, code)
output_operand_lossage ("invalid %%xn code");
}
}
-
-void
-print_operand_address (file, addr)
- FILE *file;
- rtx addr;
-{
- int basereg = 31;
- HOST_WIDE_INT offset = 0;
-
- if (GET_CODE (addr) == AND)
- addr = XEXP (addr, 0);
-
- if (GET_CODE (addr) == PLUS
- && GET_CODE (XEXP (addr, 1)) == CONST_INT)
- {
- offset = INTVAL (XEXP (addr, 1));
- addr = XEXP (addr, 0);
- }
- if (GET_CODE (addr) == REG)
- basereg = REGNO (addr);
- else if (GET_CODE (addr) == SUBREG
- && GET_CODE (SUBREG_REG (addr)) == REG)
- basereg = REGNO (SUBREG_REG (addr)) + SUBREG_WORD (addr);
- else if (GET_CODE (addr) == CONST_INT)
- offset = INTVAL (addr);
- else
- abort ();
-
- fprintf (file, HOST_WIDE_INT_PRINT_DEC, offset);
- fprintf (file, "($%d)", basereg);
-}
-
-/* Emit RTL insns to initialize the variable parts of a trampoline at
- TRAMP. FNADDR is an RTX for the address of the function's pure
- code. CXT is an RTX for the static chain value for the function.
-
- The three offset parameters are for the individual template's
- layout. A JMPOFS < 0 indicates that the trampoline does not
- contain instructions at all.
-
- We assume here that a function will be called many more times than
- its address is taken (e.g., it might be passed to qsort), so we
- take the trouble to initialize the "hint" field in the JMP insn.
- Note that the hint field is PC (new) + 4 * bits 13:0. */
-
-void
-alpha_initialize_trampoline (tramp, fnaddr, cxt, fnofs, cxtofs, jmpofs)
- rtx tramp, fnaddr, cxt;
- int fnofs, cxtofs, jmpofs;
-{
- rtx temp, temp1, addr;
- /* VMS really uses DImode pointers in memory at this point. */
- enum machine_mode mode = TARGET_OPEN_VMS ? Pmode : ptr_mode;
-
-#ifdef POINTERS_EXTEND_UNSIGNED
- fnaddr = convert_memory_address (mode, fnaddr);
- cxt = convert_memory_address (mode, cxt);
-#endif
-
- /* Store function address and CXT. */
- addr = memory_address (mode, plus_constant (tramp, fnofs));
- emit_move_insn (gen_rtx (MEM, mode, addr), fnaddr);
- addr = memory_address (mode, plus_constant (tramp, cxtofs));
- emit_move_insn (gen_rtx (MEM, mode, addr), cxt);
-
- /* This has been disabled since the hint only has a 32k range, and in
- no existing OS is the stack within 32k of the text segment. */
- if (0 && jmpofs >= 0)
- {
- /* Compute hint value. */
- temp = force_operand (plus_constant (tramp, jmpofs+4), NULL_RTX);
- temp = expand_binop (DImode, sub_optab, fnaddr, temp, temp, 1,
- OPTAB_WIDEN);
- temp = expand_shift (RSHIFT_EXPR, Pmode, temp,
- build_int_2 (2, 0), NULL_RTX, 1);
- temp = expand_and (gen_lowpart (SImode, temp), GEN_INT (0x3fff), 0);
-
- /* Merge in the hint. */
- addr = memory_address (SImode, plus_constant (tramp, jmpofs));
- temp1 = force_reg (SImode, gen_rtx (MEM, SImode, addr));
- temp1 = expand_and (temp1, GEN_INT (0xffffc000), NULL_RTX);
- temp1 = expand_binop (SImode, ior_optab, temp1, temp, temp1, 1,
- OPTAB_WIDEN);
- emit_move_insn (gen_rtx (MEM, SImode, addr), temp1);
- }
-
-#ifdef TRANSFER_FROM_TRAMPOLINE
- emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"),
- 0, VOIDmode, 1, addr, Pmode);
-#endif
-
- if (jmpofs >= 0)
- emit_insn (gen_imb ());
-}
/* Do what is necessary for `va_start'. The argument is ignored;
We look at the current function to determine if stdarg or varargs
@@ -3084,9 +1143,9 @@ alpha_initialize_trampoline (tramp, fnaddr, cxt, fnofs, cxtofs, jmpofs)
struct rtx_def *
alpha_builtin_saveregs (arglist)
- tree arglist ATTRIBUTE_UNUSED;
+ tree arglist;
{
- rtx block, addr, dest, argsize;
+ rtx block, addr, argsize;
tree fntype = TREE_TYPE (current_function_decl);
int stdarg = (TYPE_ARG_TYPES (fntype) != 0
&& (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
@@ -3094,11 +1153,11 @@ alpha_builtin_saveregs (arglist)
/* Compute the current position into the args, taking into account
both registers and memory. Both of these are already included in
- NUM_ARGS. */
+ current_function_args_info. */
- argsize = GEN_INT (NUM_ARGS * UNITS_PER_WORD);
+ argsize = GEN_INT (current_function_args_info * UNITS_PER_WORD);
- /* For Unix, SETUP_INCOMING_VARARGS moves the starting address base up by 48,
+ /* SETUP_INCOMING_VARARGS moves the starting address base up by 48,
storing fp arg registers in the first 48 bytes, and the integer arg
registers in the next 48 bytes. This is only done, however, if any
integer registers need to be stored.
@@ -3107,71 +1166,35 @@ alpha_builtin_saveregs (arglist)
order to account for the integer arg registers which are counted in
argsize above, but which are not actually stored on the stack. */
- if (TARGET_OPEN_VMS)
- addr = plus_constant (virtual_incoming_args_rtx,
- NUM_ARGS <= 5 + stdarg
- ? UNITS_PER_WORD : - 6 * UNITS_PER_WORD);
- else
- addr = (NUM_ARGS <= 5 + stdarg
- ? plus_constant (virtual_incoming_args_rtx,
- 6 * UNITS_PER_WORD)
- : plus_constant (virtual_incoming_args_rtx,
- - (6 * UNITS_PER_WORD)));
-
- /* For VMS, we include the argsize, while on Unix, it's handled as
- a separate field. */
- if (TARGET_OPEN_VMS)
- addr = plus_constant (addr, INTVAL (argsize));
+ addr = (current_function_args_info <= 5 + stdarg
+ ? plus_constant (virtual_incoming_args_rtx, 6 * UNITS_PER_WORD)
+ : plus_constant (virtual_incoming_args_rtx, - (6 * UNITS_PER_WORD)));
addr = force_operand (addr, NULL_RTX);
+ /* Allocate the va_list constructor */
+ block = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD);
+ RTX_UNCHANGING_P (block) = 1;
+ RTX_UNCHANGING_P (XEXP (block, 0)) = 1;
+
+ /* Store the address of the first integer register in the __base member. */
+
#ifdef POINTERS_EXTEND_UNSIGNED
addr = convert_memory_address (ptr_mode, addr);
#endif
- if (TARGET_OPEN_VMS)
- return addr;
- else
- {
- /* Allocate the va_list constructor */
- block = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD);
- RTX_UNCHANGING_P (block) = 1;
- RTX_UNCHANGING_P (XEXP (block, 0)) = 1;
-
- /* Store the address of the first integer register in the __base
- member. */
-
- dest = change_address (block, ptr_mode, XEXP (block, 0));
- emit_move_insn (dest, addr);
-
- if (current_function_check_memory_usage)
- emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
- dest, ptr_mode,
- GEN_INT (GET_MODE_SIZE (ptr_mode)),
- TYPE_MODE (sizetype),
- GEN_INT (MEMORY_USE_RW),
- TYPE_MODE (integer_type_node));
-
- /* Store the argsize as the __va_offset member. */
- dest = change_address (block, TYPE_MODE (integer_type_node),
- plus_constant (XEXP (block, 0),
- POINTER_SIZE/BITS_PER_UNIT));
- emit_move_insn (dest, argsize);
-
- if (current_function_check_memory_usage)
- emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
- dest, ptr_mode,
- GEN_INT (GET_MODE_SIZE
- (TYPE_MODE (integer_type_node))),
- TYPE_MODE (sizetype),
- GEN_INT (MEMORY_USE_RW),
- TYPE_MODE (integer_type_node));
-
- /* Return the address of the va_list constructor, but don't put it in a
- register. Doing so would fail when not optimizing and produce worse
- code when optimizing. */
- return XEXP (block, 0);
- }
+ emit_move_insn (change_address (block, ptr_mode, XEXP (block, 0)), addr);
+
+ /* Store the argsize as the __va_offset member. */
+ emit_move_insn (change_address (block, TYPE_MODE (integer_type_node),
+ plus_constant (XEXP (block, 0),
+ POINTER_SIZE/BITS_PER_UNIT)),
+ argsize);
+
+ /* Return the address of the va_list constructor, but don't put it in a
+ register. Doing so would fail when not optimizing and produce worse
+ code when optimizing. */
+ return XEXP (block, 0);
}
/* This page contains routines that are used to determine what the function
@@ -3179,293 +1202,195 @@ alpha_builtin_saveregs (arglist)
/* Compute the size of the save area in the stack. */
-/* These variables are used for communication between the following functions.
- They indicate various things about the current function being compiled
- that are used to tell what kind of prologue, epilogue and procedure
- descriptior to generate. */
-
-/* Nonzero if we need a stack procedure. */
-static int vms_is_stack_procedure;
-
-/* Register number (either FP or SP) that is used to unwind the frame. */
-static int vms_unwind_regno;
-
-/* Register number used to save FP. We need not have one for RA since
- we don't modify it for register procedures. This is only defined
- for register frame procedures. */
-static int vms_save_fp_regno;
-
-/* Register number used to reference objects off our PV. */
-static int vms_base_regno;
-
-/* Compute register masks for saved registers. */
-
-static void
-alpha_sa_mask (imaskP, fmaskP)
- unsigned long *imaskP;
- unsigned long *fmaskP;
-{
- unsigned long imask = 0;
- unsigned long fmask = 0;
- int i;
-
-#ifdef ASM_OUTPUT_MI_THUNK
- if (!current_function_is_thunk)
-#endif
- {
- if (TARGET_OPEN_VMS && vms_is_stack_procedure)
- imask |= (1L << HARD_FRAME_POINTER_REGNUM);
-
- /* One for every register we have to save. */
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (! fixed_regs[i] && ! call_used_regs[i]
- && regs_ever_live[i] && i != REG_RA)
- {
- if (i < 32)
- imask |= (1L << i);
- else
- fmask |= (1L << (i - 32));
- }
-
- if (imask || fmask || alpha_ra_ever_killed ())
- imask |= (1L << REG_RA);
- }
-
- *imaskP = imask;
- *fmaskP = fmask;
-}
-
int
alpha_sa_size ()
{
- int sa_size = 0;
+ int size = 0;
int i;
-#ifdef ASM_OUTPUT_MI_THUNK
- if (current_function_is_thunk)
- sa_size = 0;
- else
-#endif
- {
- /* One for every register we have to save. */
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (! fixed_regs[i] && ! call_used_regs[i]
- && regs_ever_live[i] && i != REG_RA)
- sa_size++;
- }
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (! fixed_regs[i] && ! call_used_regs[i] && regs_ever_live[i])
+ size++;
- if (TARGET_OPEN_VMS)
- {
- /* Start by assuming we can use a register procedure if we don't
- make any calls (REG_RA not used) or need to save any
- registers and a stack procedure if we do. */
- vms_is_stack_procedure = sa_size != 0 || alpha_ra_ever_killed ();
-
- /* Decide whether to refer to objects off our PV via FP or PV.
- If we need FP for something else or if we receive a nonlocal
- goto (which expects PV to contain the value), we must use PV.
- Otherwise, start by assuming we can use FP. */
- vms_base_regno = (frame_pointer_needed
- || current_function_has_nonlocal_label
- || vms_is_stack_procedure
- || current_function_outgoing_args_size
- ? REG_PV : HARD_FRAME_POINTER_REGNUM);
-
- /* If we want to copy PV into FP, we need to find some register
- in which to save FP. */
-
- vms_save_fp_regno = -1;
- if (vms_base_regno == HARD_FRAME_POINTER_REGNUM)
- for (i = 0; i < 32; i++)
- if (! fixed_regs[i] && call_used_regs[i] && ! regs_ever_live[i])
- vms_save_fp_regno = i;
-
- if (vms_save_fp_regno == -1)
- vms_base_regno = REG_PV, vms_is_stack_procedure = 1;
-
- /* Stack unwinding should be done via FP unless we use it for PV. */
- vms_unwind_regno = (vms_base_regno == REG_PV
- ? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM);
-
- /* If this is a stack procedure, allow space for saving FP and RA. */
- if (vms_is_stack_procedure)
- sa_size += 2;
- }
- else
- {
- /* If some registers were saved but not RA, RA must also be saved,
- so leave space for it. */
- if (sa_size != 0 || alpha_ra_ever_killed ())
- sa_size++;
-
- /* Our size must be even (multiple of 16 bytes). */
- if (sa_size & 1)
- sa_size++;
- }
+ /* If some registers were saved but not reg 26, reg 26 must also
+ be saved, so leave space for it. */
+ if (size != 0 && ! regs_ever_live[26])
+ size++;
- return sa_size * 8;
-}
+ /* Our size must be even (multiple of 16 bytes). */
+ if (size & 1)
+ size ++;
-int
-alpha_pv_save_size ()
-{
- alpha_sa_size ();
- return vms_is_stack_procedure ? 8 : 0;
+ return size * 8;
}
-int
-alpha_using_fp ()
-{
- alpha_sa_size ();
- return vms_unwind_regno == HARD_FRAME_POINTER_REGNUM;
-}
+/* Return 1 if this function can directly return via $26. */
int
-vms_valid_decl_attribute_p (decl, attributes, identifier, args)
- tree decl ATTRIBUTE_UNUSED;
- tree attributes ATTRIBUTE_UNUSED;
- tree identifier;
- tree args;
-{
- if (is_attribute_p ("overlaid", identifier))
- return (args == NULL_TREE);
- return 0;
-}
-
-static int
-alpha_does_function_need_gp ()
+direct_return ()
{
- rtx insn;
-
- /* We never need a GP for Windows/NT or VMS. */
- if (TARGET_WINDOWS_NT || TARGET_OPEN_VMS)
- return 0;
-
-#ifdef TARGET_PROFILING_NEEDS_GP
- if (profile_flag)
- return 1;
-#endif
-
-#ifdef ASM_OUTPUT_MI_THUNK
- if (current_function_is_thunk)
- return 1;
-#endif
-
- /* If we need a GP (we have a LDSYM insn or a CALL_INSN), load it first.
- Even if we are a static function, we still need to do this in case
- our address is taken and passed to something like qsort. */
-
- push_topmost_sequence ();
- insn = get_insns ();
- pop_topmost_sequence ();
-
- for (; insn; insn = NEXT_INSN (insn))
- if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
- && GET_CODE (PATTERN (insn)) != USE
- && GET_CODE (PATTERN (insn)) != CLOBBER)
- {
- enum attr_type type = get_attr_type (insn);
- if (type == TYPE_LDSYM || type == TYPE_JSR)
- return 1;
- }
-
- return 0;
+ return (reload_completed && alpha_sa_size () == 0
+ && get_frame_size () == 0
+ && current_function_outgoing_args_size == 0
+ && current_function_pretend_args_size == 0);
}
/* Write a version stamp. Don't write anything if we are running as a
cross-compiler. Otherwise, use the versions in /usr/include/stamp.h. */
-#ifdef HAVE_STAMP_H
+#if !defined(CROSS_COMPILE) && !defined(_WIN32) && \
+ !defined(__NetBSD__) && !defined(__FreeBSD__)
#include <stamp.h>
#endif
void
alpha_write_verstamp (file)
- FILE *file ATTRIBUTE_UNUSED;
+ FILE *file;
{
#ifdef MS_STAMP
fprintf (file, "\t.verstamp %d %d\n", MS_STAMP, LS_STAMP);
#endif
}
-/* Helper function to set RTX_FRAME_RELATED_P on instructions, including
- sequences. */
+/* Write code to add constant C to register number IN_REG (possibly 31)
+ and put the result into OUT_REG. Use TEMP_REG as a scratch register;
+ usually this will be OUT_REG, but should not be if OUT_REG is
+ STACK_POINTER_REGNUM, since it must be updated in a single instruction.
+ Write the code to FILE. */
-static rtx
-set_frame_related_p ()
+static void
+add_long_const (file, c, in_reg, out_reg, temp_reg)
+ FILE *file;
+ HOST_WIDE_INT c;
+ int in_reg, out_reg, temp_reg;
{
- rtx seq = gen_sequence ();
- end_sequence ();
+ HOST_WIDE_INT low = (c & 0xffff) - 2 * (c & 0x8000);
+ HOST_WIDE_INT tmp1 = c - low;
+ HOST_WIDE_INT high = ((tmp1 >> 16) & 0xffff) - 2 * ((tmp1 >> 16) & 0x8000);
+ HOST_WIDE_INT extra = 0;
- if (GET_CODE (seq) == SEQUENCE)
+ /* We don't have code to write out constants larger than 32 bits. */
+#if HOST_BITS_PER_LONG_INT == 64
+ if ((unsigned HOST_WIDE_INT) c >> 32 != 0)
+ abort ();
+#endif
+
+ /* If HIGH will be interpreted as negative, we must adjust it to do two
+ ldha insns. Note that we will never be building a negative constant
+ here. */
+
+ if (high & 0x8000)
{
- int i = XVECLEN (seq, 0);
- while (--i >= 0)
- RTX_FRAME_RELATED_P (XVECEXP (seq, 0, i)) = 1;
- return emit_insn (seq);
+ extra = 0x4000;
+ tmp1 -= 0x40000000;
+ high = ((tmp1 >> 16) & 0xffff) - 2 * ((tmp1 >> 16) & 0x8000);
}
- else
+
+ if (low != 0)
{
- seq = emit_insn (seq);
- RTX_FRAME_RELATED_P (seq) = 1;
- return seq;
- }
-}
+ int result_reg = (extra == 0 && high == 0) ? out_reg : temp_reg;
-#define FRP(exp) (start_sequence (), exp, set_frame_related_p ())
+ if (low >= 0 && low < 255)
+ fprintf (file, "\taddq $%d,%d,$%d\n", in_reg, low, result_reg);
+ else
+ fprintf (file, "\tlda $%d,%d($%d)\n", result_reg, low, in_reg);
-/* Write function prologue. */
+ in_reg = result_reg;
+ }
-/* On vms we have two kinds of functions:
+ if (extra)
+ {
+ int result_reg = (high == 0) ? out_reg : temp_reg;
- - stack frame (PROC_STACK)
- these are 'normal' functions with local vars and which are
- calling other functions
- - register frame (PROC_REGISTER)
- keeps all data in registers, needs no stack
+ fprintf (file, "\tldah $%d,%d($%d)\n", result_reg, extra, in_reg);
+ in_reg = result_reg;
+ }
- We must pass this to the assembler so it can generate the
- proper pdsc (procedure descriptor)
- This is done with the '.pdesc' command.
+ if (high)
+ fprintf (file, "\tldah $%d,%d($%d)\n", out_reg, high, in_reg);
+}
- On not-vms, we don't really differentiate between the two, as we can
- simply allocate stack without saving registers. */
+/* Write function prologue. */
void
-alpha_expand_prologue ()
-{
- /* Registers to save. */
- unsigned long imask = 0;
- unsigned long fmask = 0;
- /* Stack space needed for pushing registers clobbered by us. */
- HOST_WIDE_INT sa_size;
- /* Complete stack size needed. */
- HOST_WIDE_INT frame_size;
- /* Offset from base reg to register save area. */
- HOST_WIDE_INT reg_offset;
- rtx sa_reg, mem;
+output_prolog (file, size)
+ FILE *file;
+ int size;
+{
+ HOST_WIDE_INT out_args_size
+ = ALPHA_ROUND (current_function_outgoing_args_size);
+ HOST_WIDE_INT sa_size = alpha_sa_size ();
+ HOST_WIDE_INT frame_size
+ = (out_args_size + sa_size
+ + ALPHA_ROUND (size + current_function_pretend_args_size));
+ HOST_WIDE_INT reg_offset = out_args_size;
+ HOST_WIDE_INT start_reg_offset = reg_offset;
+ HOST_WIDE_INT actual_start_reg_offset = start_reg_offset;
+ int int_reg_save_area_size = 0;
+ rtx insn;
+ unsigned reg_mask = 0;
int i;
- sa_size = alpha_sa_size ();
+ /* Ecoff can handle multiple .file directives, so put out file and lineno.
+ We have to do that before the .ent directive as we cannot switch
+ files within procedures with native ecoff because line numbers are
+ linked to procedure descriptors.
+ Outputting the lineno helps debugging of one line functions as they
+ would otherwise get no line number at all. Please note that we would
+ like to put out last_linenum from final.c, but it is not accessible. */
- frame_size = get_frame_size ();
- if (TARGET_OPEN_VMS)
- frame_size = ALPHA_ROUND (sa_size
- + (vms_is_stack_procedure ? 8 : 0)
- + frame_size
- + current_function_pretend_args_size);
- else
- frame_size = (ALPHA_ROUND (current_function_outgoing_args_size)
- + sa_size
- + ALPHA_ROUND (frame_size
- + current_function_pretend_args_size));
+ if (write_symbols == SDB_DEBUG)
+ {
+ ASM_OUTPUT_SOURCE_FILENAME (file,
+ DECL_SOURCE_FILE (current_function_decl));
+ if (debug_info_level != DINFO_LEVEL_TERSE)
+ ASM_OUTPUT_SOURCE_LINE (file,
+ DECL_SOURCE_LINE (current_function_decl));
+ }
- if (TARGET_OPEN_VMS)
- reg_offset = 8;
- else
- reg_offset = ALPHA_ROUND (current_function_outgoing_args_size);
+ /* The assembly language programmer's guide states that the second argument
+ to the .ent directive, the lex_level, is ignored by the assembler,
+ so we might as well omit it. */
+
+ fprintf (file, "\t.ent ");
+ assemble_name (file, alpha_function_name);
+ fprintf (file, "\n");
+ ASM_OUTPUT_LABEL (file, alpha_function_name);
+ inside_function = TRUE;
- alpha_sa_mask (&imask, &fmask);
+ /* Set up offsets to alpha virtual arg/local debugging pointer. */
+
+ alpha_auto_offset = -frame_size + current_function_pretend_args_size;
+ alpha_arg_offset = -frame_size + 48;
+
+ /* If we need a GP (we have a LDSYM insn or a CALL_INSN), load it first.
+ Even if we are a static function, we still need to do this in case
+ our address is taken and passed to something like qsort.
+
+ We never need a GP for Windows/NT. */
+
+ alpha_function_needs_gp = 0;
+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ if ((GET_CODE (insn) == CALL_INSN)
+ || (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
+ && GET_CODE (PATTERN (insn)) != USE
+ && GET_CODE (PATTERN (insn)) != CLOBBER
+ && (get_attr_type (insn) == TYPE_LDSYM
+ || get_attr_type (insn) == TYPE_ISUBR)))
+ {
+ alpha_function_needs_gp = 1;
+ break;
+ }
+
+ if (WINDOWS_NT == 0)
+ {
+ if (alpha_function_needs_gp)
+ fprintf (file, "\tldgp $29,0($27)\n");
+
+ /* Put a label after the GP load so we can enter the function at it. */
+ assemble_name (file, alpha_function_name);
+ fprintf (file, "..ng:\n");
+ }
/* Adjust the stack by the frame size. If the frame size is > 4096
bytes, we need to be sure we probe somewhere in the first and last
@@ -3476,30 +1401,28 @@ alpha_expand_prologue ()
Note that we are only allowed to adjust sp once in the prologue. */
- if (frame_size <= 32768)
+ if (frame_size < 32768)
{
if (frame_size > 4096)
{
int probed = 4096;
- do
- emit_insn (gen_probe_stack (GEN_INT (-probed)));
- while ((probed += 8192) < frame_size);
+ fprintf (file, "\tstq $31,-%d($30)\n", probed);
+
+ while (probed + 8192 < frame_size)
+ fprintf (file, "\tstq $31,-%d($30)\n", probed += 8192);
/* We only have to do this probe if we aren't saving registers. */
if (sa_size == 0 && probed + 4096 < frame_size)
- emit_insn (gen_probe_stack (GEN_INT (-frame_size)));
+ fprintf (file, "\tstq $31,-%d($30)\n", frame_size);
}
if (frame_size != 0)
- {
- FRP (emit_insn (gen_adddi3 (stack_pointer_rtx, stack_pointer_rtx,
- GEN_INT (-frame_size))));
- }
+ fprintf (file, "\tlda $30,-%d($30)\n", frame_size);
}
else
{
- /* Here we generate code to set R22 to SP + 4096 and set R23 to the
+ /* Here we generate code to set R4 to SP + 4096 and set R5 to the
number of 8192 byte blocks to probe. We then probe each block
in the loop and then set SP to the proper location. If the
amount remaining is > 4096, we have to do one more probe if we
@@ -3507,588 +1430,182 @@ alpha_expand_prologue ()
HOST_WIDE_INT blocks = (frame_size + 4096) / 8192;
HOST_WIDE_INT leftover = frame_size + 4096 - blocks * 8192;
- rtx ptr = gen_rtx_REG (DImode, 22);
- rtx count = gen_rtx_REG (DImode, 23);
- rtx seq;
- emit_move_insn (count, GEN_INT (blocks));
- emit_insn (gen_adddi3 (ptr, stack_pointer_rtx, GEN_INT (4096)));
+ add_long_const (file, blocks, 31, 5, 5);
- /* Because of the difficulty in emitting a new basic block this
- late in the compilation, generate the loop as a single insn. */
- emit_insn (gen_prologue_stack_probe_loop (count, ptr));
+ fprintf (file, "\tlda $4,4096($30)\n");
- if (leftover > 4096 && sa_size == 0)
- {
- rtx last = gen_rtx_MEM (DImode, plus_constant (ptr, -leftover));
- MEM_VOLATILE_P (last) = 1;
- emit_move_insn (last, const0_rtx);
- }
+ assemble_name (file, alpha_function_name);
+ fprintf (file, "..sc:\n");
- if (TARGET_WINDOWS_NT)
- {
- /* For NT stack unwind (done by 'reverse execution'), it's
- not OK to take the result of a loop, even though the value
- is already in ptr, so we reload it via a single operation
- and subtract it to sp.
-
- Yes, that's correct -- we have to reload the whole constant
- into a temporary via ldah+lda then subtract from sp. To
- ensure we get ldah+lda, we use a special pattern. */
-
- HOST_WIDE_INT lo, hi;
- lo = ((frame_size & 0xffff) ^ 0x8000) - 0x8000;
- hi = frame_size - lo;
-
- emit_move_insn (ptr, GEN_INT (hi));
- emit_insn (gen_nt_lda (ptr, GEN_INT (lo)));
- seq = emit_insn (gen_subdi3 (stack_pointer_rtx, stack_pointer_rtx,
- ptr));
- }
- else
- {
- seq = emit_insn (gen_adddi3 (stack_pointer_rtx, ptr,
- GEN_INT (-leftover)));
- }
+ fprintf (file, "\tstq $31,-8192($4)\n");
+ fprintf (file, "\tsubq $5,1,$5\n");
+ fprintf (file, "\tlda $4,-8192($4)\n");
- /* This alternative is special, because the DWARF code cannot
- possibly intuit through the loop above. So we invent this
- note it looks at instead. */
- RTX_FRAME_RELATED_P (seq) = 1;
- REG_NOTES (seq)
- = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
- gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- gen_rtx_PLUS (Pmode, stack_pointer_rtx,
- GEN_INT (-frame_size))),
- REG_NOTES (seq));
- }
-
- /* Cope with very large offsets to the register save area. */
- sa_reg = stack_pointer_rtx;
- if (reg_offset + sa_size > 0x8000)
- {
- int low = ((reg_offset & 0xffff) ^ 0x8000) - 0x8000;
- HOST_WIDE_INT bias;
+ fprintf (file, "\tbne $5,");
+ assemble_name (file, alpha_function_name);
+ fprintf (file, "..sc\n");
- if (low + sa_size <= 0x8000)
- bias = reg_offset - low, reg_offset = low;
- else
- bias = reg_offset, reg_offset = 0;
+ if (leftover > 4096 && sa_size == 0)
+ fprintf (file, "\tstq $31,-%d($4)\n", leftover);
- sa_reg = gen_rtx_REG (DImode, 24);
- FRP (emit_insn (gen_adddi3 (sa_reg, stack_pointer_rtx, GEN_INT (bias))));
- }
-
- /* Save regs in stack order. Beginning with VMS PV. */
- if (TARGET_OPEN_VMS && vms_is_stack_procedure)
- {
- mem = gen_rtx_MEM (DImode, stack_pointer_rtx);
- MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
- FRP (emit_move_insn (mem, gen_rtx_REG (DImode, REG_PV)));
+ fprintf (file, "\tlda $30,-%d($4)\n", leftover);
}
- /* Save register RA next. */
- if (imask & (1L << REG_RA))
+ /* Describe our frame. */
+ fprintf (file, "\t.frame $%d,%d,$26,%d\n",
+ (frame_pointer_needed
+ ? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM),
+ frame_size, current_function_pretend_args_size);
+
+ /* Save register 26 if any other register needs to be saved. */
+ if (sa_size != 0)
{
- mem = gen_rtx_MEM (DImode, plus_constant (sa_reg, reg_offset));
- MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
- FRP (emit_move_insn (mem, gen_rtx_REG (DImode, REG_RA)));
- imask &= ~(1L << REG_RA);
+ reg_mask |= 1 << 26;
+ fprintf (file, "\tstq $26,%d($30)\n", reg_offset);
reg_offset += 8;
+ int_reg_save_area_size += 8;
}
- /* Now save any other registers required to be saved. */
+ /* Now save any other used integer registers required to be saved. */
for (i = 0; i < 32; i++)
- if (imask & (1L << i))
+ if (! fixed_regs[i] && ! call_used_regs[i] && regs_ever_live[i] && i != 26)
{
- mem = gen_rtx_MEM (DImode, plus_constant (sa_reg, reg_offset));
- MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
- FRP (emit_move_insn (mem, gen_rtx_REG (DImode, i)));
+ reg_mask |= 1 << i;
+ fprintf (file, "\tstq $%d,%d($30)\n", i, reg_offset);
reg_offset += 8;
+ int_reg_save_area_size += 8;
}
+ /* Print the register mask and do floating-point saves. */
+ if (reg_mask)
+ fprintf (file, "\t.mask 0x%x,%d\n", reg_mask,
+ actual_start_reg_offset - frame_size);
+
+ start_reg_offset = reg_offset;
+ reg_mask = 0;
+
for (i = 0; i < 32; i++)
- if (fmask & (1L << i))
+ if (! fixed_regs[i + 32] && ! call_used_regs[i + 32]
+ && regs_ever_live[i + 32])
{
- mem = gen_rtx_MEM (DFmode, plus_constant (sa_reg, reg_offset));
- MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
- FRP (emit_move_insn (mem, gen_rtx_REG (DFmode, i+32)));
+ reg_mask |= 1 << i;
+ fprintf (file, "\tstt $f%d,%d($30)\n", i, reg_offset);
reg_offset += 8;
}
- if (TARGET_OPEN_VMS)
- {
- if (!vms_is_stack_procedure)
- {
- /* Register frame procedures fave the fp. */
- FRP (emit_move_insn (gen_rtx_REG (DImode, vms_save_fp_regno),
- hard_frame_pointer_rtx));
- }
-
- if (vms_base_regno != REG_PV)
- FRP (emit_move_insn (gen_rtx_REG (DImode, vms_base_regno),
- gen_rtx_REG (DImode, REG_PV)));
-
- if (vms_unwind_regno == HARD_FRAME_POINTER_REGNUM)
- {
- FRP (emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx));
- }
-
- /* If we have to allocate space for outgoing args, do it now. */
- if (current_function_outgoing_args_size != 0)
- {
- FRP (emit_move_insn (stack_pointer_rtx,
- plus_constant (hard_frame_pointer_rtx,
- - ALPHA_ROUND (current_function_outgoing_args_size))));
- }
- }
- else
- {
- /* If we need a frame pointer, set it from the stack pointer. */
- if (frame_pointer_needed)
- {
- if (TARGET_CAN_FAULT_IN_PROLOGUE)
- FRP (emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx));
- else
- {
- /* This must always be the last instruction in the
- prologue, thus we emit a special move + clobber. */
- FRP (emit_insn (gen_init_fp (hard_frame_pointer_rtx,
- stack_pointer_rtx, sa_reg)));
- }
- }
- }
+ /* Print the floating-point mask, if we've saved any fp register. */
+ if (reg_mask)
+ fprintf (file, "\t.fmask 0x%x,%d\n", reg_mask,
+ actual_start_reg_offset - frame_size + int_reg_save_area_size);
- /* The ABIs for VMS and OSF/1 say that while we can schedule insns into
- the prologue, for exception handling reasons, we cannot do this for
- any insn that might fault. We could prevent this for mems with a
- (clobber:BLK (scratch)), but this doesn't work for fp insns. So we
- have to prevent all such scheduling with a blockage.
+ /* If we need a frame pointer, set it from the stack pointer. Note that
+ this must always be the last instruction in the prologue. */
+ if (frame_pointer_needed)
+ fprintf (file, "\tbis $30,$30,$15\n");
- Linux, on the other hand, never bothered to implement OSF/1's
- exception handling, and so doesn't care about such things. Anyone
- planning to use dwarf2 frame-unwind info can also omit the blockage. */
-
- if (! TARGET_CAN_FAULT_IN_PROLOGUE)
- emit_insn (gen_blockage ());
+ /* End the prologue and say if we used gp. */
+ fprintf (file, "\t.prologue %d\n", alpha_function_needs_gp);
}
-/* Output the textual info surrounding the prologue. */
+/* Write function epilogue. */
void
-alpha_start_function (file, fnname, decl)
+output_epilog (file, size)
FILE *file;
- char *fnname;
- tree decl ATTRIBUTE_UNUSED;
-{
- unsigned long imask = 0;
- unsigned long fmask = 0;
- /* Stack space needed for pushing registers clobbered by us. */
- HOST_WIDE_INT sa_size;
- /* Complete stack size needed. */
- HOST_WIDE_INT frame_size;
- /* Offset from base reg to register save area. */
- HOST_WIDE_INT reg_offset;
- char *entry_label = (char *) alloca (strlen (fnname) + 6);
+ int size;
+{
+ rtx insn = get_last_insn ();
+ HOST_WIDE_INT out_args_size
+ = ALPHA_ROUND (current_function_outgoing_args_size);
+ HOST_WIDE_INT sa_size = alpha_sa_size ();
+ HOST_WIDE_INT frame_size
+ = (out_args_size + sa_size
+ + ALPHA_ROUND (size + current_function_pretend_args_size));
+ HOST_WIDE_INT reg_offset = out_args_size;
+ HOST_WIDE_INT frame_size_from_reg_save = frame_size - reg_offset;
+ int restore_fp
+ = frame_pointer_needed && regs_ever_live[HARD_FRAME_POINTER_REGNUM];
int i;
- sa_size = alpha_sa_size ();
-
- frame_size = get_frame_size ();
- if (TARGET_OPEN_VMS)
- frame_size = ALPHA_ROUND (sa_size
- + (vms_is_stack_procedure ? 8 : 0)
- + frame_size
- + current_function_pretend_args_size);
- else
- frame_size = (ALPHA_ROUND (current_function_outgoing_args_size)
- + sa_size
- + ALPHA_ROUND (frame_size
- + current_function_pretend_args_size));
-
- if (TARGET_OPEN_VMS)
- reg_offset = 8;
- else
- reg_offset = ALPHA_ROUND (current_function_outgoing_args_size);
-
- alpha_sa_mask (&imask, &fmask);
-
- /* Ecoff can handle multiple .file directives, so put out file and lineno.
- We have to do that before the .ent directive as we cannot switch
- files within procedures with native ecoff because line numbers are
- linked to procedure descriptors.
- Outputting the lineno helps debugging of one line functions as they
- would otherwise get no line number at all. Please note that we would
- like to put out last_linenum from final.c, but it is not accessible. */
-
- if (write_symbols == SDB_DEBUG)
- {
- ASM_OUTPUT_SOURCE_FILENAME (file,
- DECL_SOURCE_FILE (current_function_decl));
- if (debug_info_level != DINFO_LEVEL_TERSE)
- ASM_OUTPUT_SOURCE_LINE (file,
- DECL_SOURCE_LINE (current_function_decl));
- }
-
- /* Issue function start and label. */
- if (TARGET_OPEN_VMS || !flag_inhibit_size_directive)
+ /* If the last insn was a BARRIER, we don't have to write anything except
+ the .end pseudo-op. */
+ if (GET_CODE (insn) == NOTE)
+ insn = prev_nonnote_insn (insn);
+ if (insn == 0 || GET_CODE (insn) != BARRIER)
{
- fputs ("\t.ent ", file);
- assemble_name (file, fnname);
- putc ('\n', file);
- }
-
- strcpy (entry_label, fnname);
- if (TARGET_OPEN_VMS)
- strcat (entry_label, "..en");
- ASM_OUTPUT_LABEL (file, entry_label);
- inside_function = TRUE;
-
- if (TARGET_OPEN_VMS)
- fprintf (file, "\t.base $%d\n", vms_base_regno);
-
- if (!TARGET_OPEN_VMS && TARGET_IEEE_CONFORMANT
- && !flag_inhibit_size_directive)
- {
- /* Set flags in procedure descriptor to request IEEE-conformant
- math-library routines. The value we set it to is PDSC_EXC_IEEE
- (/usr/include/pdsc.h). */
- fputs ("\t.eflag 48\n", file);
- }
-
- /* Set up offsets to alpha virtual arg/local debugging pointer. */
- alpha_auto_offset = -frame_size + current_function_pretend_args_size;
- alpha_arg_offset = -frame_size + 48;
-
- /* Describe our frame. If the frame size is larger than an integer,
- print it as zero to avoid an assembler error. We won't be
- properly describing such a frame, but that's the best we can do. */
- if (TARGET_OPEN_VMS)
- {
- fprintf (file, "\t.frame $%d,", vms_unwind_regno);
- fprintf (file, HOST_WIDE_INT_PRINT_DEC,
- frame_size >= (1l << 31) ? 0 : frame_size);
- fputs (",$26,", file);
- fprintf (file, HOST_WIDE_INT_PRINT_DEC, reg_offset);
- fputs ("\n", file);
- }
- else if (!flag_inhibit_size_directive)
- {
- fprintf (file, "\t.frame $%d,",
- (frame_pointer_needed
- ? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM));
- fprintf (file, HOST_WIDE_INT_PRINT_DEC,
- frame_size >= (1l << 31) ? 0 : frame_size);
- fprintf (file, ",$26,%d\n", current_function_pretend_args_size);
- }
-
- /* Describe which registers were spilled. */
- if (TARGET_OPEN_VMS)
- {
- if (imask)
- /* ??? Does VMS care if mask contains ra? The old code did'nt
- set it, so I don't here. */
- fprintf (file, "\t.mask 0x%lx,0\n", imask & ~(1L << REG_RA));
- if (fmask)
- fprintf (file, "\t.fmask 0x%lx,0\n", fmask);
- if (!vms_is_stack_procedure)
- fprintf (file, "\t.fp_save $%d\n", vms_save_fp_regno);
- }
- else if (!flag_inhibit_size_directive)
- {
- if (imask)
- {
- fprintf (file, "\t.mask 0x%lx,", imask);
- fprintf (file, HOST_WIDE_INT_PRINT_DEC,
- frame_size >= (1l << 31) ? 0 : reg_offset - frame_size);
- putc ('\n', file);
-
- for (i = 0; i < 32; ++i)
- if (imask & (1L << i))
- reg_offset += 8;
- }
-
- if (fmask)
- {
- fprintf (file, "\t.fmask 0x%lx,", fmask);
- fprintf (file, HOST_WIDE_INT_PRINT_DEC,
- frame_size >= (1l << 31) ? 0 : reg_offset - frame_size);
- putc ('\n', file);
- }
- }
-
- /* Emit GP related things. It is rather unfortunate about the alignment
- issues surrounding a CODE_LABEL that forces us to do the label in
- plain text. */
- if (!TARGET_OPEN_VMS && !TARGET_WINDOWS_NT)
- {
- alpha_function_needs_gp = alpha_does_function_need_gp ();
- if (alpha_function_needs_gp)
- fputs ("\tldgp $29,0($27)\n", file);
+ int fp_offset = 0;
- putc ('$', file);
- assemble_name (file, fnname);
- fputs ("..ng:\n", file);
- }
-
-#ifdef OPEN_VMS
- /* Ifdef'ed cause readonly_section and link_section are only
- available then. */
- readonly_section ();
- fprintf (file, "\t.align 3\n");
- assemble_name (file, fnname); fputs ("..na:\n", file);
- fputs ("\t.ascii \"", file);
- assemble_name (file, fnname);
- fputs ("\\0\"\n", file);
-
- link_section ();
- fprintf (file, "\t.align 3\n");
- fputs ("\t.name ", file);
- assemble_name (file, fnname);
- fputs ("..na\n", file);
- ASM_OUTPUT_LABEL (file, fnname);
- fprintf (file, "\t.pdesc ");
- assemble_name (file, fnname);
- fprintf (file, "..en,%s\n", vms_is_stack_procedure ? "stack" : "reg");
- alpha_need_linkage (fnname, 1);
- text_section ();
-#endif
-}
-
-/* Emit the .prologue note at the scheduled end of the prologue. */
-
-void
-output_end_prologue (file)
- FILE *file;
-{
- if (TARGET_OPEN_VMS)
- fputs ("\t.prologue\n", file);
- else if (TARGET_WINDOWS_NT)
- fputs ("\t.prologue 0\n", file);
- else if (!flag_inhibit_size_directive)
- fprintf (file, "\t.prologue %d\n", alpha_function_needs_gp);
-}
-
-/* Write function epilogue. */
-
-/* ??? At some point we will want to support full unwind, and so will
- need to mark the epilogue as well. At the moment, we just confuse
- dwarf2out. */
-#undef FRP
-#define FRP(exp) exp
-
-void
-alpha_expand_epilogue ()
-{
- /* Registers to save. */
- unsigned long imask = 0;
- unsigned long fmask = 0;
- /* Stack space needed for pushing registers clobbered by us. */
- HOST_WIDE_INT sa_size;
- /* Complete stack size needed. */
- HOST_WIDE_INT frame_size;
- /* Offset from base reg to register save area. */
- HOST_WIDE_INT reg_offset;
- int fp_is_frame_pointer, fp_offset;
- rtx sa_reg, sa_reg_exp = NULL;
- rtx sp_adj1, sp_adj2, mem;
- int i;
-
- sa_size = alpha_sa_size ();
-
- frame_size = get_frame_size ();
- if (TARGET_OPEN_VMS)
- frame_size = ALPHA_ROUND (sa_size
- + (vms_is_stack_procedure ? 8 : 0)
- + frame_size
- + current_function_pretend_args_size);
- else
- frame_size = (ALPHA_ROUND (current_function_outgoing_args_size)
- + sa_size
- + ALPHA_ROUND (frame_size
- + current_function_pretend_args_size));
-
- if (TARGET_OPEN_VMS)
- reg_offset = 8;
- else
- reg_offset = ALPHA_ROUND (current_function_outgoing_args_size);
-
- alpha_sa_mask (&imask, &fmask);
-
- fp_is_frame_pointer = ((TARGET_OPEN_VMS && vms_is_stack_procedure)
- || (!TARGET_OPEN_VMS && frame_pointer_needed));
-
- if (sa_size)
- {
/* If we have a frame pointer, restore SP from it. */
- if ((TARGET_OPEN_VMS
- && vms_unwind_regno == HARD_FRAME_POINTER_REGNUM)
- || (!TARGET_OPEN_VMS && frame_pointer_needed))
- {
- FRP (emit_move_insn (stack_pointer_rtx, hard_frame_pointer_rtx));
- }
+ if (frame_pointer_needed)
+ fprintf (file, "\tbis $15,$15,$30\n");
- /* Cope with very large offsets to the register save area. */
- sa_reg = stack_pointer_rtx;
- if (reg_offset + sa_size > 0x8000)
+ /* Restore all the registers, starting with the return address
+ register. */
+ if (sa_size != 0)
{
- int low = ((reg_offset & 0xffff) ^ 0x8000) - 0x8000;
- HOST_WIDE_INT bias;
-
- if (low + sa_size <= 0x8000)
- bias = reg_offset - low, reg_offset = low;
- else
- bias = reg_offset, reg_offset = 0;
-
- sa_reg = gen_rtx_REG (DImode, 22);
- sa_reg_exp = plus_constant (stack_pointer_rtx, bias);
-
- FRP (emit_move_insn (sa_reg, sa_reg_exp));
+ fprintf (file, "\tldq $26,%d($30)\n", reg_offset);
+ reg_offset += 8;
}
-
- /* Restore registers in order, excepting a true frame pointer. */
- if (! alpha_eh_epilogue_sp_ofs)
- {
- mem = gen_rtx_MEM (DImode, plus_constant(sa_reg, reg_offset));
- MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
- FRP (emit_move_insn (gen_rtx_REG (DImode, REG_RA), mem));
- }
- reg_offset += 8;
- imask &= ~(1L << REG_RA);
+ /* Now restore any other used integer registers that that we saved,
+ except for FP if it is being used as FP, since it must be
+ restored last. */
- for (i = 0; i < 32; ++i)
- if (imask & (1L << i))
+ for (i = 0; i < 32; i++)
+ if (! fixed_regs[i] && ! call_used_regs[i] && regs_ever_live[i]
+ && i != 26)
{
- if (i == HARD_FRAME_POINTER_REGNUM && fp_is_frame_pointer)
+ if (i == HARD_FRAME_POINTER_REGNUM && frame_pointer_needed)
fp_offset = reg_offset;
else
- {
- mem = gen_rtx_MEM (DImode, plus_constant(sa_reg, reg_offset));
- MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
- FRP (emit_move_insn (gen_rtx_REG (DImode, i), mem));
- }
+ fprintf (file, "\tldq $%d,%d($30)\n", i, reg_offset);
reg_offset += 8;
}
- for (i = 0; i < 32; ++i)
- if (fmask & (1L << i))
+ for (i = 0; i < 32; i++)
+ if (! fixed_regs[i + 32] && ! call_used_regs[i + 32]
+ && regs_ever_live[i + 32])
{
- mem = gen_rtx_MEM (DFmode, plus_constant(sa_reg, reg_offset));
- MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
- FRP (emit_move_insn (gen_rtx_REG (DFmode, i+32), mem));
+ fprintf (file, "\tldt $f%d,%d($30)\n", i, reg_offset);
reg_offset += 8;
}
- }
-
- if (frame_size || alpha_eh_epilogue_sp_ofs)
- {
- sp_adj1 = stack_pointer_rtx;
-
- if (alpha_eh_epilogue_sp_ofs)
- {
- sp_adj1 = gen_rtx_REG (DImode, 23);
- emit_move_insn (sp_adj1,
- gen_rtx_PLUS (Pmode, stack_pointer_rtx,
- alpha_eh_epilogue_sp_ofs));
- }
- /* If the stack size is large, begin computation into a temporary
- register so as not to interfere with a potential fp restore,
- which must be consecutive with an SP restore. */
- if (frame_size < 32768)
- sp_adj2 = GEN_INT (frame_size);
- else if (frame_size < 0x40007fffL)
- {
- int low = ((frame_size & 0xffff) ^ 0x8000) - 0x8000;
-
- sp_adj2 = plus_constant (sp_adj1, frame_size - low);
- if (sa_reg_exp && rtx_equal_p (sa_reg_exp, sp_adj2))
- sp_adj1 = sa_reg;
- else
- {
- sp_adj1 = gen_rtx_REG (DImode, 23);
- FRP (emit_move_insn (sp_adj1, sp_adj2));
- }
- sp_adj2 = GEN_INT (low);
- }
+ /* If the stack size is large and we have a frame pointer, compute the
+ size of the stack into a register because the old FP restore, stack
+ pointer adjust, and return are required to be consecutive
+ instructions. */
+ if (frame_size > 32767 && restore_fp)
+ add_long_const (file, frame_size, 31, 1, 1);
+
+ /* If we needed a frame pointer and we have to restore it, do it
+ now. This must be done in one instruction immediately
+ before the SP update. */
+ if (restore_fp && fp_offset)
+ fprintf (file, "\tldq $15,%d($30)\n", fp_offset);
+
+ /* Now update the stack pointer, if needed. Only one instruction must
+ modify the stack pointer. It must be the last instruction in the
+ sequence and must be an ADDQ or LDA instruction. If the frame
+ pointer was loaded above, we may only put one instruction here. */
+
+ if (frame_size > 32768 && restore_fp)
+ fprintf (file, "\taddq $1,$30,$30\n");
else
- {
- rtx tmp = gen_rtx_REG (DImode, 23);
- FRP (sp_adj2 = alpha_emit_set_const (tmp, DImode, frame_size, 3));
- if (!sp_adj2)
- {
- /* We can't drop new things to memory this late, afaik,
- so build it up by pieces. */
- FRP (sp_adj2 = alpha_emit_set_long_const (tmp, frame_size,
- -(frame_size < 0)));
- if (!sp_adj2)
- abort ();
- }
- }
-
- /* From now on, things must be in order. So emit blockages. */
+ add_long_const (file, frame_size, 30, 30, 1);
- /* Restore the frame pointer. */
- if (fp_is_frame_pointer)
- {
- emit_insn (gen_blockage ());
- mem = gen_rtx_MEM (DImode, plus_constant(sa_reg, fp_offset));
- MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
- FRP (emit_move_insn (hard_frame_pointer_rtx, mem));
- }
- else if (TARGET_OPEN_VMS)
- {
- emit_insn (gen_blockage ());
- FRP (emit_move_insn (hard_frame_pointer_rtx,
- gen_rtx_REG (DImode, vms_save_fp_regno)));
- }
-
- /* Restore the stack pointer. */
- emit_insn (gen_blockage ());
- FRP (emit_move_insn (stack_pointer_rtx,
- gen_rtx_PLUS (DImode, sp_adj1, sp_adj2)));
- }
- else
- {
- if (TARGET_OPEN_VMS && !vms_is_stack_procedure)
- {
- emit_insn (gen_blockage ());
- FRP (emit_move_insn (hard_frame_pointer_rtx,
- gen_rtx_REG (DImode, vms_save_fp_regno)));
- }
+ /* Finally return to the caller. */
+ fprintf (file, "\tret $31,($26),1\n");
}
- /* Return. */
- emit_jump_insn (gen_return_internal ());
-}
-
-/* Output the rest of the textual info surrounding the epilogue. */
-
-void
-alpha_end_function (file, fnname, decl)
- FILE *file;
- char *fnname;
- tree decl ATTRIBUTE_UNUSED;
-{
/* End the function. */
- if (!flag_inhibit_size_directive)
- {
- fputs ("\t.end ", file);
- assemble_name (file, fnname);
- putc ('\n', file);
- }
+ fprintf (file, "\t.end ");
+ assemble_name (file, alpha_function_name);
+ fprintf (file, "\n");
inside_function = FALSE;
- /* Show that we know this function if it is called again.
-
- Don't do this for global functions in object files destined for a
- shared library because the function may be overridden by the application
- or other libraries. Similarly, don't do this for weak functions. */
-
- if (!DECL_WEAK (current_function_decl)
- && (!flag_pic || !TREE_PUBLIC (current_function_decl)))
- SYMBOL_REF_FLAG (XEXP (DECL_RTL (current_function_decl), 0)) = 1;
+ /* Show that we know this function if it is called again. */
+ SYMBOL_REF_FLAG (XEXP (DECL_RTL (current_function_decl), 0)) = 1;
}
/* Debugging support. */
@@ -4110,7 +1627,7 @@ static int num_source_filenames = 0;
/* Name of the file containing the current function. */
-static const char *current_function_file = "";
+static char *current_function_file = "";
/* Offsets to alpha virtual arg/local debugging pointers. */
@@ -4139,7 +1656,7 @@ alpha_output_filename (stream, name)
fprintf (stream, "\t#@stabs\n");
}
- else if (write_symbols == DBX_DEBUG)
+ else if (!TARGET_GAS && write_symbols == DBX_DEBUG)
{
ASM_GENERATE_INTERNAL_LABEL (ltext_label_name, "Ltext", 0);
fprintf (stream, "%s ", ASM_STABS_OP);
@@ -4148,7 +1665,7 @@ alpha_output_filename (stream, name)
}
else if (name != current_function_file
- && strcmp (name, current_function_file) != 0)
+ && strcmp (name, current_function_file) != 0)
{
if (inside_function && ! TARGET_GAS)
fprintf (stream, "\t#.file\t%d ", num_source_filenames);
@@ -4171,7 +1688,7 @@ alpha_output_lineno (stream, line)
FILE *stream;
int line;
{
- if (write_symbols == DBX_DEBUG)
+ if (! TARGET_GAS && write_symbols == DBX_DEBUG)
{
/* mips-tfile doesn't understand .stabd directives. */
++sym_lineno;
@@ -4181,1100 +1698,3 @@ alpha_output_lineno (stream, line)
else
fprintf (stream, "\n\t.loc\t%d %d\n", num_source_filenames, line);
}
-
-/* Structure to show the current status of registers and memory. */
-
-struct shadow_summary
-{
- struct {
- unsigned long i : 31; /* Mask of int regs */
- unsigned long fp : 31; /* Mask of fp regs */
- unsigned long mem : 1; /* mem == imem | fpmem */
- } used, defd;
-};
-
-static void summarize_insn PROTO((rtx, struct shadow_summary *, int));
-static void alpha_handle_trap_shadows PROTO((rtx));
-
-/* Summary the effects of expression X on the machine. Update SUM, a pointer
- to the summary structure. SET is nonzero if the insn is setting the
- object, otherwise zero. */
-
-static void
-summarize_insn (x, sum, set)
- rtx x;
- struct shadow_summary *sum;
- int set;
-{
- char *format_ptr;
- int i, j;
-
- if (x == 0)
- return;
-
- switch (GET_CODE (x))
- {
- /* ??? Note that this case would be incorrect if the Alpha had a
- ZERO_EXTRACT in SET_DEST. */
- case SET:
- summarize_insn (SET_SRC (x), sum, 0);
- summarize_insn (SET_DEST (x), sum, 1);
- break;
-
- case CLOBBER:
- summarize_insn (XEXP (x, 0), sum, 1);
- break;
-
- case USE:
- summarize_insn (XEXP (x, 0), sum, 0);
- break;
-
- case ASM_OPERANDS:
- for (i = ASM_OPERANDS_INPUT_LENGTH (x) - 1; i >= 0; i--)
- summarize_insn (ASM_OPERANDS_INPUT (x, i), sum, 0);
- break;
-
- case PARALLEL:
- for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
- summarize_insn (XVECEXP (x, 0, i), sum, 0);
- break;
-
- case SUBREG:
- summarize_insn (SUBREG_REG (x), sum, 0);
- break;
-
- case REG:
- {
- int regno = REGNO (x);
- unsigned long mask = 1UL << (regno % 32);
-
- if (regno == 31 || regno == 63)
- break;
-
- if (set)
- {
- if (regno < 32)
- sum->defd.i |= mask;
- else
- sum->defd.fp |= mask;
- }
- else
- {
- if (regno < 32)
- sum->used.i |= mask;
- else
- sum->used.fp |= mask;
- }
- }
- break;
-
- case MEM:
- if (set)
- sum->defd.mem = 1;
- else
- sum->used.mem = 1;
-
- /* Find the regs used in memory address computation: */
- summarize_insn (XEXP (x, 0), sum, 0);
- break;
-
- case CONST_INT: case CONST_DOUBLE:
- case SYMBOL_REF: case LABEL_REF: case CONST:
- break;
-
- /* Handle common unary and binary ops for efficiency. */
- case COMPARE: case PLUS: case MINUS: case MULT: case DIV:
- case MOD: case UDIV: case UMOD: case AND: case IOR:
- case XOR: case ASHIFT: case ROTATE: case ASHIFTRT: case LSHIFTRT:
- case ROTATERT: case SMIN: case SMAX: case UMIN: case UMAX:
- case NE: case EQ: case GE: case GT: case LE:
- case LT: case GEU: case GTU: case LEU: case LTU:
- summarize_insn (XEXP (x, 0), sum, 0);
- summarize_insn (XEXP (x, 1), sum, 0);
- break;
-
- case NEG: case NOT: case SIGN_EXTEND: case ZERO_EXTEND:
- case TRUNCATE: case FLOAT_EXTEND: case FLOAT_TRUNCATE: case FLOAT:
- case FIX: case UNSIGNED_FLOAT: case UNSIGNED_FIX: case ABS:
- case SQRT: case FFS:
- summarize_insn (XEXP (x, 0), sum, 0);
- break;
-
- default:
- format_ptr = GET_RTX_FORMAT (GET_CODE (x));
- for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--)
- switch (format_ptr[i])
- {
- case 'e':
- summarize_insn (XEXP (x, i), sum, 0);
- break;
-
- case 'E':
- for (j = XVECLEN (x, i) - 1; j >= 0; j--)
- summarize_insn (XVECEXP (x, i, j), sum, 0);
- break;
-
- case 'i':
- break;
-
- default:
- abort ();
- }
- }
-}
-
-/* Ensure a sufficient number of `trapb' insns are in the code when
- the user requests code with a trap precision of functions or
- instructions.
-
- In naive mode, when the user requests a trap-precision of
- "instruction", a trapb is needed after every instruction that may
- generate a trap. This ensures that the code is resumption safe but
- it is also slow.
-
- When optimizations are turned on, we delay issuing a trapb as long
- as possible. In this context, a trap shadow is the sequence of
- instructions that starts with a (potentially) trap generating
- instruction and extends to the next trapb or call_pal instruction
- (but GCC never generates call_pal by itself). We can delay (and
- therefore sometimes omit) a trapb subject to the following
- conditions:
-
- (a) On entry to the trap shadow, if any Alpha register or memory
- location contains a value that is used as an operand value by some
- instruction in the trap shadow (live on entry), then no instruction
- in the trap shadow may modify the register or memory location.
-
- (b) Within the trap shadow, the computation of the base register
- for a memory load or store instruction may not involve using the
- result of an instruction that might generate an UNPREDICTABLE
- result.
-
- (c) Within the trap shadow, no register may be used more than once
- as a destination register. (This is to make life easier for the
- trap-handler.)
-
- (d) The trap shadow may not include any branch instructions. */
-
-static void
-alpha_handle_trap_shadows (insns)
- rtx insns;
-{
- struct shadow_summary shadow;
- int trap_pending, exception_nesting;
- rtx i, n;
-
- trap_pending = 0;
- exception_nesting = 0;
- shadow.used.i = 0;
- shadow.used.fp = 0;
- shadow.used.mem = 0;
- shadow.defd = shadow.used;
-
- for (i = insns; i ; i = NEXT_INSN (i))
- {
- if (GET_CODE (i) == NOTE)
- {
- switch (NOTE_LINE_NUMBER (i))
- {
- case NOTE_INSN_EH_REGION_BEG:
- exception_nesting++;
- if (trap_pending)
- goto close_shadow;
- break;
-
- case NOTE_INSN_EH_REGION_END:
- exception_nesting--;
- if (trap_pending)
- goto close_shadow;
- break;
-
- case NOTE_INSN_EPILOGUE_BEG:
- if (trap_pending && alpha_tp >= ALPHA_TP_FUNC)
- goto close_shadow;
- break;
- }
- }
- else if (trap_pending)
- {
- if (alpha_tp == ALPHA_TP_FUNC)
- {
- if (GET_CODE (i) == JUMP_INSN
- && GET_CODE (PATTERN (i)) == RETURN)
- goto close_shadow;
- }
- else if (alpha_tp == ALPHA_TP_INSN)
- {
- if (optimize > 0)
- {
- struct shadow_summary sum;
-
- sum.used.i = 0;
- sum.used.fp = 0;
- sum.used.mem = 0;
- sum.defd = sum.used;
-
- switch (GET_CODE (i))
- {
- case INSN:
- /* Annoyingly, get_attr_trap will abort on these. */
- if (GET_CODE (PATTERN (i)) == USE
- || GET_CODE (PATTERN (i)) == CLOBBER)
- break;
-
- summarize_insn (PATTERN (i), &sum, 0);
-
- if ((sum.defd.i & shadow.defd.i)
- || (sum.defd.fp & shadow.defd.fp))
- {
- /* (c) would be violated */
- goto close_shadow;
- }
-
- /* Combine shadow with summary of current insn: */
- shadow.used.i |= sum.used.i;
- shadow.used.fp |= sum.used.fp;
- shadow.used.mem |= sum.used.mem;
- shadow.defd.i |= sum.defd.i;
- shadow.defd.fp |= sum.defd.fp;
- shadow.defd.mem |= sum.defd.mem;
-
- if ((sum.defd.i & shadow.used.i)
- || (sum.defd.fp & shadow.used.fp)
- || (sum.defd.mem & shadow.used.mem))
- {
- /* (a) would be violated (also takes care of (b)) */
- if (get_attr_trap (i) == TRAP_YES
- && ((sum.defd.i & sum.used.i)
- || (sum.defd.fp & sum.used.fp)))
- abort ();
-
- goto close_shadow;
- }
- break;
-
- case JUMP_INSN:
- case CALL_INSN:
- case CODE_LABEL:
- goto close_shadow;
-
- default:
- abort ();
- }
- }
- else
- {
- close_shadow:
- n = emit_insn_before (gen_trapb (), i);
- PUT_MODE (n, TImode);
- PUT_MODE (i, TImode);
- trap_pending = 0;
- shadow.used.i = 0;
- shadow.used.fp = 0;
- shadow.used.mem = 0;
- shadow.defd = shadow.used;
- }
- }
- }
-
- if ((exception_nesting > 0 || alpha_tp >= ALPHA_TP_FUNC)
- && GET_CODE (i) == INSN
- && GET_CODE (PATTERN (i)) != USE
- && GET_CODE (PATTERN (i)) != CLOBBER
- && get_attr_trap (i) == TRAP_YES)
- {
- if (optimize && !trap_pending)
- summarize_insn (PATTERN (i), &shadow, 0);
- trap_pending = 1;
- }
- }
-}
-
-#ifdef HAIFA
-/* Alpha can only issue instruction groups simultaneously if they are
- suitibly aligned. This is very processor-specific. */
-
-enum alphaev4_pipe {
- EV4_STOP = 0,
- EV4_IB0 = 1,
- EV4_IB1 = 2,
- EV4_IBX = 4
-};
-
-enum alphaev5_pipe {
- EV5_STOP = 0,
- EV5_NONE = 1,
- EV5_E01 = 2,
- EV5_E0 = 4,
- EV5_E1 = 8,
- EV5_FAM = 16,
- EV5_FA = 32,
- EV5_FM = 64
-};
-
-static enum alphaev4_pipe alphaev4_insn_pipe PROTO((rtx));
-static enum alphaev5_pipe alphaev5_insn_pipe PROTO((rtx));
-static rtx alphaev4_next_group PROTO((rtx, int*, int*));
-static rtx alphaev5_next_group PROTO((rtx, int*, int*));
-static rtx alphaev4_next_nop PROTO((int*));
-static rtx alphaev5_next_nop PROTO((int*));
-
-static void alpha_align_insns
- PROTO((rtx, int, rtx (*)(rtx, int*, int*), rtx (*)(int*), int));
-
-static enum alphaev4_pipe
-alphaev4_insn_pipe (insn)
- rtx insn;
-{
- if (recog_memoized (insn) < 0)
- return EV4_STOP;
- if (get_attr_length (insn) != 4)
- return EV4_STOP;
-
- switch (get_attr_type (insn))
- {
- case TYPE_ILD:
- case TYPE_FLD:
- return EV4_IBX;
-
- case TYPE_LDSYM:
- case TYPE_IADD:
- case TYPE_ILOG:
- case TYPE_ICMOV:
- case TYPE_ICMP:
- case TYPE_IST:
- case TYPE_FST:
- case TYPE_SHIFT:
- case TYPE_IMUL:
- case TYPE_FBR:
- return EV4_IB0;
-
- case TYPE_MISC:
- case TYPE_IBR:
- case TYPE_JSR:
- case TYPE_FCPYS:
- case TYPE_FCMOV:
- case TYPE_FADD:
- case TYPE_FDIV:
- case TYPE_FMUL:
- return EV4_IB1;
-
- default:
- abort();
- }
-}
-
-static enum alphaev5_pipe
-alphaev5_insn_pipe (insn)
- rtx insn;
-{
- if (recog_memoized (insn) < 0)
- return EV5_STOP;
- if (get_attr_length (insn) != 4)
- return EV5_STOP;
-
- switch (get_attr_type (insn))
- {
- case TYPE_ILD:
- case TYPE_FLD:
- case TYPE_LDSYM:
- case TYPE_IADD:
- case TYPE_ILOG:
- case TYPE_ICMOV:
- case TYPE_ICMP:
- return EV5_E01;
-
- case TYPE_IST:
- case TYPE_FST:
- case TYPE_SHIFT:
- case TYPE_IMUL:
- case TYPE_MISC:
- case TYPE_MVI:
- return EV5_E0;
-
- case TYPE_IBR:
- case TYPE_JSR:
- return EV5_E1;
-
- case TYPE_FCPYS:
- return EV5_FAM;
-
- case TYPE_FBR:
- case TYPE_FCMOV:
- case TYPE_FADD:
- case TYPE_FDIV:
- return EV5_FA;
-
- case TYPE_FMUL:
- return EV5_FM;
-
- default:
- abort();
- }
-}
-
-/* IN_USE is a mask of the slots currently filled within the insn group.
- The mask bits come from alphaev4_pipe above. If EV4_IBX is set, then
- the insn in EV4_IB0 can be swapped by the hardware into EV4_IB1.
-
- LEN is, of course, the length of the group in bytes. */
-
-static rtx
-alphaev4_next_group (insn, pin_use, plen)
- rtx insn;
- int *pin_use, *plen;
-{
- int len, in_use;
-
- len = in_use = 0;
-
- if (GET_RTX_CLASS (GET_CODE (insn)) != 'i'
- || GET_CODE (PATTERN (insn)) == CLOBBER
- || GET_CODE (PATTERN (insn)) == USE)
- goto next_and_done;
-
- while (1)
- {
- enum alphaev4_pipe pipe;
-
- pipe = alphaev4_insn_pipe (insn);
- switch (pipe)
- {
- case EV4_STOP:
- /* Force complex instructions to start new groups. */
- if (in_use)
- goto done;
-
- /* If this is a completely unrecognized insn, its an asm.
- We don't know how long it is, so record length as -1 to
- signal a needed realignment. */
- if (recog_memoized (insn) < 0)
- len = -1;
- else
- len = get_attr_length (insn);
- goto next_and_done;
-
- case EV4_IBX:
- if (in_use & EV4_IB0)
- {
- if (in_use & EV4_IB1)
- goto done;
- in_use |= EV4_IB1;
- }
- else
- in_use |= EV4_IB0 | EV4_IBX;
- break;
-
- case EV4_IB0:
- if (in_use & EV4_IB0)
- {
- if (!(in_use & EV4_IBX) || (in_use & EV4_IB1))
- goto done;
- in_use |= EV4_IB1;
- }
- in_use |= EV4_IB0;
- break;
-
- case EV4_IB1:
- if (in_use & EV4_IB1)
- goto done;
- in_use |= EV4_IB1;
- break;
-
- default:
- abort();
- }
- len += 4;
-
- /* Haifa doesn't do well scheduling branches. */
- if (GET_CODE (insn) == JUMP_INSN)
- goto next_and_done;
-
- next:
- insn = next_nonnote_insn (insn);
-
- if (!insn || GET_RTX_CLASS (GET_CODE (insn)) != 'i')
- goto done;
-
- /* Let Haifa tell us where it thinks insn group boundaries are. */
- if (GET_MODE (insn) == TImode)
- goto done;
-
- if (GET_CODE (insn) == CLOBBER || GET_CODE (insn) == USE)
- goto next;
- }
-
- next_and_done:
- insn = next_nonnote_insn (insn);
-
- done:
- *plen = len;
- *pin_use = in_use;
- return insn;
-}
-
-/* IN_USE is a mask of the slots currently filled within the insn group.
- The mask bits come from alphaev5_pipe above. If EV5_E01 is set, then
- the insn in EV5_E0 can be swapped by the hardware into EV5_E1.
-
- LEN is, of course, the length of the group in bytes. */
-
-static rtx
-alphaev5_next_group (insn, pin_use, plen)
- rtx insn;
- int *pin_use, *plen;
-{
- int len, in_use;
-
- len = in_use = 0;
-
- if (GET_RTX_CLASS (GET_CODE (insn)) != 'i'
- || GET_CODE (PATTERN (insn)) == CLOBBER
- || GET_CODE (PATTERN (insn)) == USE)
- goto next_and_done;
-
- while (1)
- {
- enum alphaev5_pipe pipe;
-
- pipe = alphaev5_insn_pipe (insn);
- switch (pipe)
- {
- case EV5_STOP:
- /* Force complex instructions to start new groups. */
- if (in_use)
- goto done;
-
- /* If this is a completely unrecognized insn, its an asm.
- We don't know how long it is, so record length as -1 to
- signal a needed realignment. */
- if (recog_memoized (insn) < 0)
- len = -1;
- else
- len = get_attr_length (insn);
- goto next_and_done;
-
- /* ??? Most of the places below, we would like to abort, as
- it would indicate an error either in Haifa, or in the
- scheduling description. Unfortunately, Haifa never
- schedules the last instruction of the BB, so we don't
- have an accurate TI bit to go off. */
- case EV5_E01:
- if (in_use & EV5_E0)
- {
- if (in_use & EV5_E1)
- goto done;
- in_use |= EV5_E1;
- }
- else
- in_use |= EV5_E0 | EV5_E01;
- break;
-
- case EV5_E0:
- if (in_use & EV5_E0)
- {
- if (!(in_use & EV5_E01) || (in_use & EV5_E1))
- goto done;
- in_use |= EV5_E1;
- }
- in_use |= EV5_E0;
- break;
-
- case EV5_E1:
- if (in_use & EV5_E1)
- goto done;
- in_use |= EV5_E1;
- break;
-
- case EV5_FAM:
- if (in_use & EV5_FA)
- {
- if (in_use & EV5_FM)
- goto done;
- in_use |= EV5_FM;
- }
- else
- in_use |= EV5_FA | EV5_FAM;
- break;
-
- case EV5_FA:
- if (in_use & EV5_FA)
- goto done;
- in_use |= EV5_FA;
- break;
-
- case EV5_FM:
- if (in_use & EV5_FM)
- goto done;
- in_use |= EV5_FM;
- break;
-
- case EV5_NONE:
- break;
-
- default:
- abort();
- }
- len += 4;
-
- /* Haifa doesn't do well scheduling branches. */
- /* ??? If this is predicted not-taken, slotting continues, except
- that no more IBR, FBR, or JSR insns may be slotted. */
- if (GET_CODE (insn) == JUMP_INSN)
- goto next_and_done;
-
- next:
- insn = next_nonnote_insn (insn);
-
- if (!insn || GET_RTX_CLASS (GET_CODE (insn)) != 'i')
- goto done;
-
- /* Let Haifa tell us where it thinks insn group boundaries are. */
- if (GET_MODE (insn) == TImode)
- goto done;
-
- if (GET_CODE (insn) == CLOBBER || GET_CODE (insn) == USE)
- goto next;
- }
-
- next_and_done:
- insn = next_nonnote_insn (insn);
-
- done:
- *plen = len;
- *pin_use = in_use;
- return insn;
-}
-
-static rtx
-alphaev4_next_nop (pin_use)
- int *pin_use;
-{
- int in_use = *pin_use;
- rtx nop;
-
- if (!(in_use & EV4_IB0))
- {
- in_use |= EV4_IB0;
- nop = gen_nop ();
- }
- else if ((in_use & (EV4_IBX|EV4_IB1)) == EV4_IBX)
- {
- in_use |= EV4_IB1;
- nop = gen_nop ();
- }
- else if (TARGET_FP && !(in_use & EV4_IB1))
- {
- in_use |= EV4_IB1;
- nop = gen_fnop ();
- }
- else
- nop = gen_unop ();
-
- *pin_use = in_use;
- return nop;
-}
-
-static rtx
-alphaev5_next_nop (pin_use)
- int *pin_use;
-{
- int in_use = *pin_use;
- rtx nop;
-
- if (!(in_use & EV5_E1))
- {
- in_use |= EV5_E1;
- nop = gen_nop ();
- }
- else if (TARGET_FP && !(in_use & EV5_FA))
- {
- in_use |= EV5_FA;
- nop = gen_fnop ();
- }
- else if (TARGET_FP && !(in_use & EV5_FM))
- {
- in_use |= EV5_FM;
- nop = gen_fnop ();
- }
- else
- nop = gen_unop ();
-
- *pin_use = in_use;
- return nop;
-}
-
-/* The instruction group alignment main loop. */
-
-static void
-alpha_align_insns (insns, max_align, next_group, next_nop, gp_in_use)
- rtx insns;
- int max_align;
- rtx (*next_group) PROTO((rtx, int*, int*));
- rtx (*next_nop) PROTO((int*));
- int gp_in_use;
-{
- /* ALIGN is the known alignment for the insn group. */
- int align;
- /* OFS is the offset of the current insn in the insn group. */
- int ofs;
- int prev_in_use, in_use, len;
- rtx i, next;
-
- /* Let shorten branches care for assigning alignments to code labels. */
- shorten_branches (insns);
-
- align = (FUNCTION_BOUNDARY/BITS_PER_UNIT < max_align
- ? FUNCTION_BOUNDARY/BITS_PER_UNIT : max_align);
-
- /* Account for the initial GP load, which happens before the scheduled
- prologue we emitted as RTL. */
- ofs = prev_in_use = 0;
- if (alpha_does_function_need_gp())
- {
- ofs = 8 & (align - 1);
- prev_in_use = gp_in_use;
- }
-
- i = insns;
- if (GET_CODE (i) == NOTE)
- i = next_nonnote_insn (i);
-
- while (i)
- {
- next = (*next_group)(i, &in_use, &len);
-
- /* When we see a label, resync alignment etc. */
- if (GET_CODE (i) == CODE_LABEL)
- {
- int new_align = 1 << label_to_alignment (i);
- if (new_align >= align)
- {
- align = new_align < max_align ? new_align : max_align;
- ofs = 0;
- }
- else if (ofs & (new_align-1))
- ofs = (ofs | (new_align-1)) + 1;
- if (len != 0)
- abort();
- }
-
- /* Handle complex instructions special. */
- else if (in_use == 0)
- {
- /* Asms will have length < 0. This is a signal that we have
- lost alignment knowledge. Assume, however, that the asm
- will not mis-align instructions. */
- if (len < 0)
- {
- ofs = 0;
- align = 4;
- len = 0;
- }
- }
-
- /* If the known alignment is smaller than the recognized insn group,
- realign the output. */
- else if (align < len)
- {
- int new_log_align = len > 8 ? 4 : 3;
- rtx where;
-
- where = prev_nonnote_insn (i);
- if (!where || GET_CODE (where) != CODE_LABEL)
- where = i;
-
- emit_insn_before (gen_realign (GEN_INT (new_log_align)), where);
- align = 1 << new_log_align;
- ofs = 0;
- }
-
- /* If the group won't fit in the same INT16 as the previous,
- we need to add padding to keep the group together. Rather
- than simply leaving the insn filling to the assembler, we
- can make use of the knowledge of what sorts of instructions
- were issued in the previous group to make sure that all of
- the added nops are really free. */
- else if (ofs + len > align)
- {
- int nop_count = (align - ofs) / 4;
- rtx where;
-
- /* Insert nops before labels and branches to truely merge the
- execution of the nops with the previous instruction group. */
- where = prev_nonnote_insn (i);
- if (where)
- {
- if (GET_CODE (where) == CODE_LABEL)
- {
- rtx where2 = prev_nonnote_insn (where);
- if (where2 && GET_CODE (where2) == JUMP_INSN)
- where = where2;
- }
- else if (GET_CODE (where) != JUMP_INSN)
- where = i;
- }
- else
- where = i;
-
- do
- emit_insn_before ((*next_nop)(&prev_in_use), where);
- while (--nop_count);
- ofs = 0;
- }
-
- ofs = (ofs + len) & (align - 1);
- prev_in_use = in_use;
- i = next;
- }
-}
-#endif /* HAIFA */
-
-/* Machine dependant reorg pass. */
-
-void
-alpha_reorg (insns)
- rtx insns;
-{
- if (alpha_tp != ALPHA_TP_PROG || flag_exceptions)
- alpha_handle_trap_shadows (insns);
-
-#ifdef HAIFA
- /* Due to the number of extra trapb insns, don't bother fixing up
- alignment when trap precision is instruction. Moreover, we can
- only do our job when sched2 is run and Haifa is our scheduler. */
- if (optimize && !optimize_size
- && alpha_tp != ALPHA_TP_INSN
- && flag_schedule_insns_after_reload)
- {
- if (alpha_cpu == PROCESSOR_EV4)
- alpha_align_insns (insns, 8, alphaev4_next_group,
- alphaev4_next_nop, EV4_IB0);
- else if (alpha_cpu == PROCESSOR_EV5)
- alpha_align_insns (insns, 16, alphaev5_next_group,
- alphaev5_next_nop, EV5_E01 | EV5_E0);
- }
-#endif
-}
-
-
-/* Check a floating-point value for validity for a particular machine mode. */
-
-static char * const float_strings[] =
-{
- /* These are for FLOAT_VAX. */
- "1.70141173319264430e+38", /* 2^127 (2^24 - 1) / 2^24 */
- "-1.70141173319264430e+38",
- "2.93873587705571877e-39", /* 2^-128 */
- "-2.93873587705571877e-39",
- /* These are for the default broken IEEE mode, which traps
- on infinity or denormal numbers. */
- "3.402823466385288598117e+38", /* 2^128 (1 - 2^-24) */
- "-3.402823466385288598117e+38",
- "1.1754943508222875079687e-38", /* 2^-126 */
- "-1.1754943508222875079687e-38",
-};
-
-static REAL_VALUE_TYPE float_values[8];
-static int inited_float_values = 0;
-
-int
-check_float_value (mode, d, overflow)
- enum machine_mode mode;
- REAL_VALUE_TYPE *d;
- int overflow ATTRIBUTE_UNUSED;
-{
-
- if (TARGET_IEEE || TARGET_IEEE_CONFORMANT || TARGET_IEEE_WITH_INEXACT)
- return 0;
-
- if (inited_float_values == 0)
- {
- int i;
- for (i = 0; i < 8; i++)
- float_values[i] = REAL_VALUE_ATOF (float_strings[i], DFmode);
-
- inited_float_values = 1;
- }
-
- if (mode == SFmode)
- {
- REAL_VALUE_TYPE r;
- REAL_VALUE_TYPE *fvptr;
-
- if (TARGET_FLOAT_VAX)
- fvptr = &float_values[0];
- else
- fvptr = &float_values[4];
-
- bcopy ((char *) d, (char *) &r, sizeof (REAL_VALUE_TYPE));
- if (REAL_VALUES_LESS (fvptr[0], r))
- {
- bcopy ((char *) &fvptr[0], (char *) d,
- sizeof (REAL_VALUE_TYPE));
- return 1;
- }
- else if (REAL_VALUES_LESS (r, fvptr[1]))
- {
- bcopy ((char *) &fvptr[1], (char *) d,
- sizeof (REAL_VALUE_TYPE));
- return 1;
- }
- else if (REAL_VALUES_LESS (dconst0, r)
- && REAL_VALUES_LESS (r, fvptr[2]))
- {
- bcopy ((char *) &dconst0, (char *) d, sizeof (REAL_VALUE_TYPE));
- return 1;
- }
- else if (REAL_VALUES_LESS (r, dconst0)
- && REAL_VALUES_LESS (fvptr[3], r))
- {
- bcopy ((char *) &dconst0, (char *) d, sizeof (REAL_VALUE_TYPE));
- return 1;
- }
- }
-
- return 0;
-}
-
-#if OPEN_VMS
-
-/* Return the VMS argument type corresponding to MODE. */
-
-enum avms_arg_type
-alpha_arg_type (mode)
- enum machine_mode mode;
-{
- switch (mode)
- {
- case SFmode:
- return TARGET_FLOAT_VAX ? FF : FS;
- case DFmode:
- return TARGET_FLOAT_VAX ? FD : FT;
- default:
- return I64;
- }
-}
-
-/* Return an rtx for an integer representing the VMS Argument Information
- register value. */
-
-struct rtx_def *
-alpha_arg_info_reg_val (cum)
- CUMULATIVE_ARGS cum;
-{
- unsigned HOST_WIDE_INT regval = cum.num_args;
- int i;
-
- for (i = 0; i < 6; i++)
- regval |= ((int) cum.atypes[i]) << (i * 3 + 8);
-
- return GEN_INT (regval);
-}
-
-/* Structure to collect function names for final output
- in link section. */
-
-enum links_kind {KIND_UNUSED, KIND_LOCAL, KIND_EXTERN};
-
-
-struct alpha_links {
- struct alpha_links *next;
- char *name;
- enum links_kind kind;
-};
-
-static struct alpha_links *alpha_links_base = 0;
-
-/* Make (or fake) .linkage entry for function call.
-
- IS_LOCAL is 0 if name is used in call, 1 if name is used in definition. */
-
-void
-alpha_need_linkage (name, is_local)
- char *name;
- int is_local;
-{
- rtx x;
- struct alpha_links *lptr, *nptr;
-
- if (name[0] == '*')
- name++;
-
- /* Is this name already defined ? */
-
- for (lptr = alpha_links_base; lptr; lptr = lptr->next)
- if (strcmp (lptr->name, name) == 0)
- {
- if (is_local)
- {
- /* Defined here but external assumed. */
- if (lptr->kind == KIND_EXTERN)
- lptr->kind = KIND_LOCAL;
- }
- else
- {
- /* Used here but unused assumed. */
- if (lptr->kind == KIND_UNUSED)
- lptr->kind = KIND_LOCAL;
- }
- return;
- }
-
- nptr = (struct alpha_links *) xmalloc (sizeof (struct alpha_links));
- nptr->next = alpha_links_base;
- nptr->name = xstrdup (name);
-
- /* Assume external if no definition. */
- nptr->kind = (is_local ? KIND_UNUSED : KIND_EXTERN);
-
- /* Ensure we have an IDENTIFIER so assemble_name can mark is used. */
- get_identifier (name);
-
- alpha_links_base = nptr;
-
- return;
-}
-
-
-void
-alpha_write_linkage (stream)
- FILE *stream;
-{
- struct alpha_links *lptr, *nptr;
-
- readonly_section ();
-
- fprintf (stream, "\t.align 3\n");
-
- for (lptr = alpha_links_base; lptr; lptr = nptr)
- {
- nptr = lptr->next;
-
- if (lptr->kind == KIND_UNUSED
- || ! TREE_SYMBOL_REFERENCED (get_identifier (lptr->name)))
- continue;
-
- fprintf (stream, "$%s..lk:\n", lptr->name);
- if (lptr->kind == KIND_LOCAL)
- {
- /* Local and used, build linkage pair. */
- fprintf (stream, "\t.quad %s..en\n", lptr->name);
- fprintf (stream, "\t.quad %s\n", lptr->name);
- }
- else
- /* External and used, request linkage pair. */
- fprintf (stream, "\t.linkage %s\n", lptr->name);
- }
-}
-
-#else
-
-void
-alpha_need_linkage (name, is_local)
- char *name ATTRIBUTE_UNUSED;
- int is_local ATTRIBUTE_UNUSED;
-{
-}
-
-#endif /* OPEN_VMS */
diff --git a/contrib/gcc/config/alpha/elf.h b/contrib/gcc/config/alpha/elf.h
index 6cea3da..24af9d3 100644
--- a/contrib/gcc/config/alpha/elf.h
+++ b/contrib/gcc/config/alpha/elf.h
@@ -19,6 +19,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
#undef OBJECT_FORMAT_COFF
#undef EXTENDED_COFF
#define OBJECT_FORMAT_ELF
diff --git a/contrib/gcc/config/alpha/freebsd.h b/contrib/gcc/config/alpha/freebsd.h
index 24567a6..da88be2 100644
--- a/contrib/gcc/config/alpha/freebsd.h
+++ b/contrib/gcc/config/alpha/freebsd.h
@@ -1,103 +1,216 @@
-/* XXX */
-/*
- * This file was derived from source obtained from NetBSD/Alpha which
- * is publicly available for ftp. The patch was developed by cgd@netbsd.org
- * during the time he worked at CMU. He claims that CMU own this patch
- * to gcc and that they have not (and will not) release the patch for
- * incorporation in FSF sources. We are supposedly able to use the patch,
- * but we are not allowed to forward it back to FSF for inclusion in
- * their source releases.
- *
- * This all has me (jb@freebsd.org) confused because (a) I see no copyright
- * messages that tell me that use is restricted; and (b) I expected that
- * the patch was originally developed from other files which are subject
- * to GPL.
- *
- * Use of this file is restricted until its CMU ownership is tested.
- */
-
-#include "alpha/alpha.h"
-
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "int"
-
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE 32
-
-/* FreeBSD-specific things: */
+/* Definitions for DEC AXP Alpha running FreeBSD using the ELF format
+ Copyright (C) 2000 Free Software Foundation, Inc.
+ Contributed by David O'Brien <obrien@FreeBSD.org>
+
+This file is part of GNU CC.
+
+GNU CC 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.
+
+GNU CC 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 GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is used on Alpha platforms that use the ELF format.
+ This was taken from the NetBSD configuration, and modified
+ for FreeBSD/Alpha by Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> */
+
+/* $FreeBSD$ */
+
+
+/* Names to predefine in the preprocessor for this target machine.
+ XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications
+ expect it because that's what OSF/1 does. */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D__FreeBSD__ -D__alpha__ -D__alpha"
+#define CPP_PREDEFINES \
+ "-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha)" \
+ FBSD_CPP_PREDEFINES
-/* Look for the include files in the system-defined places. */
+#undef LINK_SPEC
+#define LINK_SPEC "-m elf64alpha \
+ %{p:%e`-p' not supported; use `-pg' and gprof(1)} \
+ %{Wl,*:%*} \
+ %{assert*} %{R*} %{rpath*} %{defsym*} \
+ %{shared:-Bshareable %{h*} %{soname*}} \
+ %{symbolic:-Bsymbolic} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}} \
+ %{static:-Bstatic}}"
+
+/* Provide an ASM_SPEC appropriate for a FreeBSD/Alpha target. This differs
+ from the generic FreeBSD ASM_SPEC in that no special handling of PIC is
+ necessary on the Alpha. */
-#undef GPLUSPLUS_INCLUDE_DIR
-#define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++"
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{mcpu=*:-m%*}"
-#undef GCC_INCLUDE_DIR
-#define GCC_INCLUDE_DIR "/usr/include"
+#undef ASM_FINAL_SPEC
-#undef INCLUDE_DEFAULTS
-#define INCLUDE_DEFAULTS \
- { \
- { GPLUSPLUS_INCLUDE_DIR, 1, 1 }, \
- { GCC_INCLUDE_DIR, 0, 0 }, \
- { 0, 0, 0 } \
- }
+/* Provide a STARTFILE_SPEC for FreeBSD that is compatible with the
+ non-aout version used on i386. */
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+ "%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
+ %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-/* Under FreeBSD, the normal location of the `ld' and `as' programs is the
- /usr/bin directory. */
+/* Provide a ENDFILE_SPEC appropriate for ELF. Here we tack on the
+ magical crtend.o file which provides part of the support for
+ getting C++ file-scope static object constructed before entering
+ `main', followed by a normal ELF "finalizer" file, `crtn.o'. */
-#undef MD_EXEC_PREFIX
-#define MD_EXEC_PREFIX "/usr/bin/"
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+ "%{!shared:crtend.o%s} %{shared:crtendS.o%s}"
-/* Under FreeBSD, the normal location of the various *crt*.o files is the
- /usr/lib directory. */
-#undef MD_STARTFILE_PREFIX
-#define MD_STARTFILE_PREFIX "/usr/lib/"
+/************************[ Target stuff ]***********************************/
+/* Define the actual types of some ANSI-mandated types.
+ Needs to agree with <machine/ansi.h>. GCC defaults come from c-decl.c,
+ c-common.c, and config/<arch>/<arch>.h. */
-/* Provide a CPP_SPEC appropriate for FreeBSD. Current we just deal with
- the GCC option `-posix'. */
+/* alpha.h gets this wrong for FreeBSD. We use the GCC defaults instead. */
+#undef WCHAR_TYPE
-#undef CPP_SPEC
-#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
+/* Handle cross-compilation on 32-bits machines (such as i386) for 64-bits
+ machines (Alpha in this case). */
-/* Provide an ASM_SPEC appropriate for FreeBSD. */
+#if defined(__i386__)
+#undef HOST_BITS_PER_LONG
+#define HOST_BITS_PER_LONG 32
+#undef HOST_WIDE_INT
+#define HOST_WIDE_INT long long
+#undef HOST_BITS_PER_WIDE_INT
+#define HOST_BITS_PER_WIDE_INT 64
+#endif
-#undef ASM_SPEC
-#define ASM_SPEC " %|"
+/* This is the pseudo-op used to generate a 64-bit word of data with a
+ specific value in some section. */
-#undef ASM_FINAL_SPEC
+#undef INT_ASM_OP
+#define INT_ASM_OP ".quad"
-/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate
- libc, depending on whether we're doing profiling. */
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (FreeBSD/Alpha ELF)");
-#undef LIB_SPEC
-#define LIB_SPEC "%{!shared:%{!pg:%{!pthread:-lc}%{pthread:-lpthread -lc}}%{pg:%{!pthread:-lc_p}%{pthread:-lpthread_p -lc_p}}}"
+#define TARGET_AOUT (0)
+#define TARGET_ELF (1)
+#define TARGET_UNDERSCORES (0)
-/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
- for the special GCC options -static, -assert, and -nostdlib. */
+#undef OBJECT_FORMAT_COFF
+#undef EXTENDED_COFF
-#undef LINK_SPEC
-#define LINK_SPEC \
- "%{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp %{static:-Bstatic} %{assert*}"
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
+
+#undef HAS_INIT_SECTION
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. Under FreeBSD/Alpha, the assembler does
- nothing special with -pg. */
+ nothing special with -pg. */
-#undef FUNCTION_PROFILER
-#define FUNCTION_PROFILER(FILE, LABELNO) \
- fputs ("\tjsr $28,_mcount\n", (FILE)); /* at */
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ fputs ("\tjsr $28,_mcount\n", (FILE)) /* at */
/* Show that we need a GP when profiling. */
+#undef TARGET_PROFILING_NEEDS_GP
#define TARGET_PROFILING_NEEDS_GP
-#define bsd4_4
-#undef HAS_INIT_SECTION
+/* We always use gas here, so we don't worry about ECOFF assembler problems. */
+#undef TARGET_GAS
+#define TARGET_GAS 1
+
+
+/************************[ Assembler stuff ]********************************/
+
+/* This is how to begin an assembly language file.
+ ELF also needs a .version. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+ { \
+ alpha_write_verstamp (FILE); \
+ output_file_directive ((FILE), main_input_filename); \
+ fprintf ((FILE), "\t.version\t\"01.01\"\n"); \
+ fprintf ((FILE), "\t.set noat\n"); \
+ }
+
+extern void output_file_directive ();
+extern void alpha_output_lineno ();
+
+#undef ASM_OUTPUT_SOURCE_LINE
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+ alpha_output_lineno ((STREAM), (LINE))
+
+/* Switch into a generic section.
+ This is currently only used to support section attributes.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl. */
+#undef ASM_OUTPUT_SECTION_NAME
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ fprintf ((FILE), ".section\t%s,\"%s\",@progbits\n", (NAME), \
+ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ (DECL) && DECL_READONLY_SECTION ((DECL), (RELOC)) ? "a" : "aw")
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#undef SELECT_SECTION
+#define SELECT_SECTION(DECL, RELOC) \
+ { \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && (RELOC)) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
+ || !DECL_INITIAL (DECL) \
+ || (DECL_INITIAL (DECL) != error_mark_node \
+ && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+ }
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#undef ASM_OUTPUT_DEF
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { \
+ assemble_name((FILE), (NAME1)); \
+ fputs(" = ", (FILE)); \
+ assemble_name((FILE), (NAME2)); \
+ fputc('\n', (FILE)); \
+ } while (0)
+
+
+/************************[ Debugger stuff ]*********************************/
+
+/* This is the char to use for continuation (in case we need to turn
+ continuation back on). */
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+#undef DBX_CONTIN_CHAR
+#define DBX_CONTIN_CHAR '?'
diff --git a/contrib/gcc/config/alpha/x-alpha b/contrib/gcc/config/alpha/x-alpha
index 9686ab9..9919747 100644
--- a/contrib/gcc/config/alpha/x-alpha
+++ b/contrib/gcc/config/alpha/x-alpha
@@ -1,2 +1 @@
CLIB=-lmld
-EXTRA_HEADERS = $(srcdir)/config/alpha/va_list.h
diff --git a/contrib/gcc/config/alpha/xm-alpha.h b/contrib/gcc/config/alpha/xm-alpha.h
index c04844f..642e1cf 100644
--- a/contrib/gcc/config/alpha/xm-alpha.h
+++ b/contrib/gcc/config/alpha/xm-alpha.h
@@ -41,18 +41,12 @@ Boston, MA 02111-1307, USA. */
#define SUCCESS_EXIT_CODE 0
#define FATAL_EXIT_CODE 33
-/* If compiled with GNU C, use the builtin alloca. */
-#ifndef alloca
-#if defined(__GNUC__) && !defined(USE_C_ALLOCA)
-#define alloca __builtin_alloca
-#else
-#if !defined(_WIN32) && !defined(USE_C_ALLOCA) && !defined(OPEN_VMS) && !defined(__INTERIX)
+/* If not compiled with GNU C, use the builtin alloca. */
+#if !defined(__GNUC__) && !defined(_WIN32)
#include <alloca.h>
#else
extern void *alloca ();
#endif
-#endif
-#endif
/* The host compiler has problems with enum bitfields since it makes
them signed so we can't fit all our codes in. */
@@ -71,6 +65,14 @@ extern void *malloc (), *realloc (), *calloc ();
#include "string.h"
#endif
+/* OSF/1 has vprintf. */
+
+#define HAVE_VPRINTF
+
+/* OSF/1 has putenv. */
+
+#define HAVE_PUTENV
+
/* OSF/1 is POSIX.1 compliant. */
#define POSIX
diff --git a/contrib/gcc/config/alpha/xm-freebsd.h b/contrib/gcc/config/alpha/xm-freebsd.h
new file mode 100644
index 0000000..13bc6b7
--- /dev/null
+++ b/contrib/gcc/config/alpha/xm-freebsd.h
@@ -0,0 +1,4 @@
+/* Configuration for GCC for Intel i386 running FreeBSD as host. */
+
+#include <alpha/xm-alpha.h>
+#include <xm-freebsd.h>
diff --git a/contrib/gcc/config/freebsd.h b/contrib/gcc/config/freebsd.h
index dc16976..b7985ed 100644
--- a/contrib/gcc/config/freebsd.h
+++ b/contrib/gcc/config/freebsd.h
@@ -1,5 +1,5 @@
/* Base configuration file for all FreeBSD targets.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -21,100 +21,606 @@ Boston, MA 02111-1307, USA. */
/* Common FreeBSD configuration.
All FreeBSD architectures should include this file, which will specify
their commonalities.
- Adapted from /usr/src/contrib/gcc/config/i386/freebsd.h &
+ Adapted from /usr/src/contrib/gcc/config/i386/freebsd.h,
+ /usr/src/contrib/gcc/config/svr4.h &
egcs/gcc/config/i386/freebsd-elf.h version by David O'Brien */
+/* $FreeBSD$ */
-/* Don't assume anything about the header files. */
-#define NO_IMPLICIT_EXTERN_C
-/* This defines which switch letters take arguments. On svr4, most of
+/* Cpp, assembler, linker, library, and startfile spec's. */
+
+/* This defines which switch letters take arguments. On FreeBSD, most of
the normal cases (defined in gcc.c) apply, and we also have -h* and
- -z* options (for the linker). We have a slightly different mix. We
- have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
-
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR) \
- ( (CHAR) == 'D' \
- || (CHAR) == 'U' \
- || (CHAR) == 'o' \
- || (CHAR) == 'e' \
- || (CHAR) == 'T' \
- || (CHAR) == 'u' \
- || (CHAR) == 'I' \
- || (CHAR) == 'm' \
- || (CHAR) == 'x' \
- || (CHAR) == 'L' \
- || (CHAR) == 'A' \
- || (CHAR) == 'V' \
- || (CHAR) == 'B' \
- || (CHAR) == 'b' \
+ -z* options (for the linker) (comming from svr4).
+ We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
+
+#define FBSD_SWITCH_TAKES_ARG(CHAR) \
+ (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
|| (CHAR) == 'h' \
|| (CHAR) == 'z' /* ignored by ld */ \
|| (CHAR) == 'R')
-#undef WORD_SWITCH_TAKES_ARG
-#define WORD_SWITCH_TAKES_ARG(STR) \
+#undef SWITCH_TAKES_ARG
+#define SWITCH_TAKES_ARG(CHAR) (FBSD_SWITCH_TAKES_ARG(CHAR))
+
+/* This defines which multi-letter switches take arguments. */
+
+#define FBSD_WORD_SWITCH_TAKES_ARG(STR) \
(DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
- || !strcmp (STR, "rpath") || !strcmp (STR, "rpath-link") \
- || !strcmp (STR, "soname") || !strcmp (STR, "defsym") \
- || !strcmp (STR, "assert") || !strcmp (STR, "dynamic-linker"))
+ || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \
+ || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \
+ || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker"))
+
+#undef WORD_SWITCH_TAKES_ARG
+#define WORD_SWITCH_TAKES_ARG(STR) (FBSD_WORD_SWITCH_TAKES_ARG(STR))
+/* Place spaces around this string. We depend on string splicing to produce
+ the final CPP_PREDEFINES value. */
+#define FBSD_CPP_PREDEFINES " -Dunix -D__FreeBSD__=5 -D__FreeBSD_cc_version=500001 -Asystem(unix) -Asystem(FreeBSD) "
-#define CPP_FBSD_PREDEFINES "-Dunix -D__ELF__ -D__FreeBSD__=4 -D__FreeBSD_cc_version=400001 -Asystem(unix) -Asystem(FreeBSD)"
+#define FBSD_CPP_SPEC "\
+ %(cpp_cpu) \
+ %{!maout: -D__ELF__} \
+ %{munderscores: -D__UNDERSCORES__} \
+ %{maout: %{!mno-underscores: -D__UNDERSCORES__}} \
+ %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \
+ %{posix:-D_POSIX_SOURCE}"
+#undef CPP_SPEC
+#define CPP_SPEC FBSD_CPP_SPEC
+
+/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate
+ libc, depending on whether we're doing profiling.
+ (like the default, except no -lg, and no -p). */
+#undef LIB_SPEC
+#define LIB_SPEC "\
+ %{!shared: \
+ %{!pg: \
+ %{!pthread:%{!kthread:-lc}%{kthread:-lpthread -lc}} \
+ %{pthread:-lc_r}} \
+ %{pg: \
+ %{!pthread:%{!kthread:-lc_p}%{kthread:-lpthread_p -lc_p}} \
+ %{pthread:-lc_r_p}}}"
+
+
+/************************[ Target stuff ]***********************************/
+
+/* All FreeBSD Architectures support the ELF object file format. */
+#undef OBJECT_FORMAT_ELF
+#define OBJECT_FORMAT_ELF
+
+/* Don't assume anything about the header files. */
+#undef NO_IMPLICIT_EXTERN_C
+#define NO_IMPLICIT_EXTERN_C
+
+/* Implicit library calls should use memcpy, not bcopy, etc. */
+#undef TARGET_MEM_FUNCTIONS
+#define TARGET_MEM_FUNCTIONS
+
+/* Allow #sccs in preprocessor. */
+#undef SCCS_DIRECTIVE
+#define SCCS_DIRECTIVE
+
+/* Tell libgcc2.c that FreeBSD targets support atexit(3). */
+#undef HAVE_ATEXIT
+#define HAVE_ATEXIT
/* Code generation parameters. */
/* Don't default to pcc-struct-return, because gcc is the only compiler, and
- we want to retain compatibility with older gcc versions.
+ we want to retain compatibility with older gcc versions
(even though the svr4 ABI for the i386 says that records and unions are
- returned in memory) */
+ returned in memory). */
+#undef DEFAULT_PCC_STRUCT_RETURN
#define DEFAULT_PCC_STRUCT_RETURN 0
-/* Ensure we the configuration knows our system correctly so we can link with
- libraries compiled with the native cc. */
+/* Writing `int' for a bitfield forces int alignment for the structure. */
+/* XXX: ok for Alpha?? */
+#undef PCC_BITFIELD_TYPE_MATTERS
+#define PCC_BITFIELD_TYPE_MATTERS 1
+
+/* Use periods rather than dollar signs in special g++ assembler names.
+ This ensures the configuration knows our system correctly so we can link
+ with libraries compiled with the native cc. */
#undef NO_DOLLAR_IN_LABEL
+/* The prefix to add to user-visible assembler symbols.
+ For System V Release 4 & ELF the convention is *not* to prepend a leading
+ underscore onto user-level symbol names. */
-/* Miscellaneous parameters. */
+#undef USER_LABEL_PREFIX
+#define USER_LABEL_PREFIX ""
+
+/* Handle #pragma weak and #pragma pack. */
+#undef HANDLE_SYSV_PRAGMA
+#define HANDLE_SYSV_PRAGMA
+
+/* FreeBSD ELF using our home-grown crtbegin.o/crtend.o does not support the
+ DWARF2 unwinding mechanisms. Once `make world' bootstraping problems with
+ the EGCS crtstuff.c is overcome, we will switch to the non-sjlj-exceptions
+ type exception machanism. */
+#define DWARF2_UNWIND_INFO 0
+
+/* Do not use ``thunks'' to implement C++ vtables. This method still has
+ fatal bugs. Also, GCC 3.0 will have a new C++ ABI that may not even
+ support `thunks'. */
+#undef DEFAULT_VTABLE_THUNKS
-/* Tell libgcc2.c that FreeBSD targets support atexit(3). */
-#define HAVE_ATEXIT
+/************************[ Assembler stuff ]********************************/
-/* FREEBSD_NATIVE is defined when gcc is integrated into the FreeBSD
- source tree so it can be configured appropriately without using
- the GNU configure/build mechanism. */
+/* Override the default comment-starter of "/". */
+#undef ASM_COMMENT_START
+#define ASM_COMMENT_START "#"
-#ifdef FREEBSD_NATIVE
+/* Attach a special .ident directive to the end of the file to identify
+ the version of GCC which compiled this code. The format of the
+ .ident string is patterned after the ones produced by native svr4
+ C compilers. */
-/* Look for the include files in the system-defined places. */
+#undef IDENT_ASM_OP
+#define IDENT_ASM_OP ".ident"
-#define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++"
-#define GCC_INCLUDE_DIR "/usr/include"
+/* Output #ident as a .ident. */
-/* Now that GCC knows what the include path applies to, put the G++ one first.
- C++ can now have include files that override the default C ones. */
-#define INCLUDE_DEFAULTS \
- { \
- { GPLUSPLUS_INCLUDE_DIR, "C++", 1, 1 }, \
- { GCC_INCLUDE_DIR, "GCC", 0, 0 }, \
- { 0, 0, 0, 0 } \
+#undef ASM_OUTPUT_IDENT
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf ((FILE), "\t%s\t\"%s\"\n", IDENT_ASM_OP, (NAME));
+
+/* Identify the front-end which produced this file. To keep symbol
+ space down, and not confuse kdb, only do this if the language is
+ not C. (svr4.h defines ASM_IDENTIFY_GCC but neglects this) */
+
+#undef ASM_IDENTIFY_LANGUAGE
+#define ASM_IDENTIFY_LANGUAGE(FILE) \
+ { \
+ if (strcmp (lang_identify (), "c") != 0) \
+ output_lang_identify (FILE); \
}
-/* Under FreeBSD, the normal location of the compiler back ends is the
- /usr/libexec directory. */
+#undef ASM_FILE_END
+#define ASM_FILE_END(FILE) \
+ do { \
+ if (!flag_no_ident) \
+ fprintf ((FILE), "\t%s\t\"[ASM_FILE_END]GCC: (%s) %s\"\n", \
+ IDENT_ASM_OP, lang_identify(), version_string); \
+ } while (0)
+
+/* This is the pseudo-op used to generate a contiguous sequence of byte
+ values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
+ AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
+
+#undef ASCII_DATA_ASM_OP
+#define ASCII_DATA_ASM_OP ".ascii"
+
+#undef ASM_BYTE_OP
+#define ASM_BYTE_OP ".byte"
+
+/* This is how to allocate empty space in some section. The .zero
+ pseudo-op is used for this on most ELF assemblers. */
+
+#undef SKIP_ASM_OP
+#define SKIP_ASM_OP ".zero"
+
+/* How to output some space. The rules are different depending on the
+ object format. */
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE, SIZE) \
+ do { \
+ if (TARGET_ELF) \
+ { \
+ fprintf ((FILE), "\t%s\t%u\n", SKIP_ASM_OP, (SIZE)); \
+ } \
+ else \
+ { \
+ fprintf ((FILE), "\t.space %u\n", (SIZE)); \
+ } \
+ } while (0)
+
+/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
+ ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
+ corresponds to a particular byte value [0..255]. For any
+ given byte value, if the value in the corresponding table
+ position is zero, the given character can be output directly.
+ If the table value is 1, the byte must be output as a \ooo
+ octal escape. If the tables value is anything else, then the
+ byte value should be output as a \ followed by the value
+ in the table. Note that we can use standard UN*X escape
+ sequences for many control characters, but we don't use
+ \a to represent BEL because some svr4 assemblers (e.g. on
+ the i386) don't know about that. Also, we don't use \v
+ since some versions of gas, such as 2.2 did not accept it. */
+
+#define ESCAPES \
+"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
+\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
+
+/* Some svr4 assemblers have a limit on the number of characters which
+ can appear in the operand of a .string directive. If your assembler
+ has such a limitation, you should define STRING_LIMIT to reflect that
+ limit. Note that at least some svr4 assemblers have a limit on the
+ actual number of bytes in the double-quoted string, and that they
+ count each character in an escape sequence as one byte. Thus, an
+ escape sequence like \377 would count as four bytes.
+
+ If your target assembler doesn't support the .string directive, you
+ should define this to zero.
+*/
+
+#undef STRING_LIMIT
+#define STRING_LIMIT ((unsigned) 256)
+
+#undef STRING_ASM_OP
+#define STRING_ASM_OP ".string"
+
+/* Output the label which precedes a jumptable. Note that for all svr4/ELF
+ systems where we actually generate jumptables (which is to say every
+ svr4 target except i386, where we use casesi instead) we put the jump-
+ tables into the .rodata section and since other stuff could have been
+ put into the .rodata section prior to any given jumptable, we have to
+ make sure that the location counter for the .rodata section gets pro-
+ perly re-aligned prior to the actual beginning of the jump table. */
+
+#undef ALIGN_ASM_OP
+#define ALIGN_ASM_OP ".align"
+
+/* This says how to output assembler code to declare an
+ uninitialized external linkage data object. Under SVR4/ELF,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#undef COMMON_ASM_OP
+#define COMMON_ASM_OP ".comm"
+
+#undef ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
+ do { \
+ if (TARGET_ELF) \
+ { \
+ fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+ } \
+ else \
+ { \
+ int rounded = (SIZE); \
+ if (rounded == 0) rounded = 1; \
+ rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; \
+ rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) \
+ * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); \
+ fputs (".comm ", (FILE)); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u\n", (rounded)); \
+ } \
+ } while (0)
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4/ELF,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#undef LOCAL_ASM_OP
+#define LOCAL_ASM_OP ".local"
+
+/* This says how to output assembler code to declare an
+ uninitialized internal linkage data object. Under SVR4,
+ the linker seems to want the alignment of data objects
+ to depend on their types. We do exactly that here. */
+
+#undef ASM_OUTPUT_ALIGNED_LOCAL
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
+ do { \
+ if (TARGET_ELF) \
+ { \
+ fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ ASM_OUTPUT_ALIGNED_COMMON ((FILE), (NAME), (SIZE), (ALIGN)); \
+ } \
+ else \
+ { \
+ int rounded = (SIZE); \
+ if (rounded == 0) rounded = 1; \
+ rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; \
+ rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) \
+ * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); \
+ fputs (".lcomm ", (FILE)); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ",%u\n", (rounded)); \
+ } \
+ } while (0)
+
+#undef ASM_OUTPUT_BEFORE_CASE_LABEL
+#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE) \
+ ASM_OUTPUT_ALIGN ((FILE), 2);
+
+#undef ASM_OUTPUT_CASE_LABEL
+#define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \
+ do { \
+ ASM_OUTPUT_BEFORE_CASE_LABEL ((FILE), (PREFIX), (NUM), (JUMPTABLE)) \
+ ASM_OUTPUT_INTERNAL_LABEL ((FILE), (PREFIX), (NUM)); \
+ } while (0)
+
+/* The standard SVR4/ELF assembler seems to require that certain builtin
+ library routines (e.g. .udiv) be explicitly declared as .globl
+ in each assembly file where they are referenced. */
+
+#undef ASM_OUTPUT_EXTERNAL_LIBCALL
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_GLOBALIZE_LABEL ((FILE), XSTR ((FUN), 0))
+
+/* Support const sections and the ctors and dtors sections for g++.
+ Note that there appears to be two different ways to support const
+ sections at the moment. You can either #define the symbol
+ READONLY_DATA_SECTION (giving it some code which switches to the
+ readonly data section) or else you can #define the symbols
+ EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
+ SELECT_RTX_SECTION. We do both here just to be on the safe side.
+ FreeBSD conditionalizes the use of ".section rodata" depending on
+ ELF mode - otherwise .text. */
+
+#undef USE_CONST_SECTION
+#define USE_CONST_SECTION TARGET_ELF
+
+#undef CONST_SECTION_ASM_OP
+#define CONST_SECTION_ASM_OP ".section\t.rodata"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
+#undef CTORS_SECTION_ASM_OP
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"aw\""
+#undef DTORS_SECTION_ASM_OP
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"aw\""
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+
+#undef INIT_SECTION_ASM_OP
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#undef FINI_SECTION_ASM_OP
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* A default list of other sections which we might be "in" at any given
+ time. For targets that use additional sections (e.g. .tdesc) you
+ should override this definition in the target-specific file which
+ includes this file. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_const, in_ctors, in_dtors
+
+/* A default list of extra section function definitions. For targets
+ that use additional sections (e.g. .tdesc) you should override this
+ definition in the target-specific file which includes this file. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CONST_SECTION_FUNCTION \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#undef READONLY_DATA_SECTION
+#define READONLY_DATA_SECTION() const_section ()
+
+extern void text_section ();
+
+#undef CONST_SECTION_FUNCTION
+#define CONST_SECTION_FUNCTION \
+ void \
+ const_section () \
+ { \
+ if (!USE_CONST_SECTION) \
+ text_section(); \
+ else if (in_section != in_const) \
+ { \
+ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
+ in_section = in_const; \
+ } \
+ }
+
+#undef CTORS_SECTION_FUNCTION
+#define CTORS_SECTION_FUNCTION \
+ void \
+ ctors_section () \
+ { \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+ }
+
+#undef DTORS_SECTION_FUNCTION
+#define DTORS_SECTION_FUNCTION \
+ void \
+ dtors_section () \
+ { \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+ }
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#undef ASM_OUTPUT_CONSTRUCTOR
+#define ASM_OUTPUT_CONSTRUCTOR(FILE, NAME) \
+ do { \
+ if (TARGET_ELF) \
+ { \
+ ctors_section (); \
+ fprintf ((FILE), "\t%s\t ", INT_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ } \
+ else \
+ { \
+ fprintf (asm_out_file, "%s \"%s__CTOR_LIST__\",22,0,0,", \
+ ASM_STABS_OP, (TARGET_UNDERSCORES) ? "_" : ""); \
+ assemble_name (asm_out_file, name); \
+ fputc ('\n', asm_out_file); \
+ } \
+ } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global destructors. */
+#undef ASM_OUTPUT_DESTRUCTOR
+#define ASM_OUTPUT_DESTRUCTOR(FILE, NAME) \
+ do { \
+ if (TARGET_ELF) \
+ { \
+ dtors_section (); \
+ fprintf ((FILE), "\t%s\t ", INT_ASM_OP); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), "\n"); \
+ } \
+ else \
+ { \
+ fprintf (asm_out_file, "%s \"%s__DTOR_LIST__\",22,0,0,", \
+ ASM_STABS_OP, (TARGET_UNDERSCORES) ? "_" : ""); \
+ assemble_name (asm_out_file, name); \
+ fputc ('\n', asm_out_file); \
+ } \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of RTX in mode MODE. RTX is some kind
+ of constant in RTL. The argument MODE is redundant except
+ in the case of a `const_int' rtx. Currently, these always
+ go into the const section. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE, RTX) const_section()
+
+/* Define the strings used for the special svr4/ELF .type and .size
+ directives. These strings generally do not vary from one svr4/ELF
+ system to another. */
+
+#undef TYPE_ASM_OP
+#define TYPE_ASM_OP ".type"
+#undef SIZE_ASM_OP
+#define SIZE_ASM_OP ".size"
+
+/* This is how we tell the assembler that a symbol is weak. */
+
+#undef ASM_WEAKEN_LABEL
+#define ASM_WEAKEN_LABEL(FILE, NAME) \
+ do { \
+ fputs ("\t.globl\t", (FILE)); assemble_name ((FILE), (NAME)); \
+ fputc ('\n', (FILE)); \
+ fputs ("\t.weak\t", (FILE)); assemble_name ((FILE), (NAME)); \
+ fputc ('\n', (FILE)); \
+ } while (0)
+
+/* The following macro defines the [default] format used with ELF to output
+ the second operand of the .type assembler directive. */
+
+#undef TYPE_OPERAND_FMT
+#define TYPE_OPERAND_FMT "@%s"
+
+/* Write the extra assembler code needed to declare a function's result.
+ Most svr4/ELF assemblers don't require any special declaration of the
+ result value. */
+
+#undef ASM_DECLARE_RESULT
+#define ASM_DECLARE_RESULT(FILE, RESULT)
+
+/* These macros generate the special .type and .size directives which
+ are used to set the corresponding fields of the linker symbol table
+ entries in an ELF object file under SVR4/ELF. These macros also output
+ the starting labels for the relevant functions/objects. */
+
+/* Write the extra assembler code needed to declare an object properly. */
+
+#undef ASM_DECLARE_OBJECT_NAME
+#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
+ do { \
+ fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ putc (',', FILE); \
+ fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
+ putc ('\n', FILE); \
+ size_directive_output = 0; \
+ if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
+ { \
+ size_directive_output = 1; \
+ fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ putc (',', FILE); \
+ fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, \
+ int_size_in_bytes (TREE_TYPE (DECL))); \
+ fputc ('\n', FILE); \
+ } \
+ ASM_OUTPUT_LABEL(FILE, NAME); \
+ } while (0)
+
+/* Output the size directive for a decl in rest_of_decl_compilation
+ in the case where we did not do so before the initializer.
+ Once we find the error_mark_node, we know that the value of
+ size_directive_output was set
+ by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
+
+#undef ASM_FINISH_DECLARE_OBJECT
+#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
+ do { \
+ char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
+ if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
+ && ! AT_END && TOP_LEVEL \
+ && DECL_INITIAL (DECL) == error_mark_node \
+ && !size_directive_output) \
+ { \
+ size_directive_output = 1; \
+ fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
+ assemble_name (FILE, name); \
+ putc (',', FILE); \
+ fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, \
+ int_size_in_bytes (TREE_TYPE (DECL))); \
+ fputc ('\n', FILE); \
+ } \
+ } while (0)
+
+
+/************************[ Debugger stuff ]*********************************/
-#define STANDARD_EXEC_PREFIX "/usr/libexec/"
-#define TOOLDIR_BASE_PREFIX "/usr/libexec/"
+/* All ELF targets can support DWARF-2. */
+#undef DWARF2_DEBUGGING_INFO
+#define DWARF2_DEBUGGING_INFO
-/* Under FreeBSD, the normal location of the various *crt*.o files is the
- /usr/lib directory. */
+/* This is BSD, so we want the DBX format. */
+#undef DBX_DEBUGGING_INFO
+#define DBX_DEBUGGING_INFO
-#define STANDARD_STARTFILE_PREFIX "/usr/lib/"
+/* Use stabs instead of DWARF debug format. */
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-/* FreeBSD is 4.4BSD derived */
-#define bsd4_4
+/* But allow STABS to be supported as well.
+ Note that we want to override some definition settings done for some
+ architecture's native OS's tools that don't apply to us. */
+#undef ASM_IDENTIFY_GCC
+#undef ASM_IDENTIFY_LANGUAGE
-#endif /* FREEBSD_NATIVE */
+#include "dbxelf.h"
diff --git a/contrib/gcc/config/i386/freebsd-elf.h b/contrib/gcc/config/i386/freebsd-elf.h
deleted file mode 100644
index e97d4ca..0000000
--- a/contrib/gcc/config/i386/freebsd-elf.h
+++ /dev/null
@@ -1,257 +0,0 @@
-/* Definitions for Intel 386 running FreeBSD with ELF format
- Copyright (C) 1996 Free Software Foundation, Inc.
- Contributed by Eric Youngdale.
- Modified for stabs-in-ELF by H.J. Lu.
- Adapted from GNU/Linux version by John Polstra.
- Continued development by David O'Brien <obrien@freebsd.org>
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC 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 GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#undef TARGET_VERSION
-#define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)");
-
-/* The svr4 ABI for the i386 says that records and unions are returned
- in memory. */
-/* On FreeBSD, we do not. */
-#undef DEFAULT_PCC_STRUCT_RETURN
-#define DEFAULT_PCC_STRUCT_RETURN 0
-
-/* This gets defined in tm.h->linux.h->svr4.h, and keeps us from using
- libraries compiled with the native cc, so undef it. */
-#undef NO_DOLLAR_IN_LABEL
-
-/* Use more efficient ``thunks'' to implement C++ vtables. */
-#undef DEFAULT_VTABLE_THUNKS
-#define DEFAULT_VTABLE_THUNKS 1
-
-/* Override the default comment-starter of "/". */
-#undef ASM_COMMENT_START
-#define ASM_COMMENT_START "#"
-
-#undef ASM_APP_ON
-#define ASM_APP_ON "#APP\n"
-
-#undef ASM_APP_OFF
-#define ASM_APP_OFF "#NO_APP\n"
-
-#undef SET_ASM_OP
-#define SET_ASM_OP ".set"
-
-/* This is how to output an element of a case-vector that is relative.
- This is only used for PIC code. See comments by the `casesi' insn in
- i386.md for an explanation of the expression this outputs. */
-#undef ASM_OUTPUT_ADDR_DIFF_ELT
-#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
- fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
-
-/* Indicate that jump tables go in the text section. This is
- necessary when compiling PIC code. */
-#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
-
-/* Use stabs instead of DWARF debug format. */
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-
-/* Copy this from the svr4 specifications... */
-/* Define the register numbers to be used in Dwarf debugging information.
- The SVR4 reference port C compiler uses the following register numbers
- in its Dwarf output code:
- 0 for %eax (gnu regno = 0)
- 1 for %ecx (gnu regno = 2)
- 2 for %edx (gnu regno = 1)
- 3 for %ebx (gnu regno = 3)
- 4 for %esp (gnu regno = 7)
- 5 for %ebp (gnu regno = 6)
- 6 for %esi (gnu regno = 4)
- 7 for %edi (gnu regno = 5)
- The following three DWARF register numbers are never generated by
- the SVR4 C compiler or by the GNU compilers, but SDB on x86/svr4
- believes these numbers have these meanings.
- 8 for %eip (no gnu equivalent)
- 9 for %eflags (no gnu equivalent)
- 10 for %trapno (no gnu equivalent)
- It is not at all clear how we should number the FP stack registers
- for the x86 architecture. If the version of SDB on x86/svr4 were
- a bit less brain dead with respect to floating-point then we would
- have a precedent to follow with respect to DWARF register numbers
- for x86 FP registers, but the SDB on x86/svr4 is so completely
- broken with respect to FP registers that it is hardly worth thinking
- of it as something to strive for compatibility with.
- The version of x86/svr4 SDB I have at the moment does (partially)
- seem to believe that DWARF register number 11 is associated with
- the x86 register %st(0), but that's about all. Higher DWARF
- register numbers don't seem to be associated with anything in
- particular, and even for DWARF regno 11, SDB only seems to under-
- stand that it should say that a variable lives in %st(0) (when
- asked via an `=' command) if we said it was in DWARF regno 11,
- but SDB still prints garbage when asked for the value of the
- variable in question (via a `/' command).
- (Also note that the labels SDB prints for various FP stack regs
- when doing an `x' command are all wrong.)
- Note that these problems generally don't affect the native SVR4
- C compiler because it doesn't allow the use of -O with -g and
- because when it is *not* optimizing, it allocates a memory
- location for each floating-point variable, and the memory
- location is what gets described in the DWARF AT_location
- attribute for the variable in question.
- Regardless of the severe mental illness of the x86/svr4 SDB, we
- do something sensible here and we use the following DWARF
- register numbers. Note that these are all stack-top-relative
- numbers.
- 11 for %st(0) (gnu regno = 8)
- 12 for %st(1) (gnu regno = 9)
- 13 for %st(2) (gnu regno = 10)
- 14 for %st(3) (gnu regno = 11)
- 15 for %st(4) (gnu regno = 12)
- 16 for %st(5) (gnu regno = 13)
- 17 for %st(6) (gnu regno = 14)
- 18 for %st(7) (gnu regno = 15)
-*/
-#undef DBX_REGISTER_NUMBER
-#define DBX_REGISTER_NUMBER(n) \
-((n) == 0 ? 0 \
- : (n) == 1 ? 2 \
- : (n) == 2 ? 1 \
- : (n) == 3 ? 3 \
- : (n) == 4 ? 6 \
- : (n) == 5 ? 7 \
- : (n) == 6 ? 5 \
- : (n) == 7 ? 4 \
- : ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
- : (-1))
-
-/* Tell final.c that we don't need a label passed to mcount. */
-
-#undef FUNCTION_PROFILER
-#define FUNCTION_PROFILER(FILE, LABELNO) \
-{ \
- if (flag_pic) \
- fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
- else \
- fprintf (FILE, "\tcall .mcount\n"); \
-}
-
-#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
-
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "int"
-
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "int"
-
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
-
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE BITS_PER_WORD
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Di386 -Dunix -D__ELF__ -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
-
-#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
-
-/* This defines which switch letters take arguments. On FreeBSD, most of
- the normal cases (defined in gcc.c) apply, and we also have -h* and
- -z* options (for the linker) (comming from svr4).
- We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
-
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR) \
- (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
- || (CHAR) == 'h' \
- || (CHAR) == 'z' \
- || (CHAR) == 'R')
-
-/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add
- the magical crtbegin.o file (see crtstuff.c) which provides part
- of the support for getting C++ file-scope static object constructed
- before entering `main'. */
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
- "%{!shared: \
- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
- %{!p:%{profile:gcrt1.o%s} \
- %{!profile:crt1.o%s}}}} \
- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-
-/* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
- the magical crtend.o file (see crtstuff.c) which provides part of
- the support for getting C++ file-scope static object constructed
- before entering `main', followed by a normal "finalizer" file,
- `crtn.o'. */
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
-
-/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate
- libc, depending on whether we're doing profiling or need threads support.
- (simular to the default, except no -lg, and no -p. */
-
-#undef LIB_SPEC
-#define LIB_SPEC "%{!shared: \
- %{!pg:%{!pthread:%{!kthread:-lc} \
- %{kthread:-lpthread -lc}} \
- %{pthread:-lc_r}} \
- %{pg:%{!pthread:%{!kthread:-lc_p} \
- %{kthread:-lpthread_p -lc_p}} \
- %{pthread:-lc_r_p}}}"
-
-/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
- for the special GCC options -static and -shared, which allow us to
- link things in one of these three modes by applying the appropriate
- combinations of options at link-time. We like to support here for
- as many of the other GNU linker options as possible. But I don't
- have the time to search for those flags. I am sure how to add
- support for -soname shared_object_name. H.J.
-
- I took out %{v:%{!V:-V}}. It is too much :-(. They can use
- -Wl,-V.
-
- When the -shared link option is used a final link is not being
- done. */
-
-#undef LINK_SPEC
-#define LINK_SPEC "-m elf_i386 \
- %{Wl,*:%*} \
- %{v:-V} \
- %{assert*} %{R*} %{rpath*} %{defsym*} \
- %{shared:-Bshareable %{h*} %{soname*}} \
- %{!shared: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}} \
- %{static:-Bstatic}} \
- %{symbolic:-Bsymbolic}"
-
-/* A C statement to output to the stdio stream FILE an assembler
- command to advance the location counter to a multiple of 1<<LOG
- bytes if it is within MAX_SKIP bytes.
-
- This is used to align code labels according to Intel recommendations. */
-
-#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
-#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
- if ((LOG) != 0) {\
- if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
- else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
- }
-#endif
diff --git a/contrib/gcc/config/i386/freebsd.h b/contrib/gcc/config/i386/freebsd.h
index 8c907bf..d4a0358 100644
--- a/contrib/gcc/config/i386/freebsd.h
+++ b/contrib/gcc/config/i386/freebsd.h
@@ -1,8 +1,9 @@
-/* Definitions for Intel 386 running FreeBSD with ELF format
- Copyright (C) 1996 Free Software Foundation, Inc.
+/* Definitions for Intel 386 running FreeBSD with either a.out or ELF format
+ Copyright (C) 1996-2000 Free Software Foundation, Inc.
Contributed by Eric Youngdale.
Modified for stabs-in-ELF by H.J. Lu.
Adapted from GNU/Linux version by John Polstra.
+ Added support for generating "old a.out gas" on the fly by Peter Wemm.
Continued development by David O'Brien <obrien@freebsd.org>
This file is part of GNU CC.
@@ -22,50 +23,548 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#undef TARGET_VERSION
-#define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)");
+/* $FreeBSD$ */
-/* The svr4 ABI for the i386 says that records and unions are returned
- in memory. */
-/* On FreeBSD, we do not. */
-#undef DEFAULT_PCC_STRUCT_RETURN
-#define DEFAULT_PCC_STRUCT_RETURN 0
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES \
+ "-Di386 -Acpu(i386) -Amachine(i386)" \
+ FBSD_CPP_PREDEFINES
-/* This gets defined in tm.h->linux.h->svr4.h, and keeps us from using
- libraries compiled with the native cc, so undef it. */
-#undef NO_DOLLAR_IN_LABEL
+#undef CC1_SPEC
+#define CC1_SPEC "\
+ %{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} \
+ %{maout: %{!mno-underscores: %{!munderscores: -munderscores }}}"
-/* Use more efficient ``thunks'' to implement C++ vtables. */
-#undef DEFAULT_VTABLE_THUNKS
-#define DEFAULT_VTABLE_THUNKS 2
+#undef ASM_SPEC
+#define ASM_SPEC "%{v*: -v} %{maout: %{fpic:-k} %{fPIC:-k}}"
-/* Override the default comment-starter of "/". */
-#undef ASM_COMMENT_START
-#define ASM_COMMENT_START "#"
+#undef ASM_FINAL_SPEC
+#define ASM_FINAL_SPEC "%|"
-#undef ASM_APP_ON
-#define ASM_APP_ON "#APP\n"
+/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
+ for the special GCC options -static and -shared, which allow us to
+ link things in one of these three modes by applying the appropriate
+ combinations of options at link-time. We like to support here for
+ as many of the other GNU linker options as possible. But I don't
+ have the time to search for those flags. I am sure how to add
+ support for -soname shared_object_name. H.J.
+
+ I took out %{v:%{!V:-V}}. It is too much :-(. They can use
+ -Wl,-V.
-#undef ASM_APP_OFF
-#define ASM_APP_OFF "#NO_APP\n"
+ When the -shared link option is used a final link is not being
+ done. */
-#undef SET_ASM_OP
-#define SET_ASM_OP ".set"
+#undef LINK_SPEC
+#define LINK_SPEC "\
+ %{p:%e`-p' not supported; use `-pg' and gprof(1)} \
+ %{maout: %{shared:-Bshareable} \
+ %{!shared:%{!nostdlib:%{!r:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} \
+ %{pg:-Bstatic} %{Z}} \
+ %{assert*} %{R*}} \
+ %{!maout: \
+ -m elf_i386 \
+ %{Wl,*:%*} \
+ %{assert*} %{R*} %{rpath*} %{defsym*} \
+ %{shared:-Bshareable %{h*} %{soname*}} \
+ %{symbolic:-Bsymbolic} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic: -export-dynamic} \
+ %{!dynamic-linker: -dynamic-linker /usr/libexec/ld-elf.so.1}} \
+ %{static:-Bstatic}}}"
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC "\
+ %{maout: %{shared:c++rt0.o%s} \
+ %{!shared: \
+ %{pg:gcrt0.o%s}%{!pg: \
+ %{static:scrt0.o%s} \
+ %{!static:crt0.o%s}}}} \
+ %{!maout: \
+ %{!shared: \
+ %{pg:gcrt1.o%s} \
+ %{!pg: \
+ %{p:gcrt1.o%s} \
+ %{!p:crt1.o%s}}} \
+ crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
+
+/* Provide an ENDFILE_SPEC appropriate for FreeBSD/i386. Here we tack on our
+ own magical crtend.o file (compare w/crtstuff.c) which provides part of the
+ support for getting C++ file-scope static object constructed before
+ entering `main', followed by the normal "finalizer" file, `crtn.o'. */
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "\
+ %{!maout: \
+ %{!shared:crtend.o%s} \
+ %{shared:crtendS.o%s} crtn.o%s}"
+
+
+/************************[ Target stuff ]***********************************/
+
+/* Define the actual types of some ANSI-mandated types.
+ Needs to agree with <machine/ansi.h>. GCC defaults come from c-decl.c,
+ c-common.c, and config/<arch>/<arch>.h. */
+
+#undef SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
+
+/* This is the pseudo-op used to generate a 32-bit word of data with a
+ specific value in some section. */
+
+#undef INT_ASM_OP
+#define INT_ASM_OP ".long"
+
+/* Biggest alignment supported by the object file format of this
+ machine. Use this macro to limit the alignment which can be
+ specified using the `__attribute__ ((aligned (N)))' construct. If
+ not defined, the default value is `BIGGEST_ALIGNMENT'. */
+
+#define MAX_OFILE_ALIGNMENT (32768*8)
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)");
+
+#define MASK_PROFILER_EPILOGUE 010000000000
+#define MASK_AOUT 004000000000 /* a.out not elf */
+#define MASK_UNDERSCORES 002000000000 /* use leading _ */
+
+#define TARGET_PROFILER_EPILOGUE (target_flags & MASK_PROFILER_EPILOGUE)
+#define TARGET_AOUT (target_flags & MASK_AOUT)
+#define TARGET_ELF ((target_flags & MASK_AOUT) == 0)
+#define TARGET_UNDERSCORES ((target_flags & MASK_UNDERSCORES) != 0)
+
+#undef SUBTARGET_SWITCHES
+#define SUBTARGET_SWITCHES \
+ { "profiler-epilogue", MASK_PROFILER_EPILOGUE}, \
+ { "no-profiler-epilogue", -MASK_PROFILER_EPILOGUE}, \
+ { "aout", MASK_AOUT}, \
+ { "no-aout", -MASK_AOUT}, \
+ { "underscores", MASK_UNDERSCORES}, \
+ { "no-underscores", -MASK_UNDERSCORES},
+
+/* This goes away when the math emulator is fixed. */
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT \
+ (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
+
+/* Prefix for internally generated assembler labels. If we aren't using
+ underscores, we are using prefix `.'s to identify labels that should
+ be ignored, as in `i386/gas.h' --karl@cs.umb.edu */
+#undef LPREFIX
+#define LPREFIX ((TARGET_UNDERSCORES) ? "L" : ".L")
+
+/* The a.out tools do not support "linkonce" sections. */
+#undef SUPPORTS_ONE_ONLY
+#define SUPPORTS_ONE_ONLY TARGET_ELF
+
+/* Enable alias attribute support. */
+#undef SET_ASM_OP
+#define SET_ASM_OP ".set"
+
+/* The a.out tools do not support "Lscope" .stabs symbols. */
+#undef NO_DBX_FUNCTION_END
+#define NO_DBX_FUNCTION_END TARGET_AOUT
+
+/* In ELF, the function stabs come first, before the relative offsets. */
+#undef DBX_FUNCTION_FIRST
+#define DBX_CHECK_FUNCTION_FIRST TARGET_ELF
+
+/* supply our own hook for calling __main() from main() */
+#undef INVOKE__main
+#define INVOKE__main
+#undef GEN_CALL__MAIN
+#define GEN_CALL__MAIN \
+ do { \
+ if (!(TARGET_ELF)) \
+ emit_library_call (gen_rtx (SYMBOL_REF, Pmode, NAME__MAIN), 0, \
+ VOIDmode, 0); \
+ } while (0)
+
+/* Indicate that jump tables go in the text section. This is
+ necessary when compiling PIC code. */
+#undef JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
+
+/* override the exception table positioning */
+#undef EXCEPTION_SECTION
+#define EXCEPTION_SECTION() \
+ do { \
+ if (TARGET_ELF) \
+ { \
+ named_section (NULL_TREE, ".gcc_except_table", 0); \
+ } \
+ else \
+ { \
+ if (flag_pic) \
+ data_section (); \
+ else \
+ readonly_data_section (); \
+ } \
+ } while (0);
+
+/* Tell final.c that we don't need a label passed to mcount. */
+#undef NO_PROFILE_DATA
+#define NO_PROFILE_DATA
+
+/* Output assembler code to FILE to begin profiling of the current function.
+ LABELNO is an optional label. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ do { \
+ char *_name = TARGET_AOUT ? "mcount" : ".mcount"; \
+ if (flag_pic) \
+ fprintf ((FILE), "\tcall *%s@GOT(%%ebx)\n", _name); \
+ else \
+ fprintf ((FILE), "\tcall %s\n", _name); \
+ } while (0)
+
+/* Output assembler code to FILE to end profiling of the current function. */
+
+#undef FUNCTION_PROFILER_EPILOGUE
+#define FUNCTION_PROFILER_EPILOGUE(FILE, DO_RTL) \
+ do { \
+ if (TARGET_PROFILER_EPILOGUE) \
+ { \
+ if (DO_RTL) \
+ { \
+ /* ".mexitcount" is specially handled in \
+ ASM_HACK_SYMBOLREF () so that we don't need to handle \
+ flag_pic or TARGET_AOUT here. */ \
+ rtx xop; \
+ xop = gen_rtx_MEM (FUNCTION_MODE, \
+ gen_rtx_SYMBOL_REF (Pmode, ".mexitcount")); \
+ emit_call_insn (gen_rtx (CALL, VOIDmode, xop, const0_rtx)); \
+ } \
+ else \
+ { \
+ /* XXX this !DO_RTL case is broken but not actually used. */ \
+ char *_name = TARGET_AOUT ? "mcount" : ".mcount"; \
+ if (flag_pic) \
+ fprintf (FILE, "\tcall *%s@GOT(%%ebx)\n", _name); \
+ else \
+ fprintf (FILE, "\tcall %s\n", _name); \
+ } \
+ } \
+ } while (0)
+
+
+/************************[ Assembler stuff ]********************************/
+
+#undef ASM_APP_ON
+#define ASM_APP_ON "#APP\n"
+
+#undef ASM_APP_OFF
+#define ASM_APP_OFF "#NO_APP\n"
+
+/* This is how to begin an assembly language file.
+ The .file command should always begin the output.
+ ELF also needs a .version. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+ do { \
+ output_file_directive ((FILE), main_input_filename); \
+ if (TARGET_ELF) \
+ fprintf ((FILE), "\t.version\t\"01.01\"\n"); \
+ } while (0)
+
+/* This is how to store into the string BUF
+ the symbol_ref name of an internal numbered label where
+ PREFIX is the class of label and NUM is the number within the class.
+ This is suitable for output with `assemble_name'. */
+#undef ASM_GENERATE_INTERNAL_LABEL
+#define ASM_GENERATE_INTERNAL_LABEL(BUF, PREFIX, NUMBER) \
+ sprintf ((BUF), "*%s%s%d", (TARGET_UNDERSCORES) ? "" : ".", \
+ (PREFIX), (NUMBER))
+
+/* This is how to output an internal numbered label where
+ PREFIX is the class of label and NUM is the number within the class.
+ For most svr4/ELF systems, the convention is that any symbol which begins
+ with a period is not put into the linker symbol table by the assembler. */
+#undef ASM_OUTPUT_INTERNAL_LABEL
+#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
+ fprintf ((FILE), "%s%s%d:\n", (TARGET_UNDERSCORES) ? "" : ".", \
+ (PREFIX), (NUM))
+
+/* This is how to output a reference to a user-level label named NAME. */
+#undef ASM_OUTPUT_LABELREF
+#define ASM_OUTPUT_LABELREF(FILE, NAME) \
+ do { \
+ char *_name = (NAME); \
+ /* Hack to avoid writing lots of rtl in \
+ FUNCTION_PROFILER_EPILOGUE (). */ \
+ if (*_name == '.' && strcmp(_name + 1, "mexitcount") == 0) \
+ { \
+ if (TARGET_AOUT) \
+ _name++; \
+ if (flag_pic) \
+ fprintf ((FILE), "*%s@GOT(%%ebx)", _name); \
+ else \
+ fprintf ((FILE), "%s", _name); \
+ } \
+ else \
+ fprintf (FILE, "%s%s", TARGET_UNDERSCORES ? "_" : "", _name); \
+} while (0)
+
+/* This is how to hack on the symbol code of certain relcalcitrant
+ symbols to modify their output in output_pic_addr_const (). */
+
+#undef ASM_HACK_SYMBOLREF_CODE
+#define ASM_HACK_SYMBOLREF_CODE(NAME, CODE) \
+ do { \
+ /* Part of hack to avoid writing lots of rtl in \
+ FUNCTION_PROFILER_EPILOGUE (). */ \
+ char *_name = (NAME); \
+ if (*_name == '.' && strcmp(_name + 1, "mexitcount") == 0) \
+ (CODE) = 'X'; \
+ } while (0)
/* This is how to output an element of a case-vector that is relative.
This is only used for PIC code. See comments by the `casesi' insn in
i386.md for an explanation of the expression this outputs. */
-#undef ASM_OUTPUT_ADDR_DIFF_ELT
-#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
- fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
+#undef ASM_OUTPUT_ADDR_DIFF_ELT
+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
+ fprintf ((FILE), "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, (VALUE))
+
+#undef ASM_OUTPUT_ALIGN
+#define ASM_OUTPUT_ALIGN(FILE, LOG) \
+ if ((LOG)!=0) { \
+ if (in_text_section()) \
+ fprintf ((FILE), "\t.p2align %d,0x90\n", (LOG)); \
+ else \
+ fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
+ }
+
+#undef ASM_OUTPUT_SOURCE_LINE
+#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
+ do { \
+ static int sym_lineno = 1; \
+ if (TARGET_ELF) \
+ { \
+ fprintf ((FILE), ".stabn 68,0,%d,.LM%d-", (LINE), sym_lineno); \
+ assemble_name ((FILE), \
+ XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
+ fprintf ((FILE), "\n.LM%d:\n", sym_lineno); \
+ sym_lineno += 1; \
+ } \
+ else \
+ { \
+ fprintf ((FILE), "\t%s %d,0,%d\n", ASM_STABD_OP, N_SLINE, \
+ lineno); \
+ } \
+ } while (0)
+
+/* These macros generate the special .type and .size directives which
+ are used to set the corresponding fields of the linker symbol table
+ entries in an ELF object file under SVR4. These macros also output
+ the starting labels for the relevant functions/objects. */
+
+/* Write the extra assembler code needed to declare a function properly.
+ Some svr4 assemblers need to also have something extra said about the
+ function's return value. We allow for that here. */
+
+#undef ASM_DECLARE_FUNCTION_NAME
+#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
+ do { \
+ fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ putc (',', FILE); \
+ fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
+ putc ('\n', FILE); \
+ ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
+ ASM_OUTPUT_LABEL(FILE, NAME); \
+ } while (0)
+
+/* This is how to declare the size of a function. */
+
+#undef ASM_DECLARE_FUNCTION_SIZE
+#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
+ do { \
+ if (!flag_inhibit_size_directive) \
+ { \
+ char label[256]; \
+ static int labelno; \
+ labelno++; \
+ ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
+ fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
+ assemble_name (FILE, (FNAME)); \
+ fprintf (FILE, ","); \
+ assemble_name (FILE, label); \
+ fprintf (FILE, "-"); \
+ assemble_name (FILE, (FNAME)); \
+ putc ('\n', FILE); \
+ } \
+ } while (0)
+
+
+/* The routine used to output NUL terminated strings. We use a special
+ version of this for most svr4 targets because doing so makes the
+ generated assembly code more compact (and thus faster to assemble)
+ as well as more readable, especially for targets like the i386
+ (where the only alternative is to output character sequences as
+ comma separated lists of numbers). */
+
+#undef ASM_OUTPUT_LIMITED_STRING
+#define ASM_OUTPUT_LIMITED_STRING(FILE, STR) \
+ do { \
+ register unsigned char *_limited_str = (unsigned char *) (STR); \
+ register unsigned ch; \
+ fprintf ((FILE), "\t%s\t\"", STRING_ASM_OP); \
+ for (; (ch = *_limited_str); _limited_str++) \
+ { \
+ register int escape; \
+ switch (escape = ESCAPES[ch]) \
+ { \
+ case 0: \
+ putc (ch, (FILE)); \
+ break; \
+ case 1: \
+ fprintf ((FILE), "\\%03o", ch); \
+ break; \
+ default: \
+ putc ('\\', (FILE)); \
+ putc (escape, (FILE)); \
+ break; \
+ } \
+ } \
+ fprintf ((FILE), "\"\n"); \
+ } while (0)
+
+/* Switch into a generic section.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl.
+
+ If the section has already been defined, we must not
+ emit the attributes here. The SVR4 assembler does not
+ recognize section redefinitions.
+ If DECL is NULL, no attributes are emitted. */
+
+#undef ASM_OUTPUT_SECTION_NAME
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ do { \
+ static struct section_info \
+ { \
+ struct section_info *next; \
+ char *name; \
+ enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \
+ } *sections; \
+ struct section_info *s; \
+ char *mode; \
+ enum sect_enum type; \
+ \
+ for (s = sections; s; s = s->next) \
+ if (!strcmp (NAME, s->name)) \
+ break; \
+ \
+ if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
+ type = SECT_EXEC, mode = "ax"; \
+ else if (DECL && DECL_READONLY_SECTION (DECL, RELOC)) \
+ type = SECT_RO, mode = "a"; \
+ else \
+ type = SECT_RW, mode = "aw"; \
+ \
+ if (s == 0) \
+ { \
+ s = (struct section_info *) xmalloc (sizeof (struct section_info)); \
+ s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME)); \
+ strcpy (s->name, NAME); \
+ s->type = type; \
+ s->next = sections; \
+ sections = s; \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, mode); \
+ } \
+ else \
+ { \
+ if (DECL && s->type != type) \
+ error_with_decl (DECL, "%s causes a section type conflict"); \
+ \
+ fprintf (FILE, ".section\t%s\n", NAME); \
+ } \
+ } while (0)
+
+#undef MAKE_DECL_ONE_ONLY
+#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#undef UNIQUE_SECTION_P
+#define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
+#undef UNIQUE_SECTION
+#define UNIQUE_SECTION(DECL,RELOC) \
+ do { \
+ int len; \
+ char *name, *string, *prefix; \
+ \
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
+ \
+ if (! DECL_ONE_ONLY (DECL)) \
+ { \
+ prefix = "."; \
+ if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ prefix = ".text."; \
+ else if (DECL_READONLY_SECTION (DECL, RELOC)) \
+ prefix = ".rodata."; \
+ else \
+ prefix = ".data."; \
+ } \
+ else if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ prefix = ".gnu.linkonce.t."; \
+ else if (DECL_READONLY_SECTION (DECL, RELOC)) \
+ prefix = ".gnu.linkonce.r."; \
+ else \
+ prefix = ".gnu.linkonce.d."; \
+ \
+ len = strlen (name) + strlen (prefix); \
+ string = alloca (len + 1); \
+ sprintf (string, "%s%s", prefix, name); \
+ \
+ DECL_SECTION_NAME (DECL) = build_string (len, string); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#undef SELECT_SECTION
+#define SELECT_SECTION(DECL,RELOC) \
+ { \
+ if (flag_pic && RELOC) \
+ data_section (); \
+ else if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if (! DECL_READONLY_SECTION (DECL, RELOC)) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+ }
+
+/* Define macro used to output shift-double opcodes when the shift
+ count is in %cl. Some assemblers require %cl as an argument;
+ some don't.
+
+ *OLD* GAS requires the %cl argument, so override i386/unix.h. */
+
+#undef AS3_SHIFT_DOUBLE
+#define AS3_SHIFT_DOUBLE(a,b,c,d) AS3 (a,b,c,d)
-/* Indicate that jump tables go in the text section. This is
- necessary when compiling PIC code. */
-#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
-/* Use stabs instead of DWARF debug format. */
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+/************************[ Debugger stuff ]*********************************/
/* Copy this from the svr4 specifications... */
/* Define the register numbers to be used in Dwarf debugging information.
@@ -122,8 +621,8 @@ Boston, MA 02111-1307, USA. */
17 for %st(6) (gnu regno = 14)
18 for %st(7) (gnu regno = 15)
*/
-#undef DBX_REGISTER_NUMBER
-#define DBX_REGISTER_NUMBER(n) \
+#undef DWARF_DBX_REGISTER_NUMBER
+#define DWARF_DBX_REGISTER_NUMBER(n) \
((n) == 0 ? 0 \
: (n) == 1 ? 2 \
: (n) == 2 ? 1 \
@@ -135,123 +634,59 @@ Boston, MA 02111-1307, USA. */
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Tell final.c that we don't need a label passed to mcount. */
-
-#undef FUNCTION_PROFILER
-#define FUNCTION_PROFILER(FILE, LABELNO) \
-{ \
- if (flag_pic) \
- fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
- else \
- fprintf (FILE, "\tcall .mcount\n"); \
-}
-
-#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
-
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "int"
-
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "int"
-
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
-
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE BITS_PER_WORD
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Di386 -Dunix -D__ELF__ -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
-
-#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
-
-/* This defines which switch letters take arguments. On FreeBSD, most of
- the normal cases (defined in gcc.c) apply, and we also have -h* and
- -z* options (for the linker) (comming from svr4).
- We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
-
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR) \
- (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
- || (CHAR) == 'h' \
- || (CHAR) == 'z' \
- || (CHAR) == 'R')
-
-/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add
- the magical crtbegin.o file (see crtstuff.c) which provides part
- of the support for getting C++ file-scope static object constructed
- before entering `main'. */
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
- "%{!shared: \
- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
- %{!p:%{profile:gcrt1.o%s} \
- %{!profile:crt1.o%s}}}} \
- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-
-/* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
- the magical crtend.o file (see crtstuff.c) which provides part of
- the support for getting C++ file-scope static object constructed
- before entering `main', followed by a normal "finalizer" file,
- `crtn.o'. */
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
-
-/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate
- libc, depending on whether we're doing profiling or need threads support.
- (simular to the default, except no -lg, and no -p. */
-
-#undef LIB_SPEC
-#define LIB_SPEC "%{!shared: \
- %{!pg:%{!pthread:%{!kthread:-lc} \
- %{kthread:-lpthread -lc}} \
- %{pthread:-lc_r}} \
- %{pg:%{!pthread:%{!kthread:-lc_p} \
- %{kthread:-lpthread_p -lc_p}} \
- %{pthread:-lc_r_p}}}"
-
-/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
- for the special GCC options -static and -shared, which allow us to
- link things in one of these three modes by applying the appropriate
- combinations of options at link-time. We like to support here for
- as many of the other GNU linker options as possible. But I don't
- have the time to search for those flags. I am sure how to add
- support for -soname shared_object_name. H.J.
-
- I took out %{v:%{!V:-V}}. It is too much :-(. They can use
- -Wl,-V.
-
- When the -shared link option is used a final link is not being
- done. */
-
-#undef LINK_SPEC
-#define LINK_SPEC "-m elf_i386 \
- %{Wl,*:%*} \
- %{v:-V} \
- %{assert*} %{R*} %{rpath*} %{defsym*} \
- %{shared:-Bshareable %{h*} %{soname*}} \
- %{!shared: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}} \
- %{static:-Bstatic}} \
- %{symbolic:-Bsymbolic}"
-
-/* A C statement to output to the stdio stream FILE an assembler
- command to advance the location counter to a multiple of 1<<LOG
- bytes if it is within MAX_SKIP bytes.
-
- This is used to align code labels according to Intel recommendations. */
-
-#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
-#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
- if ((LOG) != 0) {\
- if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
- else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
- }
-#endif
+/* Now what stabs expects in the register. */
+#undef STABS_DBX_REGISTER_NUMBER
+#define STABS_DBX_REGISTER_NUMBER(n) \
+((n) == 0 ? 0 : \
+ (n) == 1 ? 2 : \
+ (n) == 2 ? 1 : \
+ (n) == 3 ? 3 : \
+ (n) == 4 ? 6 : \
+ (n) == 5 ? 7 : \
+ (n) == 6 ? 4 : \
+ (n) == 7 ? 5 : \
+ (n) + 4)
+
+#undef DBX_REGISTER_NUMBER
+#define DBX_REGISTER_NUMBER(n) ((write_symbols == DWARF_DEBUG) \
+ ? DWARF_DBX_REGISTER_NUMBER(n) \
+ : STABS_DBX_REGISTER_NUMBER(n))
+
+/* tag end of file in elf mode */
+#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
+#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
+ do { \
+ if (TARGET_ELF) { \
+ fprintf ((FILE), "\t.text\n\t.stabs \"\",%d,0,0,.Letext\n.Letext:\n", \
+ N_SO); \
+ } \
+ } while (0)
+
+/* stabs-in-elf has offsets relative to function beginning */
+#undef DBX_OUTPUT_LBRAC
+#define DBX_OUTPUT_LBRAC(FILE, NAME) \
+ do { \
+ fprintf (asmfile, "%s %d,0,0,", ASM_STABN_OP, N_LBRAC); \
+ assemble_name (asmfile, buf); \
+ if (TARGET_ELF) \
+ { \
+ fputc ('-', asmfile); \
+ assemble_name (asmfile, \
+ XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
+ } \
+ fprintf (asmfile, "\n"); \
+ } while (0)
+
+#undef DBX_OUTPUT_RBRAC
+#define DBX_OUTPUT_RBRAC(FILE, NAME) \
+ do { \
+ fprintf (asmfile, "%s %d,0,0,", ASM_STABN_OP, N_RBRAC); \
+ assemble_name (asmfile, buf); \
+ if (TARGET_ELF) \
+ { \
+ fputc ('-', asmfile); \
+ assemble_name (asmfile, \
+ XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
+ } \
+ fprintf (asmfile, "\n"); \
+ } while (0)
diff --git a/contrib/gcc/config/i386/freebsd.h.fixed b/contrib/gcc/config/i386/freebsd.h.fixed
index 8c907bf..d4a0358 100644
--- a/contrib/gcc/config/i386/freebsd.h.fixed
+++ b/contrib/gcc/config/i386/freebsd.h.fixed
@@ -1,8 +1,9 @@
-/* Definitions for Intel 386 running FreeBSD with ELF format
- Copyright (C) 1996 Free Software Foundation, Inc.
+/* Definitions for Intel 386 running FreeBSD with either a.out or ELF format
+ Copyright (C) 1996-2000 Free Software Foundation, Inc.
Contributed by Eric Youngdale.
Modified for stabs-in-ELF by H.J. Lu.
Adapted from GNU/Linux version by John Polstra.
+ Added support for generating "old a.out gas" on the fly by Peter Wemm.
Continued development by David O'Brien <obrien@freebsd.org>
This file is part of GNU CC.
@@ -22,50 +23,548 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#undef TARGET_VERSION
-#define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)");
+/* $FreeBSD$ */
-/* The svr4 ABI for the i386 says that records and unions are returned
- in memory. */
-/* On FreeBSD, we do not. */
-#undef DEFAULT_PCC_STRUCT_RETURN
-#define DEFAULT_PCC_STRUCT_RETURN 0
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES \
+ "-Di386 -Acpu(i386) -Amachine(i386)" \
+ FBSD_CPP_PREDEFINES
-/* This gets defined in tm.h->linux.h->svr4.h, and keeps us from using
- libraries compiled with the native cc, so undef it. */
-#undef NO_DOLLAR_IN_LABEL
+#undef CC1_SPEC
+#define CC1_SPEC "\
+ %{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} \
+ %{maout: %{!mno-underscores: %{!munderscores: -munderscores }}}"
-/* Use more efficient ``thunks'' to implement C++ vtables. */
-#undef DEFAULT_VTABLE_THUNKS
-#define DEFAULT_VTABLE_THUNKS 2
+#undef ASM_SPEC
+#define ASM_SPEC "%{v*: -v} %{maout: %{fpic:-k} %{fPIC:-k}}"
-/* Override the default comment-starter of "/". */
-#undef ASM_COMMENT_START
-#define ASM_COMMENT_START "#"
+#undef ASM_FINAL_SPEC
+#define ASM_FINAL_SPEC "%|"
-#undef ASM_APP_ON
-#define ASM_APP_ON "#APP\n"
+/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
+ for the special GCC options -static and -shared, which allow us to
+ link things in one of these three modes by applying the appropriate
+ combinations of options at link-time. We like to support here for
+ as many of the other GNU linker options as possible. But I don't
+ have the time to search for those flags. I am sure how to add
+ support for -soname shared_object_name. H.J.
+
+ I took out %{v:%{!V:-V}}. It is too much :-(. They can use
+ -Wl,-V.
-#undef ASM_APP_OFF
-#define ASM_APP_OFF "#NO_APP\n"
+ When the -shared link option is used a final link is not being
+ done. */
-#undef SET_ASM_OP
-#define SET_ASM_OP ".set"
+#undef LINK_SPEC
+#define LINK_SPEC "\
+ %{p:%e`-p' not supported; use `-pg' and gprof(1)} \
+ %{maout: %{shared:-Bshareable} \
+ %{!shared:%{!nostdlib:%{!r:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} \
+ %{pg:-Bstatic} %{Z}} \
+ %{assert*} %{R*}} \
+ %{!maout: \
+ -m elf_i386 \
+ %{Wl,*:%*} \
+ %{assert*} %{R*} %{rpath*} %{defsym*} \
+ %{shared:-Bshareable %{h*} %{soname*}} \
+ %{symbolic:-Bsymbolic} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic: -export-dynamic} \
+ %{!dynamic-linker: -dynamic-linker /usr/libexec/ld-elf.so.1}} \
+ %{static:-Bstatic}}}"
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC "\
+ %{maout: %{shared:c++rt0.o%s} \
+ %{!shared: \
+ %{pg:gcrt0.o%s}%{!pg: \
+ %{static:scrt0.o%s} \
+ %{!static:crt0.o%s}}}} \
+ %{!maout: \
+ %{!shared: \
+ %{pg:gcrt1.o%s} \
+ %{!pg: \
+ %{p:gcrt1.o%s} \
+ %{!p:crt1.o%s}}} \
+ crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
+
+/* Provide an ENDFILE_SPEC appropriate for FreeBSD/i386. Here we tack on our
+ own magical crtend.o file (compare w/crtstuff.c) which provides part of the
+ support for getting C++ file-scope static object constructed before
+ entering `main', followed by the normal "finalizer" file, `crtn.o'. */
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "\
+ %{!maout: \
+ %{!shared:crtend.o%s} \
+ %{shared:crtendS.o%s} crtn.o%s}"
+
+
+/************************[ Target stuff ]***********************************/
+
+/* Define the actual types of some ANSI-mandated types.
+ Needs to agree with <machine/ansi.h>. GCC defaults come from c-decl.c,
+ c-common.c, and config/<arch>/<arch>.h. */
+
+#undef SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
+
+/* This is the pseudo-op used to generate a 32-bit word of data with a
+ specific value in some section. */
+
+#undef INT_ASM_OP
+#define INT_ASM_OP ".long"
+
+/* Biggest alignment supported by the object file format of this
+ machine. Use this macro to limit the alignment which can be
+ specified using the `__attribute__ ((aligned (N)))' construct. If
+ not defined, the default value is `BIGGEST_ALIGNMENT'. */
+
+#define MAX_OFILE_ALIGNMENT (32768*8)
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)");
+
+#define MASK_PROFILER_EPILOGUE 010000000000
+#define MASK_AOUT 004000000000 /* a.out not elf */
+#define MASK_UNDERSCORES 002000000000 /* use leading _ */
+
+#define TARGET_PROFILER_EPILOGUE (target_flags & MASK_PROFILER_EPILOGUE)
+#define TARGET_AOUT (target_flags & MASK_AOUT)
+#define TARGET_ELF ((target_flags & MASK_AOUT) == 0)
+#define TARGET_UNDERSCORES ((target_flags & MASK_UNDERSCORES) != 0)
+
+#undef SUBTARGET_SWITCHES
+#define SUBTARGET_SWITCHES \
+ { "profiler-epilogue", MASK_PROFILER_EPILOGUE}, \
+ { "no-profiler-epilogue", -MASK_PROFILER_EPILOGUE}, \
+ { "aout", MASK_AOUT}, \
+ { "no-aout", -MASK_AOUT}, \
+ { "underscores", MASK_UNDERSCORES}, \
+ { "no-underscores", -MASK_UNDERSCORES},
+
+/* This goes away when the math emulator is fixed. */
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT \
+ (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
+
+/* Prefix for internally generated assembler labels. If we aren't using
+ underscores, we are using prefix `.'s to identify labels that should
+ be ignored, as in `i386/gas.h' --karl@cs.umb.edu */
+#undef LPREFIX
+#define LPREFIX ((TARGET_UNDERSCORES) ? "L" : ".L")
+
+/* The a.out tools do not support "linkonce" sections. */
+#undef SUPPORTS_ONE_ONLY
+#define SUPPORTS_ONE_ONLY TARGET_ELF
+
+/* Enable alias attribute support. */
+#undef SET_ASM_OP
+#define SET_ASM_OP ".set"
+
+/* The a.out tools do not support "Lscope" .stabs symbols. */
+#undef NO_DBX_FUNCTION_END
+#define NO_DBX_FUNCTION_END TARGET_AOUT
+
+/* In ELF, the function stabs come first, before the relative offsets. */
+#undef DBX_FUNCTION_FIRST
+#define DBX_CHECK_FUNCTION_FIRST TARGET_ELF
+
+/* supply our own hook for calling __main() from main() */
+#undef INVOKE__main
+#define INVOKE__main
+#undef GEN_CALL__MAIN
+#define GEN_CALL__MAIN \
+ do { \
+ if (!(TARGET_ELF)) \
+ emit_library_call (gen_rtx (SYMBOL_REF, Pmode, NAME__MAIN), 0, \
+ VOIDmode, 0); \
+ } while (0)
+
+/* Indicate that jump tables go in the text section. This is
+ necessary when compiling PIC code. */
+#undef JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
+
+/* override the exception table positioning */
+#undef EXCEPTION_SECTION
+#define EXCEPTION_SECTION() \
+ do { \
+ if (TARGET_ELF) \
+ { \
+ named_section (NULL_TREE, ".gcc_except_table", 0); \
+ } \
+ else \
+ { \
+ if (flag_pic) \
+ data_section (); \
+ else \
+ readonly_data_section (); \
+ } \
+ } while (0);
+
+/* Tell final.c that we don't need a label passed to mcount. */
+#undef NO_PROFILE_DATA
+#define NO_PROFILE_DATA
+
+/* Output assembler code to FILE to begin profiling of the current function.
+ LABELNO is an optional label. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ do { \
+ char *_name = TARGET_AOUT ? "mcount" : ".mcount"; \
+ if (flag_pic) \
+ fprintf ((FILE), "\tcall *%s@GOT(%%ebx)\n", _name); \
+ else \
+ fprintf ((FILE), "\tcall %s\n", _name); \
+ } while (0)
+
+/* Output assembler code to FILE to end profiling of the current function. */
+
+#undef FUNCTION_PROFILER_EPILOGUE
+#define FUNCTION_PROFILER_EPILOGUE(FILE, DO_RTL) \
+ do { \
+ if (TARGET_PROFILER_EPILOGUE) \
+ { \
+ if (DO_RTL) \
+ { \
+ /* ".mexitcount" is specially handled in \
+ ASM_HACK_SYMBOLREF () so that we don't need to handle \
+ flag_pic or TARGET_AOUT here. */ \
+ rtx xop; \
+ xop = gen_rtx_MEM (FUNCTION_MODE, \
+ gen_rtx_SYMBOL_REF (Pmode, ".mexitcount")); \
+ emit_call_insn (gen_rtx (CALL, VOIDmode, xop, const0_rtx)); \
+ } \
+ else \
+ { \
+ /* XXX this !DO_RTL case is broken but not actually used. */ \
+ char *_name = TARGET_AOUT ? "mcount" : ".mcount"; \
+ if (flag_pic) \
+ fprintf (FILE, "\tcall *%s@GOT(%%ebx)\n", _name); \
+ else \
+ fprintf (FILE, "\tcall %s\n", _name); \
+ } \
+ } \
+ } while (0)
+
+
+/************************[ Assembler stuff ]********************************/
+
+#undef ASM_APP_ON
+#define ASM_APP_ON "#APP\n"
+
+#undef ASM_APP_OFF
+#define ASM_APP_OFF "#NO_APP\n"
+
+/* This is how to begin an assembly language file.
+ The .file command should always begin the output.
+ ELF also needs a .version. */
+
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+ do { \
+ output_file_directive ((FILE), main_input_filename); \
+ if (TARGET_ELF) \
+ fprintf ((FILE), "\t.version\t\"01.01\"\n"); \
+ } while (0)
+
+/* This is how to store into the string BUF
+ the symbol_ref name of an internal numbered label where
+ PREFIX is the class of label and NUM is the number within the class.
+ This is suitable for output with `assemble_name'. */
+#undef ASM_GENERATE_INTERNAL_LABEL
+#define ASM_GENERATE_INTERNAL_LABEL(BUF, PREFIX, NUMBER) \
+ sprintf ((BUF), "*%s%s%d", (TARGET_UNDERSCORES) ? "" : ".", \
+ (PREFIX), (NUMBER))
+
+/* This is how to output an internal numbered label where
+ PREFIX is the class of label and NUM is the number within the class.
+ For most svr4/ELF systems, the convention is that any symbol which begins
+ with a period is not put into the linker symbol table by the assembler. */
+#undef ASM_OUTPUT_INTERNAL_LABEL
+#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
+ fprintf ((FILE), "%s%s%d:\n", (TARGET_UNDERSCORES) ? "" : ".", \
+ (PREFIX), (NUM))
+
+/* This is how to output a reference to a user-level label named NAME. */
+#undef ASM_OUTPUT_LABELREF
+#define ASM_OUTPUT_LABELREF(FILE, NAME) \
+ do { \
+ char *_name = (NAME); \
+ /* Hack to avoid writing lots of rtl in \
+ FUNCTION_PROFILER_EPILOGUE (). */ \
+ if (*_name == '.' && strcmp(_name + 1, "mexitcount") == 0) \
+ { \
+ if (TARGET_AOUT) \
+ _name++; \
+ if (flag_pic) \
+ fprintf ((FILE), "*%s@GOT(%%ebx)", _name); \
+ else \
+ fprintf ((FILE), "%s", _name); \
+ } \
+ else \
+ fprintf (FILE, "%s%s", TARGET_UNDERSCORES ? "_" : "", _name); \
+} while (0)
+
+/* This is how to hack on the symbol code of certain relcalcitrant
+ symbols to modify their output in output_pic_addr_const (). */
+
+#undef ASM_HACK_SYMBOLREF_CODE
+#define ASM_HACK_SYMBOLREF_CODE(NAME, CODE) \
+ do { \
+ /* Part of hack to avoid writing lots of rtl in \
+ FUNCTION_PROFILER_EPILOGUE (). */ \
+ char *_name = (NAME); \
+ if (*_name == '.' && strcmp(_name + 1, "mexitcount") == 0) \
+ (CODE) = 'X'; \
+ } while (0)
/* This is how to output an element of a case-vector that is relative.
This is only used for PIC code. See comments by the `casesi' insn in
i386.md for an explanation of the expression this outputs. */
-#undef ASM_OUTPUT_ADDR_DIFF_ELT
-#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
- fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
+#undef ASM_OUTPUT_ADDR_DIFF_ELT
+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
+ fprintf ((FILE), "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, (VALUE))
+
+#undef ASM_OUTPUT_ALIGN
+#define ASM_OUTPUT_ALIGN(FILE, LOG) \
+ if ((LOG)!=0) { \
+ if (in_text_section()) \
+ fprintf ((FILE), "\t.p2align %d,0x90\n", (LOG)); \
+ else \
+ fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
+ }
+
+#undef ASM_OUTPUT_SOURCE_LINE
+#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
+ do { \
+ static int sym_lineno = 1; \
+ if (TARGET_ELF) \
+ { \
+ fprintf ((FILE), ".stabn 68,0,%d,.LM%d-", (LINE), sym_lineno); \
+ assemble_name ((FILE), \
+ XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
+ fprintf ((FILE), "\n.LM%d:\n", sym_lineno); \
+ sym_lineno += 1; \
+ } \
+ else \
+ { \
+ fprintf ((FILE), "\t%s %d,0,%d\n", ASM_STABD_OP, N_SLINE, \
+ lineno); \
+ } \
+ } while (0)
+
+/* These macros generate the special .type and .size directives which
+ are used to set the corresponding fields of the linker symbol table
+ entries in an ELF object file under SVR4. These macros also output
+ the starting labels for the relevant functions/objects. */
+
+/* Write the extra assembler code needed to declare a function properly.
+ Some svr4 assemblers need to also have something extra said about the
+ function's return value. We allow for that here. */
+
+#undef ASM_DECLARE_FUNCTION_NAME
+#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
+ do { \
+ fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
+ assemble_name (FILE, NAME); \
+ putc (',', FILE); \
+ fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
+ putc ('\n', FILE); \
+ ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
+ ASM_OUTPUT_LABEL(FILE, NAME); \
+ } while (0)
+
+/* This is how to declare the size of a function. */
+
+#undef ASM_DECLARE_FUNCTION_SIZE
+#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
+ do { \
+ if (!flag_inhibit_size_directive) \
+ { \
+ char label[256]; \
+ static int labelno; \
+ labelno++; \
+ ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
+ fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
+ assemble_name (FILE, (FNAME)); \
+ fprintf (FILE, ","); \
+ assemble_name (FILE, label); \
+ fprintf (FILE, "-"); \
+ assemble_name (FILE, (FNAME)); \
+ putc ('\n', FILE); \
+ } \
+ } while (0)
+
+
+/* The routine used to output NUL terminated strings. We use a special
+ version of this for most svr4 targets because doing so makes the
+ generated assembly code more compact (and thus faster to assemble)
+ as well as more readable, especially for targets like the i386
+ (where the only alternative is to output character sequences as
+ comma separated lists of numbers). */
+
+#undef ASM_OUTPUT_LIMITED_STRING
+#define ASM_OUTPUT_LIMITED_STRING(FILE, STR) \
+ do { \
+ register unsigned char *_limited_str = (unsigned char *) (STR); \
+ register unsigned ch; \
+ fprintf ((FILE), "\t%s\t\"", STRING_ASM_OP); \
+ for (; (ch = *_limited_str); _limited_str++) \
+ { \
+ register int escape; \
+ switch (escape = ESCAPES[ch]) \
+ { \
+ case 0: \
+ putc (ch, (FILE)); \
+ break; \
+ case 1: \
+ fprintf ((FILE), "\\%03o", ch); \
+ break; \
+ default: \
+ putc ('\\', (FILE)); \
+ putc (escape, (FILE)); \
+ break; \
+ } \
+ } \
+ fprintf ((FILE), "\"\n"); \
+ } while (0)
+
+/* Switch into a generic section.
+
+ We make the section read-only and executable for a function decl,
+ read-only for a const data decl, and writable for a non-const data decl.
+
+ If the section has already been defined, we must not
+ emit the attributes here. The SVR4 assembler does not
+ recognize section redefinitions.
+ If DECL is NULL, no attributes are emitted. */
+
+#undef ASM_OUTPUT_SECTION_NAME
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ do { \
+ static struct section_info \
+ { \
+ struct section_info *next; \
+ char *name; \
+ enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \
+ } *sections; \
+ struct section_info *s; \
+ char *mode; \
+ enum sect_enum type; \
+ \
+ for (s = sections; s; s = s->next) \
+ if (!strcmp (NAME, s->name)) \
+ break; \
+ \
+ if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
+ type = SECT_EXEC, mode = "ax"; \
+ else if (DECL && DECL_READONLY_SECTION (DECL, RELOC)) \
+ type = SECT_RO, mode = "a"; \
+ else \
+ type = SECT_RW, mode = "aw"; \
+ \
+ if (s == 0) \
+ { \
+ s = (struct section_info *) xmalloc (sizeof (struct section_info)); \
+ s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME)); \
+ strcpy (s->name, NAME); \
+ s->type = type; \
+ s->next = sections; \
+ sections = s; \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, mode); \
+ } \
+ else \
+ { \
+ if (DECL && s->type != type) \
+ error_with_decl (DECL, "%s causes a section type conflict"); \
+ \
+ fprintf (FILE, ".section\t%s\n", NAME); \
+ } \
+ } while (0)
+
+#undef MAKE_DECL_ONE_ONLY
+#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+#undef UNIQUE_SECTION_P
+#define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
+#undef UNIQUE_SECTION
+#define UNIQUE_SECTION(DECL,RELOC) \
+ do { \
+ int len; \
+ char *name, *string, *prefix; \
+ \
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
+ \
+ if (! DECL_ONE_ONLY (DECL)) \
+ { \
+ prefix = "."; \
+ if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ prefix = ".text."; \
+ else if (DECL_READONLY_SECTION (DECL, RELOC)) \
+ prefix = ".rodata."; \
+ else \
+ prefix = ".data."; \
+ } \
+ else if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ prefix = ".gnu.linkonce.t."; \
+ else if (DECL_READONLY_SECTION (DECL, RELOC)) \
+ prefix = ".gnu.linkonce.r."; \
+ else \
+ prefix = ".gnu.linkonce.d."; \
+ \
+ len = strlen (name) + strlen (prefix); \
+ string = alloca (len + 1); \
+ sprintf (string, "%s%s", prefix, name); \
+ \
+ DECL_SECTION_NAME (DECL) = build_string (len, string); \
+ } while (0)
+
+/* A C statement or statements to switch to the appropriate
+ section for output of DECL. DECL is either a `VAR_DECL' node
+ or a constant of some sort. RELOC indicates whether forming
+ the initial value of DECL requires link-time relocations. */
+
+#undef SELECT_SECTION
+#define SELECT_SECTION(DECL,RELOC) \
+ { \
+ if (flag_pic && RELOC) \
+ data_section (); \
+ else if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ const_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if (! DECL_READONLY_SECTION (DECL, RELOC)) \
+ data_section (); \
+ else \
+ const_section (); \
+ } \
+ else \
+ const_section (); \
+ }
+
+/* Define macro used to output shift-double opcodes when the shift
+ count is in %cl. Some assemblers require %cl as an argument;
+ some don't.
+
+ *OLD* GAS requires the %cl argument, so override i386/unix.h. */
+
+#undef AS3_SHIFT_DOUBLE
+#define AS3_SHIFT_DOUBLE(a,b,c,d) AS3 (a,b,c,d)
-/* Indicate that jump tables go in the text section. This is
- necessary when compiling PIC code. */
-#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
-/* Use stabs instead of DWARF debug format. */
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+/************************[ Debugger stuff ]*********************************/
/* Copy this from the svr4 specifications... */
/* Define the register numbers to be used in Dwarf debugging information.
@@ -122,8 +621,8 @@ Boston, MA 02111-1307, USA. */
17 for %st(6) (gnu regno = 14)
18 for %st(7) (gnu regno = 15)
*/
-#undef DBX_REGISTER_NUMBER
-#define DBX_REGISTER_NUMBER(n) \
+#undef DWARF_DBX_REGISTER_NUMBER
+#define DWARF_DBX_REGISTER_NUMBER(n) \
((n) == 0 ? 0 \
: (n) == 1 ? 2 \
: (n) == 2 ? 1 \
@@ -135,123 +634,59 @@ Boston, MA 02111-1307, USA. */
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Tell final.c that we don't need a label passed to mcount. */
-
-#undef FUNCTION_PROFILER
-#define FUNCTION_PROFILER(FILE, LABELNO) \
-{ \
- if (flag_pic) \
- fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
- else \
- fprintf (FILE, "\tcall .mcount\n"); \
-}
-
-#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
-
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "int"
-
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "int"
-
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
-
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE BITS_PER_WORD
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Di386 -Dunix -D__ELF__ -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
-
-#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
-
-/* This defines which switch letters take arguments. On FreeBSD, most of
- the normal cases (defined in gcc.c) apply, and we also have -h* and
- -z* options (for the linker) (comming from svr4).
- We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
-
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR) \
- (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
- || (CHAR) == 'h' \
- || (CHAR) == 'z' \
- || (CHAR) == 'R')
-
-/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add
- the magical crtbegin.o file (see crtstuff.c) which provides part
- of the support for getting C++ file-scope static object constructed
- before entering `main'. */
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
- "%{!shared: \
- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
- %{!p:%{profile:gcrt1.o%s} \
- %{!profile:crt1.o%s}}}} \
- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-
-/* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
- the magical crtend.o file (see crtstuff.c) which provides part of
- the support for getting C++ file-scope static object constructed
- before entering `main', followed by a normal "finalizer" file,
- `crtn.o'. */
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
-
-/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate
- libc, depending on whether we're doing profiling or need threads support.
- (simular to the default, except no -lg, and no -p. */
-
-#undef LIB_SPEC
-#define LIB_SPEC "%{!shared: \
- %{!pg:%{!pthread:%{!kthread:-lc} \
- %{kthread:-lpthread -lc}} \
- %{pthread:-lc_r}} \
- %{pg:%{!pthread:%{!kthread:-lc_p} \
- %{kthread:-lpthread_p -lc_p}} \
- %{pthread:-lc_r_p}}}"
-
-/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
- for the special GCC options -static and -shared, which allow us to
- link things in one of these three modes by applying the appropriate
- combinations of options at link-time. We like to support here for
- as many of the other GNU linker options as possible. But I don't
- have the time to search for those flags. I am sure how to add
- support for -soname shared_object_name. H.J.
-
- I took out %{v:%{!V:-V}}. It is too much :-(. They can use
- -Wl,-V.
-
- When the -shared link option is used a final link is not being
- done. */
-
-#undef LINK_SPEC
-#define LINK_SPEC "-m elf_i386 \
- %{Wl,*:%*} \
- %{v:-V} \
- %{assert*} %{R*} %{rpath*} %{defsym*} \
- %{shared:-Bshareable %{h*} %{soname*}} \
- %{!shared: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}} \
- %{static:-Bstatic}} \
- %{symbolic:-Bsymbolic}"
-
-/* A C statement to output to the stdio stream FILE an assembler
- command to advance the location counter to a multiple of 1<<LOG
- bytes if it is within MAX_SKIP bytes.
-
- This is used to align code labels according to Intel recommendations. */
-
-#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
-#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
- if ((LOG) != 0) {\
- if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
- else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
- }
-#endif
+/* Now what stabs expects in the register. */
+#undef STABS_DBX_REGISTER_NUMBER
+#define STABS_DBX_REGISTER_NUMBER(n) \
+((n) == 0 ? 0 : \
+ (n) == 1 ? 2 : \
+ (n) == 2 ? 1 : \
+ (n) == 3 ? 3 : \
+ (n) == 4 ? 6 : \
+ (n) == 5 ? 7 : \
+ (n) == 6 ? 4 : \
+ (n) == 7 ? 5 : \
+ (n) + 4)
+
+#undef DBX_REGISTER_NUMBER
+#define DBX_REGISTER_NUMBER(n) ((write_symbols == DWARF_DEBUG) \
+ ? DWARF_DBX_REGISTER_NUMBER(n) \
+ : STABS_DBX_REGISTER_NUMBER(n))
+
+/* tag end of file in elf mode */
+#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
+#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
+ do { \
+ if (TARGET_ELF) { \
+ fprintf ((FILE), "\t.text\n\t.stabs \"\",%d,0,0,.Letext\n.Letext:\n", \
+ N_SO); \
+ } \
+ } while (0)
+
+/* stabs-in-elf has offsets relative to function beginning */
+#undef DBX_OUTPUT_LBRAC
+#define DBX_OUTPUT_LBRAC(FILE, NAME) \
+ do { \
+ fprintf (asmfile, "%s %d,0,0,", ASM_STABN_OP, N_LBRAC); \
+ assemble_name (asmfile, buf); \
+ if (TARGET_ELF) \
+ { \
+ fputc ('-', asmfile); \
+ assemble_name (asmfile, \
+ XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
+ } \
+ fprintf (asmfile, "\n"); \
+ } while (0)
+
+#undef DBX_OUTPUT_RBRAC
+#define DBX_OUTPUT_RBRAC(FILE, NAME) \
+ do { \
+ fprintf (asmfile, "%s %d,0,0,", ASM_STABN_OP, N_RBRAC); \
+ assemble_name (asmfile, buf); \
+ if (TARGET_ELF) \
+ { \
+ fputc ('-', asmfile); \
+ assemble_name (asmfile, \
+ XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
+ } \
+ fprintf (asmfile, "\n"); \
+ } while (0)
diff --git a/contrib/gcc/config/i386/i386.c b/contrib/gcc/config/i386/i386.c
index 0333b19..9eb9582 100644
--- a/contrib/gcc/config/i386/i386.c
+++ b/contrib/gcc/config/i386/i386.c
@@ -18,6 +18,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
#include <setjmp.h>
#include "config.h"
#include "system.h"
@@ -51,6 +53,11 @@ Boston, MA 02111-1307, USA. */
#define CHECK_STACK_LIMIT -1
#endif
+#define PIC_REG_USED \
+ (flag_pic && (current_function_uses_pic_offset_table \
+ || current_function_uses_const_pool \
+ || profile_flag || profile_block_flag))
+
/* Type of an operand for ix86_{binary,unary}_operator_ok */
enum reg_mem
{
@@ -1638,13 +1645,11 @@ asm_output_function_prefix (file, name)
char *name ATTRIBUTE_UNUSED;
{
rtx xops[2];
- int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
- || current_function_uses_const_pool);
xops[0] = pic_offset_table_rtx;
xops[1] = stack_pointer_rtx;
/* Deep branch prediction favors having a return for every call. */
- if (pic_reg_used && TARGET_DEEP_BRANCH_PREDICTION)
+ if (PIC_REG_USED && TARGET_DEEP_BRANCH_PREDICTION)
{
tree prologue_node;
@@ -1785,8 +1790,7 @@ ix86_compute_frame_size (size, nregs_on_stack)
int nregs;
int regno;
int padding;
- int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
- || current_function_uses_const_pool);
+ int pic_reg_used = PIC_REG_USED;
HOST_WIDE_INT total_size;
limit = frame_pointer_needed
@@ -1840,8 +1844,7 @@ ix86_prologue (do_rtl)
register int regno;
int limit;
rtx xops[4];
- int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
- || current_function_uses_const_pool);
+ int pic_reg_used = PIC_REG_USED;
HOST_WIDE_INT tsize = ix86_compute_frame_size (get_frame_size (), (int *)0);
rtx insn;
int cfa_offset = INCOMING_FRAME_SP_OFFSET, cfa_store_offset = cfa_offset;
@@ -2011,8 +2014,11 @@ ix86_can_use_return_insn_p ()
int nregs = 0;
int reglimit = (frame_pointer_needed
? FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM);
- int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
- || current_function_uses_const_pool);
+
+#ifdef TARGET_PROFILER_EPILOGUE
+ if (TARGET_PROFILER_EPILOGUE)
+ return 0;
+#endif
#ifdef NON_SAVING_SETJMP
if (NON_SAVING_SETJMP && current_function_calls_setjmp)
@@ -2024,7 +2030,7 @@ ix86_can_use_return_insn_p ()
for (regno = reglimit - 1; regno >= 0; regno--)
if ((regs_ever_live[regno] && ! call_used_regs[regno])
- || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used))
+ || (regno == PIC_OFFSET_TABLE_REGNUM && PIC_REG_USED))
nregs++;
return nregs == 0 || ! frame_pointer_needed;
@@ -2058,8 +2064,7 @@ ix86_epilogue (do_rtl)
register int limit;
int nregs;
rtx xops[3];
- int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
- || current_function_uses_const_pool);
+ int pic_reg_used = PIC_REG_USED;
int sp_valid = !frame_pointer_needed || current_function_sp_is_unchanging;
HOST_WIDE_INT offset;
HOST_WIDE_INT tsize = ix86_compute_frame_size (get_frame_size (), &nregs);
@@ -2081,6 +2086,10 @@ ix86_epilogue (do_rtl)
if (flag_pic || profile_flag || profile_block_flag)
emit_insn (gen_blockage ());
+#ifdef FUNCTION_PROFILER_EPILOGUE
+ FUNCTION_PROFILER_EPILOGUE (asm_out_file, do_rtl);
+#endif
+
/* If we're only restoring one register and sp is not valid then
using a move instruction to restore the register since it's
less work than reloading sp and popping the register. Otherwise,
@@ -2216,6 +2225,7 @@ ix86_epilogue (do_rtl)
#ifdef FUNCTION_BLOCK_PROFILER_EXIT
if (profile_block_flag == 2)
{
+ /* XXX this is hosed like FUNCTION_PROFILER_EPILOGUE () was. */
FUNCTION_BLOCK_PROFILER_EXIT(file);
}
#endif
@@ -2899,6 +2909,9 @@ output_pic_addr_const (file, x, code)
case SYMBOL_REF:
assemble_name (file, XSTR (x, 0));
+#ifdef ASM_HACK_SYMBOLREF_CODE
+ ASM_HACK_SYMBOLREF_CODE (XSTR (x, 0), code);
+#endif
if (code == 'P' && ! SYMBOL_REF_FLAG (x))
fputs ("@PLT", file);
break;
diff --git a/contrib/gcc/config/i386/i386.h b/contrib/gcc/config/i386/i386.h
index 5e27fd8..e492e04 100644
--- a/contrib/gcc/config/i386/i386.h
+++ b/contrib/gcc/config/i386/i386.h
@@ -34,6 +34,8 @@ Boston, MA 02111-1307, USA. */
PUT_OP_SIZE, USE_STAR, ADDR_BEG, ADDR_END, PRINT_IREG, PRINT_SCALE,
PRINT_B_I_S, and many that start with ASM_ or end in ASM_OP. */
+/* $FreeBSD$ */
+
/* Names to predefine in the preprocessor for this target machine. */
#define I386 1
diff --git a/contrib/gcc/config/i386/i386.md b/contrib/gcc/config/i386/i386.md
index b52e255..b18c700 100644
--- a/contrib/gcc/config/i386/i386.md
+++ b/contrib/gcc/config/i386/i386.md
@@ -1,5 +1,5 @@
; GCC machine description for Intel X86.
-;; Copyright (C) 1988, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 94-99, 2000 Free Software Foundation, Inc.
;; Mostly by William Schelter.
;; This file is part of GNU CC.
@@ -71,6 +71,8 @@
;; This shadows the processor_type enumeration, so changes must be made
;; to i386.h at the same time.
+;; $FreeBSD$
+
(define_attr "type"
"integer,binary,memory,test,compare,fcompare,idiv,imul,lea,fld,fpop,fpdiv,fpmul"
(const_string "integer"))
@@ -8190,6 +8192,15 @@ byte_xor_operation:
"flag_pic"
"
{
+ load_pic_register ();
+ DONE;
+}")
+
+(define_expand "builtin_setjmp_receiver"
+ [(label_ref (match_operand 0 "" ""))]
+ "flag_pic"
+ "
+{
load_pic_register (1);
DONE;
}")
diff --git a/contrib/gcc/config/i386/x-freebsd b/contrib/gcc/config/i386/x-freebsd
index a9b13ba..47640c0 100644
--- a/contrib/gcc/config/i386/x-freebsd
+++ b/contrib/gcc/config/i386/x-freebsd
@@ -1,3 +1,4 @@
# Don't run fixproto
STMP_FIXPROTO =
-CLIB=-lgnumalloc
+# Use only native include files
+USER_H =
diff --git a/contrib/gcc/config/xm-freebsd.h b/contrib/gcc/config/xm-freebsd.h
index b71ff56..41b08a4 100644
--- a/contrib/gcc/config/xm-freebsd.h
+++ b/contrib/gcc/config/xm-freebsd.h
@@ -22,3 +22,16 @@ Boston, MA 02111-1307, USA. */
running FreeBSD. This file should not be specified as $xm_file itself;
instead $xm_file should be CPU/xm-freebsd.h, which should include both
CPU/xm-CPU.h and this file xm-freebsd.h. */
+
+#ifndef HAVE_ATEXIT
+#define HAVE_ATEXIT
+#endif
+
+/* Tell gcc and collect2 that FreeBSD targets support putenv(3). */
+#define HAVE_PUTENV
+
+/* We have _sys_siglist, but the declaration in <signal.h> conflicts with
+ the declarations in collect2.c and mips-tfile.c, so disable the declarations
+ in those files. */
+
+#define SYS_SIGLIST_DECLARED
diff --git a/contrib/gcc/configure b/contrib/gcc/configure
index cc73760..c1d12f1 100755
--- a/contrib/gcc/configure
+++ b/contrib/gcc/configure
@@ -1,5 +1,7 @@
#! /bin/sh
+# $FreeBSD$
+
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
@@ -86,6 +88,7 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
+sitefile=
srcdir=
target=NONE
verbose=
@@ -200,6 +203,7 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -370,6 +374,11 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -535,12 +544,16 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
fi
+else
+ CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -595,7 +608,7 @@ copy=cp
# - two terminals occur directly after each other
# - the path contains an element with a dot in it
echo $ac_n "checking LIBRARY_PATH variable""... $ac_c" 1>&6
-echo "configure:599: checking LIBRARY_PATH variable" >&5
+echo "configure:610: checking LIBRARY_PATH variable" >&5
case ${LIBRARY_PATH} in
[:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
library_path_setting="contains current directory"
@@ -620,7 +633,7 @@ fi
# - two terminals occur directly after each other
# - the path contains an element with a dot in it
echo $ac_n "checking GCC_EXEC_PREFIX variable""... $ac_c" 1>&6
-echo "configure:624: checking GCC_EXEC_PREFIX variable" >&5
+echo "configure:635: checking GCC_EXEC_PREFIX variable" >&5
case ${GCC_EXEC_PREFIX} in
[:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
gcc_exec_prefix_setting="contains current directory"
@@ -961,7 +974,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:965: checking host system type" >&5
+echo "configure:976: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -982,7 +995,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:986: checking target system type" >&5
+echo "configure:997: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -1000,7 +1013,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1004: checking build system type" >&5
+echo "configure:1015: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1027,7 +1040,7 @@ test "$host_alias" != "$target_alias" &&
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1031: checking for $ac_word" >&5
+echo "configure:1042: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1057,7 +1070,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1061: checking for $ac_word" >&5
+echo "configure:1072: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1108,7 +1121,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1112: checking for $ac_word" >&5
+echo "configure:1123: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1140,7 +1153,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1144: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1155: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1151,12 +1164,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 1155 "configure"
+#line 1166 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -1182,12 +1195,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1186: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1197: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1191: checking whether we are using GNU C" >&5
+echo "configure:1202: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1196,7 +1209,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1215,7 +1228,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1219: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1230: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1258,7 +1271,7 @@ fi
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1262: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1273: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1286,7 +1299,7 @@ fi
echo $ac_n "checking whether a default assembler was specified""... $ac_c" 1>&6
-echo "configure:1290: checking whether a default assembler was specified" >&5
+echo "configure:1301: checking whether a default assembler was specified" >&5
if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
if test x"$gas_flag" = x"no"; then
echo "$ac_t""yes ($DEFAULT_ASSEMBLER)" 1>&6
@@ -1298,7 +1311,7 @@ else
fi
echo $ac_n "checking whether a default linker was specified""... $ac_c" 1>&6
-echo "configure:1302: checking whether a default linker was specified" >&5
+echo "configure:1313: checking whether a default linker was specified" >&5
if test x"${DEFAULT_LINKER+set}" = x"set"; then
if test x"$gnu_ld_flag" = x"no"; then
echo "$ac_t""yes ($DEFAULT_LINKER)" 1>&6
@@ -1310,12 +1323,12 @@ else
fi
# Find some useful tools
-for ac_prog in gawk mawk nawk awk
+for ac_prog in mawk gawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1319: checking for $ac_word" >&5
+echo "configure:1330: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1347,7 +1360,7 @@ done
# Extract the first word of "flex", so it can be a program name with args.
set dummy flex; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1351: checking for $ac_word" >&5
+echo "configure:1362: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1381,7 +1394,7 @@ then
*) ac_lib=l ;;
esac
echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:1385: checking for yywrap in -l$ac_lib" >&5
+echo "configure:1396: checking for yywrap in -l$ac_lib" >&5
ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1389,7 +1402,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$ac_lib $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1393 "configure"
+#line 1404 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1400,7 +1413,7 @@ int main() {
yywrap()
; return 0; }
EOF
-if { (eval echo configure:1404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1423,7 +1436,7 @@ fi
fi
echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:1427: checking whether ln works" >&5
+echo "configure:1438: checking whether ln works" >&5
if eval "test \"`echo '$''{'gcc_cv_prog_LN'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1455,7 +1468,7 @@ else
fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1459: checking whether ln -s works" >&5
+echo "configure:1470: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'gcc_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1487,19 +1500,19 @@ else
fi
echo $ac_n "checking for volatile""... $ac_c" 1>&6
-echo "configure:1491: checking for volatile" >&5
+echo "configure:1502: checking for volatile" >&5
if eval "test \"`echo '$''{'gcc_cv_c_volatile'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1496 "configure"
+#line 1507 "configure"
#include "confdefs.h"
int main() {
volatile int foo;
; return 0; }
EOF
-if { (eval echo configure:1503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_c_volatile=yes
else
@@ -1522,7 +1535,7 @@ fi
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1526: checking for $ac_word" >&5
+echo "configure:1537: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1554,7 +1567,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1558: checking for $ac_word" >&5
+echo "configure:1569: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1595,7 +1608,7 @@ test -n "$YACC" || YACC="yacc"
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1599: checking for a BSD compatible install" >&5
+echo "configure:1610: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1646,7 +1659,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1650: checking how to run the C preprocessor" >&5
+echo "configure:1661: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1661,13 +1674,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1665 "configure"
+#line 1676 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1671: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1682: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1678,13 +1691,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1682 "configure"
+#line 1693 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1699: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1695,13 +1708,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1699 "configure"
+#line 1710 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1726,12 +1739,12 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1730: checking for ANSI C header files" >&5
+echo "configure:1741: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1735 "configure"
+#line 1746 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1739,7 +1752,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1756,7 +1769,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1760 "configure"
+#line 1771 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1774,7 +1787,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1778 "configure"
+#line 1789 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1795,7 +1808,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1799 "configure"
+#line 1810 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1806,7 +1819,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1830,12 +1843,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1834: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1845: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1839 "configure"
+#line 1850 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -1844,7 +1857,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:1848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -1865,12 +1878,12 @@ EOF
fi
echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6
-echo "configure:1869: checking whether string.h and strings.h may both be included" >&5
+echo "configure:1880: checking whether string.h and strings.h may both be included" >&5
if eval "test \"`echo '$''{'gcc_cv_header_string'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1874 "configure"
+#line 1885 "configure"
#include "confdefs.h"
#include <string.h>
#include <strings.h>
@@ -1878,7 +1891,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1882: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1893: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_header_string=yes
else
@@ -1899,12 +1912,12 @@ EOF
fi
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1903: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:1914: checking for sys/wait.h that is POSIX.1 compatible" >&5
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1908 "configure"
+#line 1919 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -1920,7 +1933,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:1924: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -1944,17 +1957,17 @@ for ac_hdr in limits.h stddef.h string.h strings.h stdlib.h time.h fcntl.h unist
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1948: checking for $ac_hdr" >&5
+echo "configure:1959: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1953 "configure"
+#line 1964 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1984,17 +1997,17 @@ done
# Check for thread headers.
ac_safe=`echo "thread.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for thread.h""... $ac_c" 1>&6
-echo "configure:1988: checking for thread.h" >&5
+echo "configure:1999: checking for thread.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1993 "configure"
+#line 2004 "configure"
#include "confdefs.h"
#include <thread.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1998: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2018,17 +2031,17 @@ fi
ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for pthread.h""... $ac_c" 1>&6
-echo "configure:2022: checking for pthread.h" >&5
+echo "configure:2033: checking for pthread.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2027 "configure"
+#line 2038 "configure"
#include "confdefs.h"
#include <pthread.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2032: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2055,7 +2068,7 @@ fi
# Extract the first word of "gnatbind", so it can be a program name with args.
set dummy gnatbind; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2059: checking for $ac_word" >&5
+echo "configure:2070: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gnat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2086,12 +2099,12 @@ fi
# See if the system preprocessor understands the ANSI C preprocessor
# stringification operator.
echo $ac_n "checking whether cpp understands the stringify operator""... $ac_c" 1>&6
-echo "configure:2090: checking whether cpp understands the stringify operator" >&5
+echo "configure:2101: checking whether cpp understands the stringify operator" >&5
if eval "test \"`echo '$''{'gcc_cv_c_have_stringify'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2095 "configure"
+#line 2106 "configure"
#include "confdefs.h"
int main() {
@@ -2099,7 +2112,7 @@ int main() {
char *test = S(foo);
; return 0; }
EOF
-if { (eval echo configure:2103: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_c_have_stringify=yes
else
@@ -2122,12 +2135,12 @@ fi
# Use <inttypes.h> only if it exists,
# doesn't clash with <sys/types.h>, and declares intmax_t.
echo $ac_n "checking for inttypes.h""... $ac_c" 1>&6
-echo "configure:2126: checking for inttypes.h" >&5
+echo "configure:2137: checking for inttypes.h" >&5
if eval "test \"`echo '$''{'gcc_cv_header_inttypes_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2131 "configure"
+#line 2142 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <inttypes.h>
@@ -2135,7 +2148,7 @@ int main() {
intmax_t i = -1;
; return 0; }
EOF
-if { (eval echo configure:2139: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_header_inttypes_h=yes
else
@@ -2161,12 +2174,12 @@ for ac_func in strtoul bsearch strerror putenv popen bcopy bzero bcmp \
fputs_unlocked
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2165: checking for $ac_func" >&5
+echo "configure:2176: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2170 "configure"
+#line 2181 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2189,7 +2202,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2218,12 +2231,12 @@ done
#AC_CHECK_TYPE(wchar_t, unsigned int)
echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:2222: checking for vprintf" >&5
+echo "configure:2233: checking for vprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2227 "configure"
+#line 2238 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */
@@ -2246,7 +2259,7 @@ vprintf();
; return 0; }
EOF
-if { (eval echo configure:2250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vprintf=yes"
else
@@ -2270,12 +2283,12 @@ fi
if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:2274: checking for _doprnt" >&5
+echo "configure:2285: checking for _doprnt" >&5
if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2279 "configure"
+#line 2290 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */
@@ -2298,7 +2311,7 @@ _doprnt();
; return 0; }
EOF
-if { (eval echo configure:2302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func__doprnt=yes"
else
@@ -2334,7 +2347,7 @@ fi
echo $ac_n "checking whether the printf functions support %p""... $ac_c" 1>&6
-echo "configure:2338: checking whether the printf functions support %p" >&5
+echo "configure:2349: checking whether the printf functions support %p" >&5
if eval "test \"`echo '$''{'gcc_cv_func_printf_ptr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2342,7 +2355,7 @@ else
gcc_cv_func_printf_ptr=no
else
cat > conftest.$ac_ext <<EOF
-#line 2346 "configure"
+#line 2357 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2355,7 +2368,7 @@ main()
exit (p != q);
}
EOF
-if { (eval echo configure:2359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gcc_cv_func_printf_ptr=yes
else
@@ -2388,12 +2401,12 @@ case "${host}" in
;;
esac
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:2392: checking for pid_t" >&5
+echo "configure:2403: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2397 "configure"
+#line 2408 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2422,17 +2435,17 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:2426: checking for vfork.h" >&5
+echo "configure:2437: checking for vfork.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2431 "configure"
+#line 2442 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2436: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2447: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2457,18 +2470,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:2461: checking for working vfork" >&5
+echo "configure:2472: checking for working vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:2467: checking for vfork" >&5
+echo "configure:2478: checking for vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2472 "configure"
+#line 2483 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -2491,7 +2504,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:2495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vfork=yes"
else
@@ -2513,7 +2526,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 2517 "configure"
+#line 2528 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -2608,7 +2621,7 @@ main() {
}
}
EOF
-if { (eval echo configure:2612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_vfork_works=yes
else
@@ -2636,12 +2649,12 @@ for ac_func in malloc realloc calloc free bcopy bzero bcmp \
strsignal putc_unlocked fputs_unlocked strstr
do
echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6
-echo "configure:2640: checking whether $ac_func must be declared" >&5
+echo "configure:2651: checking whether $ac_func must be declared" >&5
if eval "test \"`echo '$''{'gcc_cv_decl_needed_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2645 "configure"
+#line 2656 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2674,7 +2687,7 @@ int main() {
char *(*pfn) = (char *(*)) $ac_func
; return 0; }
EOF
-if { (eval echo configure:2678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_decl_needed_$ac_func=no"
else
@@ -2703,12 +2716,12 @@ done
for ac_func in getrlimit setrlimit
do
echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6
-echo "configure:2707: checking whether $ac_func must be declared" >&5
+echo "configure:2718: checking whether $ac_func must be declared" >&5
if eval "test \"`echo '$''{'gcc_cv_decl_needed_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2712 "configure"
+#line 2723 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2745,7 +2758,7 @@ int main() {
char *(*pfn) = (char *(*)) $ac_func
; return 0; }
EOF
-if { (eval echo configure:2749: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_decl_needed_$ac_func=no"
else
@@ -2772,12 +2785,12 @@ done
echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
-echo "configure:2776: checking for sys_siglist declaration in signal.h or unistd.h" >&5
+echo "configure:2787: checking for sys_siglist declaration in signal.h or unistd.h" >&5
if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2781 "configure"
+#line 2792 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -2789,7 +2802,7 @@ int main() {
char *msg = *(sys_siglist + 1);
; return 0; }
EOF
-if { (eval echo configure:2793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_decl_sys_siglist=yes
else
@@ -2812,12 +2825,12 @@ fi
# mkdir takes a single argument on some systems.
echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6
-echo "configure:2816: checking if mkdir takes one argument" >&5
+echo "configure:2827: checking if mkdir takes one argument" >&5
if eval "test \"`echo '$''{'gcc_cv_mkdir_takes_one_arg'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2821 "configure"
+#line 2832 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -2834,7 +2847,7 @@ int main() {
mkdir ("foo", 0);
; return 0; }
EOF
-if { (eval echo configure:2838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_mkdir_takes_one_arg=no
else
@@ -3059,6 +3072,15 @@ for machine in $build $host $target; do
thread_file='posix'
fi
;;
+ alpha*-*-freebsd*)
+ tm_file="${tm_file} freebsd.h alpha/freebsd.h"
+ xm_file="${xm_file} xm-freebsd.h"
+ target_cpu_default="MASK_GAS"
+ tmake_file="t-freebsd alpha/t-crtbe"
+ xmake_file=none
+ fixincludes=fixinc.wrap
+ gas=yes gnu_ld=yes
+ ;;
alpha*-*-netbsd*)
tm_file="${tm_file} alpha/elf.h alpha/netbsd.h alpha/netbsd-elf.h"
target_cpu_default="MASK_GAS"
@@ -3540,18 +3562,22 @@ for machine in $build $host $target; do
# Next line turned off because both 386BSD and BSD/386 use GNU ld.
# use_collect2=yes
;;
- i[34567]86-*-freebsdelf*)
- tm_file="i386/i386.h i386/att.h svr4.h i386/freebsd-elf.h i386/perform.h"
+ i[34567]86-*-freebsd[12].* | i[34567]86-*-freebsd[12] | i[34567]86-*-freebsdaout*)
+ tm_file=i386/freebsd-aout.h
+ # On FreeBSD, the headers are already ok, except for math.h.
+ fixincludes=fixinc.wrap
+ tmake_file=t-freebsd
+ ;;
+ i[34567]86-*-freebsd* | i[34567]86-*-freebsd[3-9].* | i[34567]86-*-freebsd[3-9] | i[34567]86-*-freebsdelf*)
+ tm_file="i386/i386.h i386/att.h svr4.h i386/freebsd.h i386/perform.h"
+ # On FreeBSD, the headers are already ok, except for math.h.
+ fixincludes=fixinc.wrap
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
tmake_file=t-freebsd
gas=yes
gnu_ld=yes
stabs=yes
;;
- i[34567]86-*-freebsd*)
- tm_file=i386/freebsd.h
- tmake_file=t-freebsd
- ;;
i[34567]86-*-netbsd*)
tm_file=i386/netbsd.h
tmake_file=t-netbsd
@@ -3750,11 +3776,10 @@ for machine in $build $host $target; do
i[34567]86-*-solaris2*)
xm_file="xm-siglist.h xm-alloca.h ${xm_file}"
xm_defines="USG POSIX SMALL_ARG_MAX"
+ tm_file=i386/sol2.h
if test x$gas = xyes; then
# Only needed if gas does not support -s
- tm_file=i386/sol2gas.h
- else
- tm_file=i386/sol2.h
+ tm_file="i386/sol2gas.h ${tm_file}"
fi
tmake_file=i386/t-sol2
extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
@@ -4016,7 +4041,7 @@ for machine in $build $host $target; do
extra_headers=math-68881.h
;;
m68000-hp-hpux*) # HP 9000 series 300
- xm_file="xm_alloca.h ${xm_file}"
+ xm_file="xm-alloca.h ${xm_file}"
xm_defines="USG NO_SYS_SIGLIST"
if test x$gas = xyes
then
@@ -4217,7 +4242,7 @@ for machine in $build $host $target; do
extra_headers=math-68881.h
;;
m68k-hp-hpux7*) # HP 9000 series 300 running HPUX version 7.
- xm_file="xm_alloca.h ${xm_file}"
+ xm_file="xm-alloca.h ${xm_file}"
xm_defines="USG NO_SYS_SIGLIST"
if test x$gas = xyes
then
@@ -4233,7 +4258,7 @@ for machine in $build $host $target; do
float_format=m68k
;;
m68k-hp-hpux*) # HP 9000 series 300
- xm_file="xm_alloca.h ${xm_file}"
+ xm_file="xm-alloca.h ${xm_file}"
xm_defines="USG NO_SYS_SIGLIST"
if test x$gas = xyes
then
@@ -5415,7 +5440,7 @@ for machine in $build $host $target; do
xmake_file=sparc/x-sysv4
extra_parts="crt1.o crti.o crtn.o gmon.o crtbegin.o crtend.o"
case $machine in
- *-*-solaris2.[0-4])
+ *-*-solaris2.0-4)
float_format=i128
;;
*)
@@ -5519,6 +5544,14 @@ for machine in $build $host $target; do
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gnu_ld=yes
;;
+ sparc64-*-freebsd*)
+ tmake_file=sparc/t-sp64
+ tm_file=sparc/sp64-elf.h
+ xm_file="sparc/xm-sp64.h sparc/xm-freebsd.h"
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+ gas=yes
+ gnu_ld=yes
+ ;;
# This hasn't been upgraded to GCC 2.
# tahoe-harris-*) # Harris tahoe, using COFF.
# tm_file=tahoe/harris.h
@@ -6049,7 +6082,7 @@ fi
echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
-echo "configure:6044: checking for strerror in -lcposix" >&5
+echo "configure:6063: checking for strerror in -lcposix" >&5
ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6057,7 +6090,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcposix $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6052 "configure"
+#line 6071 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6068,7 +6101,7 @@ int main() {
strerror()
; return 0; }
EOF
-if { (eval echo configure:6063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6091,12 +6124,12 @@ fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:6086: checking for working const" >&5
+echo "configure:6105: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6091 "configure"
+#line 6110 "configure"
#include "confdefs.h"
int main() {
@@ -6145,7 +6178,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:6140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -6166,21 +6199,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:6161: checking for inline" >&5
+echo "configure:6180: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 6168 "configure"
+#line 6187 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:6175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -6206,12 +6239,12 @@ EOF
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:6201: checking for off_t" >&5
+echo "configure:6220: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6206 "configure"
+#line 6225 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -6239,12 +6272,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:6234: checking for size_t" >&5
+echo "configure:6253: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6239 "configure"
+#line 6258 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -6274,19 +6307,19 @@ fi
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:6269: checking for working alloca.h" >&5
+echo "configure:6288: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6274 "configure"
+#line 6293 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:6281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -6307,12 +6340,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:6302: checking for alloca" >&5
+echo "configure:6321: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6307 "configure"
+#line 6326 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -6340,7 +6373,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:6335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -6372,12 +6405,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:6367: checking whether alloca needs Cray hooks" >&5
+echo "configure:6386: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6372 "configure"
+#line 6391 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -6402,12 +6435,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6397: checking for $ac_func" >&5
+echo "configure:6416: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6402 "configure"
+#line 6421 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6430,7 +6463,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6457,7 +6490,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:6452: checking stack direction for C alloca" >&5
+echo "configure:6471: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6465,7 +6498,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 6460 "configure"
+#line 6479 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -6484,7 +6517,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:6479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -6509,17 +6542,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6504: checking for $ac_hdr" >&5
+echo "configure:6523: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6509 "configure"
+#line 6528 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6514: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -6548,12 +6581,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6543: checking for $ac_func" >&5
+echo "configure:6562: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6548 "configure"
+#line 6567 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6576,7 +6609,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6601,7 +6634,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:6596: checking for working mmap" >&5
+echo "configure:6615: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6609,7 +6642,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 6604 "configure"
+#line 6623 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -6749,7 +6782,7 @@ main()
}
EOF
-if { (eval echo configure:6744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -6777,17 +6810,17 @@ unistd.h sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6772: checking for $ac_hdr" >&5
+echo "configure:6791: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6777 "configure"
+#line 6796 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6801: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -6817,12 +6850,12 @@ done
strdup __argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6812: checking for $ac_func" >&5
+echo "configure:6831: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6817 "configure"
+#line 6836 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6845,7 +6878,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6874,12 +6907,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6869: checking for $ac_func" >&5
+echo "configure:6888: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6874 "configure"
+#line 6893 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6902,7 +6935,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6936,19 +6969,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:6931: checking for LC_MESSAGES" >&5
+echo "configure:6950: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6936 "configure"
+#line 6955 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:6943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
@@ -6969,7 +7002,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:6964: checking whether NLS is requested" >&5
+echo "configure:6983: checking whether NLS is requested" >&5
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
@@ -6989,7 +7022,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:6984: checking whether included gettext is requested" >&5
+echo "configure:7003: checking whether included gettext is requested" >&5
# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
withval="$with_included_gettext"
@@ -7008,17 +7041,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:7003: checking for libintl.h" >&5
+echo "configure:7022: checking for libintl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7008 "configure"
+#line 7027 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7013: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7032: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -7035,19 +7068,19 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:7030: checking for gettext in libc" >&5
+echo "configure:7049: checking for gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7035 "configure"
+#line 7054 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:7042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libc=yes
else
@@ -7063,7 +7096,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
if test "$gt_cv_func_gettext_libc" != "yes"; then
echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:7058: checking for bindtextdomain in -lintl" >&5
+echo "configure:7077: checking for bindtextdomain in -lintl" >&5
ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7071,7 +7104,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7066 "configure"
+#line 7085 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -7082,7 +7115,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:7077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -7098,12 +7131,12 @@ fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:7093: checking for gettext in libintl" >&5
+echo "configure:7112: checking for gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6
-echo "configure:7098: checking for gettext in -lintl" >&5
+echo "configure:7117: checking for gettext in -lintl" >&5
ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7111,7 +7144,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7106 "configure"
+#line 7125 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -7122,7 +7155,7 @@ int main() {
gettext()
; return 0; }
EOF
-if { (eval echo configure:7117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -7161,7 +7194,7 @@ EOF
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7156: checking for $ac_word" >&5
+echo "configure:7175: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7195,12 +7228,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7190: checking for $ac_func" >&5
+echo "configure:7209: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7195 "configure"
+#line 7214 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -7223,7 +7256,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:7218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -7250,7 +7283,7 @@ done
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7245: checking for $ac_word" >&5
+echo "configure:7264: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7286,7 +7319,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7281: checking for $ac_word" >&5
+echo "configure:7300: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7318,7 +7351,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 7313 "configure"
+#line 7332 "configure"
#include "confdefs.h"
int main() {
@@ -7326,7 +7359,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:7321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
@@ -7349,7 +7382,7 @@ fi
if test "$CATOBJEXT" = "NONE"; then
echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6
-echo "configure:7344: checking whether catgets can be used" >&5
+echo "configure:7363: checking whether catgets can be used" >&5
# Check whether --with-catgets or --without-catgets was given.
if test "${with_catgets+set}" = set; then
withval="$with_catgets"
@@ -7362,7 +7395,7 @@ fi
if test "$nls_cv_use_catgets" = "yes"; then
echo $ac_n "checking for main in -li""... $ac_c" 1>&6
-echo "configure:7357: checking for main in -li" >&5
+echo "configure:7376: checking for main in -li" >&5
ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7370,14 +7403,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-li $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7365 "configure"
+#line 7384 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:7372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -7405,12 +7438,12 @@ else
fi
echo $ac_n "checking for catgets""... $ac_c" 1>&6
-echo "configure:7400: checking for catgets" >&5
+echo "configure:7419: checking for catgets" >&5
if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7405 "configure"
+#line 7424 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char catgets(); below. */
@@ -7433,7 +7466,7 @@ catgets();
; return 0; }
EOF
-if { (eval echo configure:7428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_catgets=yes"
else
@@ -7455,7 +7488,7 @@ EOF
# Extract the first word of "gencat", so it can be a program name with args.
set dummy gencat; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7450: checking for $ac_word" >&5
+echo "configure:7469: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7491,7 +7524,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7486: checking for $ac_word" >&5
+echo "configure:7505: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7528,7 +7561,7 @@ fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7523: checking for $ac_word" >&5
+echo "configure:7542: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7563,7 +7596,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7558: checking for $ac_word" >&5
+echo "configure:7577: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7621,7 +7654,7 @@ fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7616: checking for $ac_word" >&5
+echo "configure:7635: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7655,7 +7688,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7650: checking for $ac_word" >&5
+echo "configure:7669: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7691,7 +7724,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7686: checking for $ac_word" >&5
+echo "configure:7705: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7784,7 +7817,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:7779: checking for catalogs to be installed" >&5
+echo "configure:7798: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
@@ -7812,17 +7845,17 @@ echo "configure:7779: checking for catalogs to be installed" >&5
if test "$CATOBJEXT" = ".cat"; then
ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:7807: checking for linux/version.h" >&5
+echo "configure:7826: checking for linux/version.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7812 "configure"
+#line 7831 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -8056,7 +8089,7 @@ fi
# Figure out what assembler alignment features are present.
echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6
-echo "configure:8051: checking assembler alignment features" >&5
+echo "configure:8070: checking assembler alignment features" >&5
gcc_cv_as=
gcc_cv_as_alignment_features=
gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
@@ -8177,7 +8210,7 @@ fi
echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6
echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6
-echo "configure:8172: checking assembler subsection support" >&5
+echo "configure:8191: checking assembler subsection support" >&5
gcc_cv_as_subsections=
if test x$gcc_cv_as != x; then
# Check if we have .subsection
@@ -8217,7 +8250,7 @@ fi
echo "$ac_t""$gcc_cv_as_subsections" 1>&6
echo $ac_n "checking assembler instructions""... $ac_c" 1>&6
-echo "configure:8212: checking assembler instructions" >&5
+echo "configure:8231: checking assembler instructions" >&5
gcc_cv_as_instructions=
if test x$gcc_cv_as != x; then
set "filds fists" "filds mem; fists mem"
diff --git a/contrib/gcc/cp/decl.c b/contrib/gcc/cp/decl.c
index 4b6770d..79e0d97 100644
--- a/contrib/gcc/cp/decl.c
+++ b/contrib/gcc/cp/decl.c
@@ -19,6 +19,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
/* Process declarations and symbol lookup for C front end.
Also constructs types; the standard scalar types at initialization,
@@ -188,8 +190,6 @@ static tree record_builtin_java_type PROTO((const char *, int));
static const char *tag_name PROTO((enum tag_types code));
static void find_class_binding_level PROTO((void));
static struct binding_level *innermost_nonclass_level PROTO((void));
-static void finish_dtor PROTO((void));
-static void finish_ctor PROTO((int));
static tree poplevel_class PROTO((void));
static void warn_about_implicit_typename_lookup PROTO((tree, tree));
static int walk_namespaces_r PROTO((tree, walk_namespaces_fn, void *));
@@ -337,15 +337,6 @@ tree __ptr_desc_array_type, __attr_dec_array_type, __func_desc_array_type;
tree __ptmf_desc_array_type, __ptmd_desc_array_type;
#endif
-/* This is the identifier __vlist. */
-tree vlist_identifier;
-
-/* This is the type _Vlist = vtable_entry_type**. */
-tree vlist_type_node;
-
-/* A null pointer of type _Vlist. */
-tree vlist_zero_node;
-
/* Indicates that there is a type value in some namespace, although
that is not necessarily in scope at the moment. */
@@ -2054,7 +2045,7 @@ print_binding_level (lvl)
tree t;
int i = 0, len;
fprintf (stderr, " blocks=");
- fprintf (stderr, HOST_PTR_PRINTF, lvl->blocks);
+ fprintf (stderr, HOST_PTR_PRINTF, (void *) lvl->blocks);
fprintf (stderr, " n_incomplete=%d parm_flag=%d keep=%d",
list_length (lvl->incomplete), lvl->parm_flag, lvl->keep);
if (lvl->tag_transparent)
@@ -2158,7 +2149,7 @@ print_other_binding_stack (stack)
for (level = stack; level != global_binding_level; level = level->level_chain)
{
fprintf (stderr, "binding level ");
- fprintf (stderr, HOST_PTR_PRINTF, level);
+ fprintf (stderr, HOST_PTR_PRINTF, (void *) level);
fprintf (stderr, "\n");
print_binding_level (level);
}
@@ -2169,11 +2160,11 @@ print_binding_stack ()
{
struct binding_level *b;
fprintf (stderr, "current_binding_level=");
- fprintf (stderr, HOST_PTR_PRINTF, current_binding_level);
+ fprintf (stderr, HOST_PTR_PRINTF, (void *) current_binding_level);
fprintf (stderr, "\nclass_binding_level=");
- fprintf (stderr, HOST_PTR_PRINTF, class_binding_level);
+ fprintf (stderr, HOST_PTR_PRINTF, (void *) class_binding_level);
fprintf (stderr, "\nglobal_binding_level=");
- fprintf (stderr, HOST_PTR_PRINTF, global_binding_level);
+ fprintf (stderr, HOST_PTR_PRINTF, (void *) global_binding_level);
fprintf (stderr, "\n");
if (class_binding_level)
{
@@ -6294,7 +6285,6 @@ init_decl_processing ()
this_identifier = get_identifier (THIS_NAME);
in_charge_identifier = get_identifier (IN_CHARGE_NAME);
- vlist_identifier = get_identifier (VLIST_NAME);
ctor_identifier = get_identifier (CTOR_NAME);
dtor_identifier = get_identifier (DTOR_NAME);
pfn_identifier = get_identifier (VTABLE_PFN_NAME);
@@ -6522,7 +6512,6 @@ init_decl_processing ()
#if 0
record_builtin_type (RID_MAX, NULL_PTR, ptr_type_node);
#endif
-
endlink = void_list_node;
int_endlink = tree_cons (NULL_TREE, integer_type_node, endlink);
double_endlink = tree_cons (NULL_TREE, double_type_node, endlink);
@@ -6862,16 +6851,6 @@ init_decl_processing ()
layout_type (vtbl_ptr_type_node);
record_builtin_type (RID_MAX, NULL_PTR, vtbl_ptr_type_node);
- if (flag_vtable_thunks)
- {
- /* We need vlists only when using thunks; otherwise leave them
- as NULL_TREE. That way, it doesn't get into the way of the
- mangling. */
- vlist_type_node = build_pointer_type (vtbl_ptr_type_node);
- vlist_zero_node = build_int_2 (0, 0);
- TREE_TYPE (vlist_zero_node) = vlist_type_node;
- }
-
/* Simplify life by making a "sigtable_entry_type". Give its
fields names so that the debugger can use them. */
@@ -11409,10 +11388,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (TYPE_USES_VIRTUAL_BASECLASSES (DECL_CONTEXT (decl)))
arg_types = TREE_CHAIN (arg_types);
- /* And the `vlist' argument. */
- if (TYPE_USES_PVBASES (DECL_CONTEXT (decl)))
- arg_types = TREE_CHAIN (arg_types);
-
if (arg_types == void_list_node
|| (arg_types
&& TREE_CHAIN (arg_types)
@@ -12107,9 +12082,6 @@ replace_defarg (arg, init)
TREE_PURPOSE (arg) = init;
}
-/* Return 1 if D copies its arguments. This is used to test for copy
- constructors and copy assignment operators. */
-
int
copy_args_p (d)
tree d;
@@ -12117,12 +12089,7 @@ copy_args_p (d)
tree t = FUNCTION_ARG_CHAIN (d);
if (DECL_CONSTRUCTOR_P (d)
&& TYPE_USES_VIRTUAL_BASECLASSES (DECL_CONTEXT (d)))
- {
- t = TREE_CHAIN (t);
- if (TYPE_USES_PVBASES (DECL_CONTEXT (d)))
- t = TREE_CHAIN (t);
- }
-
+ t = TREE_CHAIN (t);
if (t && TREE_CODE (TREE_VALUE (t)) == REFERENCE_TYPE
&& (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_VALUE (t)))
== DECL_CLASS_CONTEXT (d))
@@ -12152,8 +12119,7 @@ grok_ctor_properties (ctype, decl)
added to any ctor so we can tell if the class has been initialized
yet. This could screw things up in this function, so we deliberately
ignore the leading int if we're in that situation. */
- if (TYPE_USES_VIRTUAL_BASECLASSES (ctype)
- && !CLASSTYPE_IS_TEMPLATE (ctype))
+ if (TYPE_USES_VIRTUAL_BASECLASSES (ctype))
{
my_friendly_assert (parmtypes
&& TREE_VALUE (parmtypes) == integer_type_node,
@@ -12162,15 +12128,6 @@ grok_ctor_properties (ctype, decl)
parmtype = TREE_VALUE (parmtypes);
}
- if (TYPE_USES_PVBASES (ctype))
- {
- my_friendly_assert (parmtypes
- && TREE_VALUE (parmtypes) == vlist_type_node,
- 980529);
- parmtypes = TREE_CHAIN (parmtypes);
- parmtype = TREE_VALUE (parmtypes);
- }
-
/* [class.copy]
A non-template constructor for class X is a copy constructor if
@@ -12968,16 +12925,6 @@ xref_basetypes (code_type_node, name, ref, binfo)
{
TYPE_USES_VIRTUAL_BASECLASSES (ref) = 1;
TYPE_USES_COMPLEX_INHERITANCE (ref) = 1;
- /* The PVBASES flag is never set for templates; we know
- only for instantiations whether the virtual bases are
- polymorphic. */
- if (flag_vtable_thunks >= 2 && !CLASSTYPE_IS_TEMPLATE (ref))
- {
- if (via_virtual && TYPE_VIRTUAL_P (basetype))
- TYPE_USES_PVBASES (ref) = 1;
- else if (TYPE_USES_PVBASES (basetype))
- TYPE_USES_PVBASES (ref) = 1;
- }
}
if (CLASS_TYPE_P (basetype))
@@ -13983,313 +13930,6 @@ store_return_init (return_id, init)
}
-/* Emit implicit code for a destructor. This is a subroutine of
- finish_function. */
-
-static void
-finish_dtor ()
-{
- tree binfo = TYPE_BINFO (current_class_type);
- tree cond = integer_one_node;
- tree exprstmt;
- tree in_charge_node = lookup_name (in_charge_identifier, 0);
- tree virtual_size;
- int ok_to_optimize_dtor = 0;
- int empty_dtor = get_last_insn () == last_dtor_insn;
- rtx insns, last_parm_insn;
-
- if (current_function_assigns_this)
- cond = build (NE_EXPR, boolean_type_node,
- current_class_ptr, integer_zero_node);
- else
- {
- int n_baseclasses = CLASSTYPE_N_BASECLASSES (current_class_type);
-
- /* If this destructor is empty, then we don't need to check
- whether `this' is NULL in some cases. */
- if ((flag_this_is_variable & 1) == 0)
- ok_to_optimize_dtor = 1;
- else if (empty_dtor)
- ok_to_optimize_dtor
- = (n_baseclasses == 0
- || (n_baseclasses == 1
- && TYPE_HAS_DESTRUCTOR (TYPE_BINFO_BASETYPE (current_class_type, 0))));
- }
-
- /* If this has a vlist1 parameter, allocate the corresponding vlist
- parameter. */
- if (DECL_DESTRUCTOR_FOR_PVBASE_P (current_function_decl))
- {
- /* _Vlist __vlist; */
- tree vlist;
-
- mark_all_temps_used();
- vlist = pushdecl (build_decl (VAR_DECL, vlist_identifier,
- vlist_type_node));
- TREE_USED (vlist) = 1;
- DECL_ARTIFICIAL (vlist) = 1;
- expand_decl (vlist);
- expand_decl_init (vlist);
- }
-
- /* These initializations might go inline. Protect
- the binding level of the parms. */
- pushlevel (0);
- expand_start_bindings (0);
-
- if (current_function_assigns_this)
- {
- current_function_assigns_this = 0;
- current_function_just_assigned_this = 0;
- }
-
- /* Generate the code to call destructor on base class.
- If this destructor belongs to a class with virtual
- functions, then set the virtual function table
- pointer to represent the type of our base class. */
-
- /* This side-effect makes call to `build_delete' generate the
- code we have to have at the end of this destructor.
- `build_delete' will set the flag again. */
- TYPE_HAS_DESTRUCTOR (current_class_type) = 0;
-
- /* These are two cases where we cannot delegate deletion. */
- if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type)
- || TYPE_GETS_REG_DELETE (current_class_type))
- exprstmt = build_delete
- (current_class_type, current_class_ref, integer_zero_node,
- LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR|LOOKUP_NORMAL, 0);
- else
- exprstmt = build_delete
- (current_class_type, current_class_ref, in_charge_node,
- LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR|LOOKUP_NORMAL, 0);
-
- /* If we did not assign to this, then `this' is non-zero at
- the end of a destructor. As a special optimization, don't
- emit test if this is an empty destructor. If it does nothing,
- it does nothing. If it calls a base destructor, the base
- destructor will perform the test. */
-
- if (exprstmt != error_mark_node
- && (TREE_CODE (exprstmt) != NOP_EXPR
- || TREE_OPERAND (exprstmt, 0) != integer_zero_node
- || TYPE_USES_VIRTUAL_BASECLASSES (current_class_type)))
- {
- expand_label (dtor_label);
- if (cond != integer_one_node)
- expand_start_cond (cond, 0);
- if (exprstmt != void_zero_node)
- /* Don't call `expand_expr_stmt' if we're not going to do
- anything, since -Wall will give a diagnostic. */
- expand_expr_stmt (exprstmt);
-
- /* Run destructor on all virtual baseclasses. */
- if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
- {
- tree vbases = nreverse
- (copy_list (CLASSTYPE_VBASECLASSES (current_class_type)));
- expand_start_cond (build (BIT_AND_EXPR, integer_type_node,
- in_charge_node, integer_two_node), 0);
- while (vbases)
- {
- if (TYPE_NEEDS_DESTRUCTOR (BINFO_TYPE (vbases)))
- {
- tree vb = get_vbase
- (BINFO_TYPE (vbases),
- TYPE_BINFO (current_class_type));
-
- expand_expr_stmt
- (build_base_dtor_call (current_class_ref,
- vb, integer_zero_node));
- }
- vbases = TREE_CHAIN (vbases);
- }
- expand_end_cond ();
- }
-
- do_pending_stack_adjust ();
- if (cond != integer_one_node)
- expand_end_cond ();
- }
-
- virtual_size = c_sizeof (current_class_type);
-
- /* At the end, call delete if that's what's requested. */
-
- /* FDIS sez: At the point of definition of a virtual destructor
- (including an implicit definition), non-placement operator
- delete shall be looked up in the scope of the destructor's
- class and if found shall be accessible and unambiguous.
-
- This is somewhat unclear, but I take it to mean that if the
- class only defines placement deletes we don't do anything here.
- So we pass LOOKUP_SPECULATIVELY; delete_sanity will complain
- for us if they ever try to delete one of these. */
-
- if (TYPE_GETS_REG_DELETE (current_class_type)
- || TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
- exprstmt = build_op_delete_call
- (DELETE_EXPR, current_class_ptr, virtual_size,
- LOOKUP_NORMAL | LOOKUP_SPECULATIVELY, NULL_TREE);
- else
- exprstmt = NULL_TREE;
-
- if (exprstmt)
- {
- cond = build (BIT_AND_EXPR, integer_type_node,
- in_charge_node, integer_one_node);
- expand_start_cond (cond, 0);
- expand_expr_stmt (exprstmt);
- expand_end_cond ();
- }
-
- /* End of destructor. */
- expand_end_bindings (NULL_TREE, getdecls () != NULL_TREE, 0);
- poplevel (getdecls () != NULL_TREE, 0, 0);
-
- /* Back to the top of destructor. */
- /* Don't execute destructor code if `this' is NULL. */
-
- start_sequence ();
-
- /* If we need thunk-style vlists, initialize them if the caller did
- not pass them. This requires a new temporary. The generated code
- looks like
- if (!(__in_charge & 4))
- __vlist = __vl.<type> + sizeof(__vl.<type>);
- else
- __vlist = __vlist1;
- */
- if (TYPE_USES_PVBASES (current_class_type))
- {
- tree vlist = lookup_name (vlist_identifier, 0);
- tree vlist1 = lookup_name (get_identifier (VLIST1_NAME), 0);
- cond = build (BIT_AND_EXPR, integer_type_node,
- in_charge_node, build_int_2 (4, 0));
- cond = build1 (TRUTH_NOT_EXPR, boolean_type_node, cond);
- expand_start_cond (cond, 0);
- init_vlist (current_class_type);
- expand_start_else ();
- expand_expr_stmt (build_modify_expr (vlist, NOP_EXPR, vlist1));
- expand_end_cond ();
- }
-
- /* If the dtor is empty, and we know there is not possible way we
- could use any vtable entries, before they are possibly set by
- a base class dtor, we don't have to setup the vtables, as we
- know that any base class dtoring will set up any vtables it
- needs. We avoid MI, because one base class dtor can do a
- virtual dispatch to an overridden function that would need to
- have a non-related vtable set up, we cannot avoid setting up
- vtables in that case. We could change this to see if there is
- just one vtable. */
- if (! empty_dtor || TYPE_USES_COMPLEX_INHERITANCE (current_class_type))
- {
- /* Make all virtual function table pointers in non-virtual base
- classes point to CURRENT_CLASS_TYPE's virtual function
- tables. */
- expand_direct_vtbls_init (binfo, binfo, 1, 0, current_class_ptr);
-
- if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
- expand_indirect_vtbls_init (binfo, current_class_ref, current_class_ptr);
- }
-
- if (! ok_to_optimize_dtor)
- {
- cond = build_binary_op (NE_EXPR,
- current_class_ptr, integer_zero_node);
- expand_start_cond (cond, 0);
- }
-
- insns = get_insns ();
- end_sequence ();
-
- last_parm_insn = get_first_nonparm_insn ();
- if (last_parm_insn == NULL_RTX)
- last_parm_insn = get_last_insn ();
- else
- last_parm_insn = previous_insn (last_parm_insn);
-
- emit_insns_after (insns, last_parm_insn);
-
- if (! ok_to_optimize_dtor)
- expand_end_cond ();
-}
-
-/* Emit implicit code for a constructor. This is a subroutine of
- finish_function. CALL_POPLEVEL is the same variable in
- finish_function. */
-
-static void
-finish_ctor (call_poplevel)
- int call_poplevel;
-{
- register tree fndecl = current_function_decl;
- tree cond = NULL_TREE, thenclause = NULL_TREE;
- rtx insns;
- tree decls;
-
- /* Allow constructor for a type to get a new instance of the object
- using `build_new'. */
- tree abstract_virtuals = CLASSTYPE_ABSTRACT_VIRTUALS (current_class_type);
- CLASSTYPE_ABSTRACT_VIRTUALS (current_class_type) = NULL_TREE;
-
- if (flag_this_is_variable > 0)
- {
- cond = build_binary_op (EQ_EXPR, current_class_ptr, integer_zero_node);
- thenclause =
- build_modify_expr (current_class_ptr, NOP_EXPR,
- build_new (NULL_TREE, current_class_type,
- void_type_node, 0));
- }
-
- CLASSTYPE_ABSTRACT_VIRTUALS (current_class_type) = abstract_virtuals;
-
- start_sequence ();
-
- if (flag_this_is_variable > 0)
- {
- expand_start_cond (cond, 0);
- expand_expr_stmt (thenclause);
- expand_end_cond ();
- }
-
- /* Emit insns from `emit_base_init' which sets up virtual
- function table pointer(s). */
- if (base_init_expr)
- {
- expand_expr_stmt (base_init_expr);
- base_init_expr = NULL_TREE;
- }
-
- insns = get_insns ();
- end_sequence ();
-
- /* This is where the body of the constructor begins. */
-
- emit_insns_after (insns, last_parm_cleanup_insn);
-
- end_protect_partials ();
-
- /* This is where the body of the constructor ends. */
- expand_label (ctor_label);
- ctor_label = NULL_TREE;
-
- if (call_poplevel)
- {
- decls = getdecls ();
- expand_end_bindings (decls, decls != NULL_TREE, 0);
- poplevel (decls != NULL_TREE, 1, 0);
- }
-
- /* c_expand_return knows to return 'this' from a constructor. */
- c_expand_return (NULL_TREE);
-
- current_function_assigns_this = 0;
- current_function_just_assigned_this = 0;
-}
-
-
/* Finish up a function declaration and compile that function
all the way to assembler language output. The free the storage
for the function definition.
@@ -14318,6 +13958,7 @@ finish_function (lineno, flags, nested)
{
register tree fndecl = current_function_decl;
tree fntype, ctype = NULL_TREE;
+ rtx last_parm_insn, insns;
/* Label to use if this function is supposed to return a value. */
tree no_return_label = NULL_TREE;
tree decls = NULL_TREE;
@@ -14379,7 +14020,191 @@ finish_function (lineno, flags, nested)
do_pending_stack_adjust ();
if (dtor_label)
- finish_dtor ();
+ {
+ tree binfo = TYPE_BINFO (current_class_type);
+ tree cond = integer_one_node;
+ tree exprstmt;
+ tree in_charge_node = lookup_name (in_charge_identifier, 0);
+ tree virtual_size;
+ int ok_to_optimize_dtor = 0;
+ int empty_dtor = get_last_insn () == last_dtor_insn;
+
+ if (current_function_assigns_this)
+ cond = build (NE_EXPR, boolean_type_node,
+ current_class_ptr, integer_zero_node);
+ else
+ {
+ int n_baseclasses = CLASSTYPE_N_BASECLASSES (current_class_type);
+
+ /* If this destructor is empty, then we don't need to check
+ whether `this' is NULL in some cases. */
+ if ((flag_this_is_variable & 1) == 0)
+ ok_to_optimize_dtor = 1;
+ else if (empty_dtor)
+ ok_to_optimize_dtor
+ = (n_baseclasses == 0
+ || (n_baseclasses == 1
+ && TYPE_HAS_DESTRUCTOR (TYPE_BINFO_BASETYPE (current_class_type, 0))));
+ }
+
+ /* These initializations might go inline. Protect
+ the binding level of the parms. */
+ pushlevel (0);
+ expand_start_bindings (0);
+
+ if (current_function_assigns_this)
+ {
+ current_function_assigns_this = 0;
+ current_function_just_assigned_this = 0;
+ }
+
+ /* Generate the code to call destructor on base class.
+ If this destructor belongs to a class with virtual
+ functions, then set the virtual function table
+ pointer to represent the type of our base class. */
+
+ /* This side-effect makes call to `build_delete' generate the
+ code we have to have at the end of this destructor.
+ `build_delete' will set the flag again. */
+ TYPE_HAS_DESTRUCTOR (current_class_type) = 0;
+
+ /* These are two cases where we cannot delegate deletion. */
+ if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type)
+ || TYPE_GETS_REG_DELETE (current_class_type))
+ exprstmt = build_delete (current_class_type, current_class_ref, integer_zero_node,
+ LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR|LOOKUP_NORMAL, 0);
+ else
+ exprstmt = build_delete (current_class_type, current_class_ref, in_charge_node,
+ LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR|LOOKUP_NORMAL, 0);
+
+ /* If we did not assign to this, then `this' is non-zero at
+ the end of a destructor. As a special optimization, don't
+ emit test if this is an empty destructor. If it does nothing,
+ it does nothing. If it calls a base destructor, the base
+ destructor will perform the test. */
+
+ if (exprstmt != error_mark_node
+ && (TREE_CODE (exprstmt) != NOP_EXPR
+ || TREE_OPERAND (exprstmt, 0) != integer_zero_node
+ || TYPE_USES_VIRTUAL_BASECLASSES (current_class_type)))
+ {
+ expand_label (dtor_label);
+ if (cond != integer_one_node)
+ expand_start_cond (cond, 0);
+ if (exprstmt != void_zero_node)
+ /* Don't call `expand_expr_stmt' if we're not going to do
+ anything, since -Wall will give a diagnostic. */
+ expand_expr_stmt (exprstmt);
+
+ /* Run destructor on all virtual baseclasses. */
+ if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
+ {
+ tree vbases = nreverse (copy_list (CLASSTYPE_VBASECLASSES (current_class_type)));
+ expand_start_cond (build (BIT_AND_EXPR, integer_type_node,
+ in_charge_node, integer_two_node), 0);
+ while (vbases)
+ {
+ if (TYPE_NEEDS_DESTRUCTOR (BINFO_TYPE (vbases)))
+ {
+ tree vb = get_vbase
+ (BINFO_TYPE (vbases),
+ TYPE_BINFO (current_class_type));
+ expand_expr_stmt
+ (build_scoped_method_call
+ (current_class_ref, vb, dtor_identifier,
+ build_expr_list (NULL_TREE, integer_zero_node)));
+ }
+ vbases = TREE_CHAIN (vbases);
+ }
+ expand_end_cond ();
+ }
+
+ do_pending_stack_adjust ();
+ if (cond != integer_one_node)
+ expand_end_cond ();
+ }
+
+ virtual_size = c_sizeof (current_class_type);
+
+ /* At the end, call delete if that's what's requested. */
+
+ /* FDIS sez: At the point of definition of a virtual destructor
+ (including an implicit definition), non-placement operator
+ delete shall be looked up in the scope of the destructor's
+ class and if found shall be accessible and unambiguous.
+
+ This is somewhat unclear, but I take it to mean that if the
+ class only defines placement deletes we don't do anything here.
+ So we pass LOOKUP_SPECULATIVELY; delete_sanity will complain
+ for us if they ever try to delete one of these. */
+
+ if (TYPE_GETS_REG_DELETE (current_class_type)
+ || TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
+ exprstmt = build_op_delete_call
+ (DELETE_EXPR, current_class_ptr, virtual_size,
+ LOOKUP_NORMAL | LOOKUP_SPECULATIVELY, NULL_TREE);
+ else
+ exprstmt = NULL_TREE;
+
+ if (exprstmt)
+ {
+ cond = build (BIT_AND_EXPR, integer_type_node,
+ in_charge_node, integer_one_node);
+ expand_start_cond (cond, 0);
+ expand_expr_stmt (exprstmt);
+ expand_end_cond ();
+ }
+
+ /* End of destructor. */
+ expand_end_bindings (NULL_TREE, getdecls () != NULL_TREE, 0);
+ poplevel (getdecls () != NULL_TREE, 0, 0);
+
+ /* Back to the top of destructor. */
+ /* Don't execute destructor code if `this' is NULL. */
+
+ start_sequence ();
+
+ /* If the dtor is empty, and we know there is not possible way we
+ could use any vtable entries, before they are possibly set by
+ a base class dtor, we don't have to setup the vtables, as we
+ know that any base class dtoring will set up any vtables it
+ needs. We avoid MI, because one base class dtor can do a
+ virtual dispatch to an overridden function that would need to
+ have a non-related vtable set up, we cannot avoid setting up
+ vtables in that case. We could change this to see if there is
+ just one vtable. */
+ if (! empty_dtor || TYPE_USES_COMPLEX_INHERITANCE (current_class_type))
+ {
+ /* Make all virtual function table pointers in non-virtual base
+ classes point to CURRENT_CLASS_TYPE's virtual function
+ tables. */
+ expand_direct_vtbls_init (binfo, binfo, 1, 0, current_class_ptr);
+
+ if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
+ expand_indirect_vtbls_init (binfo, current_class_ref, current_class_ptr);
+ }
+
+ if (! ok_to_optimize_dtor)
+ {
+ cond = build_binary_op (NE_EXPR,
+ current_class_ptr, integer_zero_node);
+ expand_start_cond (cond, 0);
+ }
+
+ insns = get_insns ();
+ end_sequence ();
+
+ last_parm_insn = get_first_nonparm_insn ();
+ if (last_parm_insn == NULL_RTX)
+ last_parm_insn = get_last_insn ();
+ else
+ last_parm_insn = previous_insn (last_parm_insn);
+
+ emit_insns_after (insns, last_parm_insn);
+
+ if (! ok_to_optimize_dtor)
+ expand_end_cond ();
+ }
else if (current_function_assigns_this)
{
/* Does not need to call emit_base_init, because
@@ -14409,9 +14234,67 @@ finish_function (lineno, flags, nested)
current_function_just_assigned_this = 0;
base_init_expr = NULL_TREE;
}
- else if (DECL_CONSTRUCTOR_P (fndecl)
- && !DECL_VLIST_CTOR_WRAPPER_P (fndecl))
- finish_ctor (call_poplevel);
+ else if (DECL_CONSTRUCTOR_P (fndecl))
+ {
+ tree cond = NULL_TREE, thenclause = NULL_TREE;
+ /* Allow constructor for a type to get a new instance of the object
+ using `build_new'. */
+ tree abstract_virtuals = CLASSTYPE_ABSTRACT_VIRTUALS (current_class_type);
+ CLASSTYPE_ABSTRACT_VIRTUALS (current_class_type) = NULL_TREE;
+
+ if (flag_this_is_variable > 0)
+ {
+ cond = build_binary_op (EQ_EXPR,
+ current_class_ptr, integer_zero_node);
+ thenclause = build_modify_expr (current_class_ptr, NOP_EXPR,
+ build_new (NULL_TREE, current_class_type, void_type_node, 0));
+ }
+
+ CLASSTYPE_ABSTRACT_VIRTUALS (current_class_type) = abstract_virtuals;
+
+ start_sequence ();
+
+ if (flag_this_is_variable > 0)
+ {
+ expand_start_cond (cond, 0);
+ expand_expr_stmt (thenclause);
+ expand_end_cond ();
+ }
+
+ /* Emit insns from `emit_base_init' which sets up virtual
+ function table pointer(s). */
+ if (base_init_expr)
+ {
+ expand_expr_stmt (base_init_expr);
+ base_init_expr = NULL_TREE;
+ }
+
+ insns = get_insns ();
+ end_sequence ();
+
+ /* This is where the body of the constructor begins. */
+
+ emit_insns_after (insns, last_parm_cleanup_insn);
+
+ end_protect_partials ();
+
+ /* This is where the body of the constructor ends. */
+ expand_label (ctor_label);
+ ctor_label = NULL_TREE;
+
+ if (call_poplevel)
+ {
+ decls = getdecls ();
+ expand_end_bindings (decls, decls != NULL_TREE, 0);
+ poplevel (decls != NULL_TREE, 1, 0);
+ }
+
+ /* c_expand_return knows to return 'this' from a constructor. */
+ c_expand_return (NULL_TREE);
+
+ current_function_assigns_this = 0;
+ current_function_just_assigned_this = 0;
+ }
else if (DECL_MAIN_P (fndecl))
{
/* Make it so that `main' always returns 0 by default. */
diff --git a/contrib/gcc/cp/except.c b/contrib/gcc/cp/except.c
index 9e2d6af..f2896c7 100644
--- a/contrib/gcc/cp/except.c
+++ b/contrib/gcc/cp/except.c
@@ -21,6 +21,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
#include "config.h"
#include "system.h"
diff --git a/contrib/gcc/cp/g++.c b/contrib/gcc/cp/g++.c
index f694898..efb6231 100644
--- a/contrib/gcc/cp/g++.c
+++ b/contrib/gcc/cp/g++.c
@@ -415,7 +415,7 @@ main (argc, argv)
programname = p;
if (argc == 1)
- fatal ("No input files specified.\n");
+ fatal ("No input files specified");
#ifndef __MSDOS__
/* We do a little magic to find out where the main gcc executable
diff --git a/contrib/gcc/cp/gxxint.texi b/contrib/gcc/cp/gxxint.texi
index 81bcab8..e3ba1aa 100644
--- a/contrib/gcc/cp/gxxint.texi
+++ b/contrib/gcc/cp/gxxint.texi
@@ -1,4 +1,5 @@
\input texinfo @c -*-texinfo-*-
+@c %** $FreeBSD$
@c %**start of header
@setfilename g++int.info
@settitle G++ internals
@@ -26,7 +27,6 @@ Questions and comments to Benjamin Kosnik @code{<bkoz@@cygnus.com>}.
* Exception Handling::
* Free Store::
* Mangling:: Function name mangling for C++ and Java
-* Vtables:: Two ways to do virtual functions
* Concept Index::
@end menu
@@ -191,9 +191,7 @@ accessed by the BINFO_ accessor macros.
The virtual function table holds information used in virtual function
dispatching. In the compiler, they are usually referred to as vtables,
or vtbls. The first index is not used in the normal way, I believe it
-is probably used for the virtual destructor. There are two forms of
-virtual tables, one that has offsets in addition to pointers, and one
-using thunks. @xref{Vtables}.
+is probably used for the virtual destructor.
@item vfield
@@ -1458,7 +1456,7 @@ To meet the first goal, we defer emission of inlines and vtables until
the end of the translation unit, where we can decide whether or not they
are needed, and how to emit them if they are.
-@node Mangling, Vtables, Free Store, Top
+@node Mangling, Concept Index, Free Store, Top
@section Function name mangling for C++ and Java
Both C++ and Jave provide overloaded function and methods,
@@ -1842,231 +1840,7 @@ Used for template type parameters.
The letters @samp{G}, @samp{M}, @samp{O}, and @samp{p}
also seem to be used for obscure purposes ...
-@node Vtables, Concept Index, Mangling, Top
-@section Virtual Tables
-
-In order to invoke virtual functions, GNU C++ uses virtual tables. Each
-virtual function gets an index, and the table entry points to the
-overridden function to call. Sometimes, and adjustment to the this
-pointer has to be made before calling a virtual function:
-
-@example
-struct A@{
- int i;
- virtual void foo();
-@};
-
-struct B@{
- int j;
- virtual void bar();
-@};
-
-struct C:A,B@{
- virtual void bar();
-@};
-
-void C::bar()
-@{
- i++;
-@}
-
-int main()
-@{
- C *c = new C;
- B *b = c;
- c->bar();
-@}
-@end example
-
-Here, casting from @samp{c} to @samp{b} adds an offset. When @samp{bar}
-is called, this offset needs to be subtracted, so that @samp{C::bar} can
-properly access @samp{i}. One approach of achieving this is to use
-@emph{thunks}, which are small half-functions put into the virtual
-table. The modify the first argument (the @samp{this} pointer), and then
-jump into the real function.
-
-The other (traditional) approach is to have an additional integer in the
-virtual table which is added to this. This is an additional overhead
-both at the function call, and in the size of virtual tables: In the
-case of single inheritance (or for the first base class), these integers
-will always be zero.
-
-@subsection Virtual Base Classes with Virtual Tables
-
-In case of virtual bases, the code is even more
-complicated. Constructors and destructors need to know whether they are
-"in charge" of the virtual bases, and an implicit integer
-@samp{__in_chrg} for that purpose.
-
-@example
-struct A@{
- int i;
- virtual void bar();
- void call_bar()@{bar();@}
-@};
-
-struct B:virtual A@{
- B();
- int j;
- virtual void bar();
-@};
-
-B::B()@{
- call_bar();
-@}
-
-struct C@{
- int k;
-@};
-
-struct D:C,B@{
- int l;
- virtual void bar();
-@};
-
-@end example
-
-When constructing an instance of B, it will have the following layout:
-@samp{vbase pointer to A}, @samp{j}, @samp{A virtual table}, @samp{i}.
-On a 32-bit machine, downcasting from @samp{A*} to @samp{B*} would need
-to subtract 8, which would be the thunk executed when calling
-@samp{B::bar} inside @samp{call_bar}.
-
-When constructing an instance of D, it will have a different layout:
-@samp{k}, @samp{vbase pointer to A}, @samp{j}, @samp{l}, @samp{A virtual
-table}, @samp{i}. So, when downcasting from @samp{A*} to @samp{B*} in a
-@samp{D} object, the offset would be @samp{12}.
-
-This means that during construction of the @samp{B} base of a @samp{D}
-object, a virtual table is needed which has a @samp{-12} thunk to
-@samp{B::bar}. This is @emph{only} needed during construction and
-destruction, as the full object will use a @samp{-16} thunk to
-@samp{D::bar}.
-
-In order to implement this, the compiler generates an implicit argument
-(in addition to @code{__in_chrg}): the virtual list argument
-@code{__vlist}. This is a list of virtual tables needed during
-construction and destruction. The virtual pointers are ordered in the
-way they are used during construction; the destructors will process the
-array in reverse order. The ordering is as follows:
-@itemize @bullet
-@item
-If the class is in charge, the vlist starts with virtual table pointers
-for the virtual bases that have virtual bases themselves. Here, only
-@emph{polymorphic} virtual bases (pvbases) are interesting: if a vbase
-has no virtual functions, it doesn't have a virtual table.
-
-@item
-Next, the vlist has virtual tables for the initialization of the
-non-virtual bases. These bases are not in charge, so the layout is
-recursive, but ignores virtual bases during recursion.
-
-@item
-Next, there is a number of virtual tables for each virtual base. These
-are sorted in the order in which virtual bases are constructed. Each
-virtual base may have more than one @code{vfield}, and therefore require
-more than one @code{vtable}. The order of vtables is the same as used
-when initializing vfields of non-virtual bases in a constructor.
-@end itemize
-
-The compiler emits a virtual table list in a variable mangled as
-@code{__vl.classname}.
-
-Class with virtual bases, but without pvbases, only have the
-@code{__in_chrg} argument to their ctors and dtors: they don't have any
-vfields in the vbases to initialize.
-
-A further problem arises with virtual destructors: A destructor
-typically has only the @code{__in_chrg} argument, which also indicates
-whether the destructor should call @code{operator delete}. A dtor of a
-class with pvbases has an additional argument. Unfortunately, a caller
-of a virtual dtor might not know whether to pass that argument or not.
-Therefore, the dtor processes the @code{__vlist} argument in an
-automatic variable, which is initialized from the class' vlist if the
-__in_chrg flag has a zero value in bit 2 (bit mask 4), or from the
-argument @code{__vlist1} if bit 2 of the __in_chrg parameter is set to
-one.
-
-@subsection Specification of non-thunked vtables
-
-In the traditional implementation of vtables, each slot contains three
-fields: The offset to be added to the this pointer before invoking a
-virtual function, an unused field that is always zero, and the pointer
-to the virtual function. The first two fields are typically 16 bits
-wide. The unused field is called `index'; it may be non-zero in
-pointer-to-member-functions, which use the same layout.
-
-The virtual table then is an array of vtable slots. The first slot is
-always the virtual type info function, the other slots are in the order
-in which the virtual functions appear in the class declaration.
-
-If a class has base classes, it may inherit other bases' vfields. Each
-class may have a primary vfield; the primary vfield of the derived class
-is the primary vfield of the left-most non-virtual base class. If a
-class inherits a primary vfield, any new virtual functions in the
-derived class are appended to the virtual table of the primary
-vfield. If there are new virtual functions in the derived class, and no
-primary vfield is inherited, a new vfield is introduced which becomes
-primary. The redefined virtual functions fill the vtable slots inherited
-from the base; new virtual functions are put into the primary vtable in
-the order of declaration. If no new virtual functions are introduced, no
-primary vfield is allocated.
-
-In a base class that has pvbases, virtual tables are needed which are
-used only in the constructor (see example above). At run-time, the
-virtual tables of the base class are adjusted, to reflect the new offset
-of the pvbase. The compiler knows statically what offset the pvbase has
-for a complete object. At run-time, the offset of the pvbase can be
-extracted from the vbase pointer, which is set in the constructor of the
-complete object. These two offsets result in a delta, which is used to
-adjust the deltas in the vtable (the adjustment might be different for
-different vtable slots). To adjust the vtables, the compiler emits code
-that creates a vtable on the stack. This vtable is initialized with the
-vtable for the complete base type, and then adjusted.
-
-In order to call a virtual function, the compiler gets the offset field
-from the vtable entry, and adds it to the this pointer. It then
-indirectly calls the virtual function pointer, passing the adjusted this
-pointer, and any arguments the virtual function may have.
-
-To implement dynamic casting, the dynamic_cast function needs typeinfos
-for the complete type, and the pointer to the complete type. The
-typeinfo pointer is obtained by calling the virtual typeinfo function
-(which doesn't take a this parameter). The pointer to the complete
-object is obtained by adding the offset of the virtual typeinfo vtable
-slot, since this virtual function is always implemented in the complete
-object.
-
-@subsection Specification of thunked vtables
-
-For vtable thunks, each slot only consists of a pointer to the virtual
-function, which might be a thunk function. The first slot in the vtable
-is an offset of the this pointer to the complete object, which is needed
-as a parameter to __dynamic_cast. The second slot is the virtual
-typeinfo function. All other slots are allocated with the same procedure
-as in the non-thunked case. Allocation of vfields also uses the same
-procedure as described above.
-
-If the virtual function needs an adjusted this pointer, a thunk function
-is emitted. If supported by the target architecture, this is only a
-half-function. Such a thunk has no stack frame; it merely adjusts the
-first argument of the function, and then directly branches into the
-implementation of the virtual function. If the architecture does not
-support half-functions (i.e. if ASM_OUTPUT_MI_THUNK is not defined), the
-compiler emits a wrapper function, which copies all arguments, adjust
-the this pointer, and then calls the original function. Since objects of
-non-aggregate type are passed by invisible reference, this copies only
-POD arguments. The approach fails for virtual functions with a variable
-number of arguments.
-
-In order to support the vtables needed in base constructors with
-pvbases, the compiler passes an implicit __vlist argument as described
-above, if the version 2 thunks are used. For version 1 thunks, the base
-class constructor will fill in the vtables for the complete base class,
-which will incorrectly adjust the this pointer, leading to a dynamic
-error.
-
-@node Concept Index, , Vtables, Top
+@node Concept Index, , Mangling, Top
@section Concept Index
diff --git a/contrib/gcc/cp/ptree.c b/contrib/gcc/cp/ptree.c
index 1f17aec..3920c30 100644
--- a/contrib/gcc/cp/ptree.c
+++ b/contrib/gcc/cp/ptree.c
@@ -19,6 +19,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
#include "config.h"
#include "system.h"
@@ -46,17 +48,17 @@ print_lang_decl (file, node, indent)
if (DECL_MAIN_VARIANT (node))
{
fprintf (file, " decl-main-variant ");
- fprintf (file, HOST_PTR_PRINTF, DECL_MAIN_VARIANT (node));
+ fprintf (file, HOST_PTR_PRINTF, (void *) DECL_MAIN_VARIANT (node));
}
if (DECL_PENDING_INLINE_INFO (node))
{
fprintf (file, " pending-inline-info ");
- fprintf (file, HOST_PTR_PRINTF, DECL_PENDING_INLINE_INFO (node));
+ fprintf (file, HOST_PTR_PRINTF, (void *) DECL_PENDING_INLINE_INFO (node));
}
if (DECL_TEMPLATE_INFO (node))
{
fprintf (file, " template-info ");
- fprintf (file, HOST_PTR_PRINTF, DECL_TEMPLATE_INFO (node));
+ fprintf (file, HOST_PTR_PRINTF, (void *) DECL_TEMPLATE_INFO (node));
}
}
diff --git a/contrib/gcc/cp/reno.texi b/contrib/gcc/cp/reno.texi
index 59c3448..d5f254a 100644
--- a/contrib/gcc/cp/reno.texi
+++ b/contrib/gcc/cp/reno.texi
@@ -4,7 +4,7 @@
@ifinfo
@format
START-INFO-DIR-ENTRY
-* Reno 1: (reno-1). The GNU C++ Renovation Project, Phase 1.
+* Reno 1: (reno). The GNU C++ Renovation Project, Phase 1.
END-INFO-DIR-ENTRY
@end format
@end ifinfo
diff --git a/contrib/gcc/dbxout.c b/contrib/gcc/dbxout.c
index bc15a4d..3f561d6 100644
--- a/contrib/gcc/dbxout.c
+++ b/contrib/gcc/dbxout.c
@@ -18,6 +18,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
/* Output dbx-format symbol table data.
This consists of many symbol table entries, each of them
@@ -2687,6 +2689,11 @@ dbxout_begin_function (decl)
{
#ifdef DBX_FUNCTION_FIRST
dbxout_really_begin_function (decl);
+#else
+#ifdef DBX_CHECK_FUNCTION_FIRST
+ if (DBX_CHECK_FUNCTION_FIRST)
+ dbxout_really_begin_function (decl);
+#endif
#endif
}
@@ -2702,6 +2709,11 @@ dbxout_function (decl)
{
#ifndef DBX_FUNCTION_FIRST
dbxout_really_begin_function (decl);
+#else
+#ifdef DBX_CHECK_FUNCTION_FIRST
+ if (!(DBX_CHECK_FUNCTION_FIRST))
+ dbxout_really_begin_function (decl);
+#endif
#endif
dbxout_block (DECL_INITIAL (decl), 0, DECL_ARGUMENTS (decl));
#ifdef DBX_OUTPUT_FUNCTION_END
diff --git a/contrib/gcc/dwarfout.c b/contrib/gcc/dwarfout.c
index 8e0d018..6bdd954 100644
--- a/contrib/gcc/dwarfout.c
+++ b/contrib/gcc/dwarfout.c
@@ -19,6 +19,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
#include "config.h"
#ifdef DWARF_DEBUGGING_INFO
diff --git a/contrib/gcc/extend.texi b/contrib/gcc/extend.texi
index f969f65..b72a02a 100644
--- a/contrib/gcc/extend.texi
+++ b/contrib/gcc/extend.texi
@@ -2,6 +2,8 @@
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
+@c $FreeBSD$
+
@node C Extensions
@chapter Extensions to the C Language Family
@cindex extensions, C language
@@ -1419,8 +1421,9 @@ for consistency with the @code{printf} style format string argument
@code{my_format}.
The parameter @var{archetype} determines how the format string is
-interpreted, and should be either @code{printf}, @code{scanf}, or
-@code{strftime}. The
+interpreted, and should be either @code{printf}, @code{printf0}, @code{scanf},
+or @code{strftime}. @code{printf0} allows the format string to be a null
+pointer, while @code{printf} does not. The
parameter @var{string-index} specifies which argument is the format
string argument (starting from 1), while @var{first-to-check} is the
number of the first argument to check against the format string. For
diff --git a/contrib/gcc/final.c b/contrib/gcc/final.c
index a9ae280..9769409 100644
--- a/contrib/gcc/final.c
+++ b/contrib/gcc/final.c
@@ -18,6 +18,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
/* This is the final pass of the compiler.
It looks at the rtl code for a function and outputs assembler code.
@@ -1640,6 +1642,9 @@ final_start_function (first, file, optimize)
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1701,7 +1706,9 @@ static void
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1711,10 +1718,12 @@ profile_function (file)
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#ifndef NO_PROFILE_DATA
data_section ();
ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
ASM_OUTPUT_INTERNAL_LABEL (file, "LP", profile_label_no);
assemble_integer (const0_rtx, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1806,6 +1815,9 @@ final_end_function (first, file, optimize)
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)
sdbout_end_epilogue ();
diff --git a/contrib/gcc/flags.h b/contrib/gcc/flags.h
index a3cc073..a7c1b7e 100644
--- a/contrib/gcc/flags.h
+++ b/contrib/gcc/flags.h
@@ -18,6 +18,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
/* Name of the input .c file being compiled. */
extern char *main_input_filename;
@@ -137,6 +139,10 @@ extern unsigned larger_than_size;
extern int warn_aggregate_return;
+/* Nonzero means that -Wformat accepts certain non-ANSI formats. */
+
+extern int flag_format_extensions;
+
/* Nonzero if generating code to do profiling. */
extern int profile_flag;
diff --git a/contrib/gcc/function.c b/contrib/gcc/function.c
index 60afafa..e597d33 100644
--- a/contrib/gcc/function.c
+++ b/contrib/gcc/function.c
@@ -18,6 +18,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
/* This file handles the generation of rtl code from tree structure
at the level of the function as a whole.
@@ -6038,12 +6040,19 @@ mark_varargs ()
#define HAS_INIT_SECTION
#endif
+#ifndef GEN_CALL__MAIN
+#define GEN_CALL__MAIN \
+ do { \
+ emit_library_call (gen_rtx (SYMBOL_REF, Pmode, NAME__MAIN), 0, \
+ VOIDmode, 0); \
+ } while (0)
+#endif
+
void
expand_main_function ()
{
-#if !defined (HAS_INIT_SECTION)
- emit_library_call (gen_rtx_SYMBOL_REF (Pmode, NAME__MAIN), 0,
- VOIDmode, 0);
+#if defined(INVOKE__main) || !defined (HAS_INIT_SECTION)
+ GEN_CALL__MAIN;
#endif /* not HAS_INIT_SECTION */
}
@@ -6695,10 +6704,7 @@ void
thread_prologue_and_epilogue_insns (f)
rtx f ATTRIBUTE_UNUSED;
{
- int inserted = 0;
-#ifdef HAVE_prologue
- rtx prologue_end = NULL_RTX;
-#endif
+ int insertted = 0;
prologue = 0;
#ifdef HAVE_prologue
@@ -6715,7 +6721,7 @@ thread_prologue_and_epilogue_insns (f)
seq = get_insns ();
prologue = record_insns (seq);
- prologue_end = emit_note (NULL, NOTE_INSN_PROLOGUE_END);
+ emit_note (NULL, NOTE_INSN_PROLOGUE_END);
seq = gen_sequence ();
end_sequence ();
@@ -6728,7 +6734,7 @@ thread_prologue_and_epilogue_insns (f)
abort ();
insert_insn_on_edge (seq, ENTRY_BLOCK_PTR->succ);
- inserted = 1;
+ insertted = 1;
}
else
emit_insn_after (seq, f);
@@ -6860,56 +6866,8 @@ thread_prologue_and_epilogue_insns (f)
}
#endif
- if (inserted)
+ if (insertted)
commit_edge_insertions ();
-
-#ifdef HAVE_prologue
- if (prologue_end)
- {
- rtx insn, prev;
-
- /* GDB handles `break f' by setting a breakpoint on the first
- line note *after* the prologue. Which means (1) that if
- there are line number notes before where we inserted the
- prologue we should move them, and (2) if there is no such
- note, then we should generate one at the prologue. */
-
- for (insn = prologue_end; insn ; insn = prev)
- {
- prev = PREV_INSN (insn);
- if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
- {
- /* Note that we cannot reorder the first insn in the
- chain, since rest_of_compilation relies on that
- remaining constant. Do the next best thing. */
- if (prev == NULL)
- {
- emit_line_note_after (NOTE_SOURCE_FILE (insn),
- NOTE_LINE_NUMBER (insn),
- prologue_end);
- NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
- }
- else
- reorder_insns (insn, insn, prologue_end);
- }
- }
-
- insn = NEXT_INSN (prologue_end);
- if (! insn || GET_CODE (insn) != NOTE || NOTE_LINE_NUMBER (insn) <= 0)
- {
- for (insn = next_active_insn (f); insn ; insn = PREV_INSN (insn))
- {
- if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
- {
- emit_line_note_after (NOTE_SOURCE_FILE (insn),
- NOTE_LINE_NUMBER (insn),
- prologue_end);
- break;
- }
- }
- }
- }
- #endif
}
/* Reposition the prologue-end and epilogue-begin notes after instruction
diff --git a/contrib/gcc/gcc.1 b/contrib/gcc/gcc.1
index 74200a1..d81841d 100644
--- a/contrib/gcc/gcc.1
+++ b/contrib/gcc/gcc.1
@@ -1,3 +1,4 @@
+.\" $FreeBSD$
.\" Copyright (c) 1991, 1992, 1993, 1994 Free Software Foundation -*-Text-*-
.\" See section COPYING for conditions for redistribution
.\"
@@ -23,7 +24,7 @@
.Id $Id: gcc.1,v 1.9 1998/12/16 20:55:57 law Exp $
.TH GCC 1 "\*(Dt" "GNU Tools" "GNU Tools"
.SH NAME
-gcc, g++ \- GNU project C and C++ Compiler (gcc-2.95)
+gcc, g++ \- GNU project C and C++ Compiler (gcc-2.95.1)
.SH SYNOPSIS
.B gcc
.RI "[ " option " | " filename " ].\|.\|."
@@ -264,6 +265,8 @@ in the following sections.
\-O
\-O2
\-O3
+\-O0
+\-Os
.TP
.B Preprocessor Options
.RI \-A assertion
@@ -444,10 +447,25 @@ in the following sections.
.Sp
.I i386 Options
.br
+\-m386
\-m486
+\-mpentium
+\-mpentiumpro
\-mno\-486
+\-mcpu=\fIcpu type\fP
+\-march=\fIcpu type\fP
\-msoft\-float
+\-mrtd
+\-mregparm
+\-msvr3\-shlib
+\-mno\-ieee\-fp
\-mno\-fp\-ret\-in\-387
+\-mfancy\-math\-387
+\-mno\-wide\-multiply
+\-mdebug\-addr
+\-mno\-move
+\-mprofiler\-epilogue
+\-reg\-alloc=LIST
.Sp
.I HPPA Options
.br
@@ -520,6 +538,16 @@ in the following sections.
\-fverbose\-asm
.ad b
.hy 1
+.SH FreeBSD SPECIFIC OPTIONS
+.TP
+.BI "\-pthread"
+Link a user-threaded process against libc_r instead of libc. Objects linked
+into user-threaded processes should be compiled with -D_THREAD_SAFE.
+.TP
+.BI "\-kthread"
+Link a kernel-threaded process against libpthread in addition to libc.
+Objects linked into kernel-threaded processes should be compiled with
+-D_THREAD_SAFE.
.SH OVERALL OPTIONS
.TP
.BI "\-x " "language"
@@ -1202,13 +1230,17 @@ Like `\|\c
.B \-M\c
\&\|' but the output mentions only the user header files
included with `\|\c
-.B #include "\c
+.B
+#include "\c
.I file\c
+.B
\&"\c
\&\|'. System header files
included with `\|\c
-.B #include <\c
+.B
+#include <\c
.I file\c
+.B
\&>\c
\&\|' are omitted.
.TP
@@ -1485,8 +1517,10 @@ option are searched only for the case of `\|\c
\&"\c
\&\|';
they are not searched for `\|\c
-.B #include <\c
+.B
+#include <\c
.I file\c
+.B
\&>\c
\&\|'.
.Sp
@@ -2000,7 +2034,7 @@ cases where multiple declaration is valid and changes nothing.
.B \-Wnested-externs
Warn if an \c
.B extern\c
-\& declaration is encountered within an function.
+\& declaration is encountered within a function.
.TP
.B \-Wenum\-clash
Warn about conversion between different enumeration types (C++ only).
@@ -2432,6 +2466,12 @@ Optimize yet more. This turns on everything
does, along with also turning on
.B \-finline\-functions.
.TP
+.B \-Os
+Optimize for size. This enables all
+.B \-O2
+optimizations that do not typically increase code size. It also performs
+further optimizations designed to reduce code size.
+.TP
.B \-O0
Do not optimize.
.Sp
@@ -2981,17 +3021,17 @@ exist in SPARClite but not in SPARC v7.
.B \-mcypress
.TP
.B \-msupersparc
-These two options select the processor for which the code is optimised.
+These two options select the processor for which the code is optimized.
.Sp
With
.B \-mcypress
-(the default), the compiler optimises code for the Cypress CY7C602 chip, as
+(the default), the compiler optimizes code for the Cypress CY7C602 chip, as
used in the SparcStation/SparcServer 3xx series. This is also appropriate for
the older SparcStation 1, 2, IPX etc.
.Sp
With
.B \-msupersparc
-the compiler optimises code for the SuperSparc cpu, as used in the SparcStation
+the compiler optimizes code for the SuperSparc cpu, as used in the SparcStation
10, 1000 and 2000 series. This flag also enables use of the full SPARC v8
instruction set.
.PP
@@ -3570,12 +3610,51 @@ assembler files (with a `\|\c
These `\|\c
.B \-m\c
\&\|' options are defined for the Intel 80386 family of computers:
+.TP
.B \-m486
.TP
.B \-mno\-486
Control whether or not code is optimized for a 486 instead of an
386. Code generated for a 486 will run on a 386 and vice versa.
.TP
+.B \-mpentium
+Synonym for
+.B \-mcpu=pentium
+.TP
+.B \-mpentiumpro
+Synonym for
+.B \-mcpu=pentiumpro
+.TP
+.B \-mcpu=\fIcpu type\fP
+Assume the defaults for the machine type CPU TYPE when scheduling instructions.
+The choices for CPU TYPE are:
+.B i386,
+.B i486,
+.B i586
+(pentium),
+.B pentium,
+.B i686
+(pentiumpro), and
+.B pentiumpro.
+While picking a specific CPU TYPE will schedule things appropriately for that
+particular chip, the compiler will not generate any code that does not run on
+the i386 without the
+.B \-march=\fIcpu type\fP
+option being used.
+.TP
+.B \-march=\fIcpu type\fP
+Generate instructions for the machine type CPU TYPE. The choices for CPU TYPE
+are:
+.B i386,
+.B i486,
+.B pentium,
+and
+.B pentiumpro.
+Specifying
+.B \-march=\fIcpu type\fP
+implies
+.B \-mcpu=\fIcpu type\fP.
+.TP
.B \-msoft\-float
Generate output containing library calls for floating point.
.I Warning:
@@ -3606,6 +3685,11 @@ The option `\|\c
.B \-mno-fp-ret-in-387\c
\&\|' causes such values to be returned
in ordinary CPU registers instead.
+.TP
+.B \-mprofiler-epilogue
+.TP
+.B \-mno-profiler-epilogue
+Generate extra code to write profile information for function exits.
.PP
These `\|\c
.B \-m\c
@@ -4141,7 +4225,7 @@ if available, else
.B /tmp\c
\&).
.SH "SEE ALSO"
-cpp(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1).
+as(1), cpp(1), gdb(1), ld(1)
.br
.RB "`\|" gcc "\|', `\|" cpp \|',
.RB "`\|" as "\|', `\|" ld \|',
diff --git a/contrib/gcc/gcc.c b/contrib/gcc/gcc.c
index e570d4b..3128db0 100644
--- a/contrib/gcc/gcc.c
+++ b/contrib/gcc/gcc.c
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA.
This paragraph is here to try to keep Sun CC from dying.
The number of chars here seems crucial!!!! */
+/* $FreeBSD$ */
+
/* This program is the user interface to the C compiler and possibly to
other compilers. It is used because compilation is a complicated procedure
which involves running several programs and passing temporary files between
@@ -2403,6 +2405,13 @@ static int warn_std;
/* Gives value to pass as "warn" to add_prefix for standard prefixes. */
static int *warn_std_ptr = 0;
+#if defined(FREEBSD_NATIVE)
+#include <objformat.h>
+
+typedef enum { OBJFMT_UNKNOWN, OBJFMT_AOUT, OBJFMT_ELF } objf_t;
+
+static objf_t objformat = OBJFMT_UNKNOWN;
+#endif
#if defined(HAVE_OBJECT_SUFFIX) || defined(HAVE_EXECUTABLE_SUFFIX)
@@ -2657,7 +2666,7 @@ process_command (argc, argv)
}
GET_ENV_PATH_LIST (temp, "LIBRARY_PATH");
- if (temp && *cross_compile == '0')
+ if (temp)
{
const char *startp, *endp;
char *nstore = (char *) alloca (strlen (temp) + 3);
@@ -2721,6 +2730,19 @@ process_command (argc, argv)
}
}
+#if defined(FREEBSD_NATIVE)
+ {
+ char buf[64];
+ if (getobjformat (buf, sizeof buf, &argc, argv))
+ if (strcmp (buf, "aout") == 0)
+ objformat = OBJFMT_AOUT;
+ else if (strcmp (buf, "elf") == 0)
+ objformat = OBJFMT_ELF;
+ else
+ fprintf(stderr, "Unrecognized object format: %s\n", buf);
+ }
+#endif
+
/* Convert new-style -- options to old-style. */
translate_options (&argc, &argv);
@@ -3056,6 +3078,22 @@ process_command (argc, argv)
(such as cpp) rather than those of the host system. */
/* Use 2 as fourth arg meaning try just the machine as a suffix,
as well as trying the machine and the version. */
+#ifdef FREEBSD_NATIVE
+ switch (objformat)
+ {
+ case OBJFMT_AOUT:
+ n_switches++; /* add implied -maout */
+ add_prefix (&exec_prefixes, PREFIX"/libexec/aout/", "BINUTILS",
+ 0, 0, NULL_PTR);
+ break;
+ case OBJFMT_ELF:
+ add_prefix (&exec_prefixes, PREFIX"/libexec/elf/", "BINUTILS",
+ 0, 0, NULL_PTR);
+ break;
+ case OBJFMT_UNKNOWN:
+ fatal ("object format unknown");
+ }
+#else /* not FREEBSD_NATIVE */
#ifndef OS2
add_prefix (&exec_prefixes, standard_exec_prefix, "BINUTILS",
0, 2, warn_std_ptr);
@@ -3067,6 +3105,7 @@ process_command (argc, argv)
0, 1, warn_std_ptr);
add_prefix (&startfile_prefixes, standard_exec_prefix_1, "BINUTILS",
0, 1, warn_std_ptr);
+#endif /* FREEBSD_NATIVE */
tooldir_prefix = concat (tooldir_base_prefix, spec_machine,
dir_separator_str, NULL_PTR);
@@ -3101,12 +3140,14 @@ process_command (argc, argv)
dir_separator_str, tooldir_prefix, NULL_PTR);
}
+#ifndef FREEBSD_NATIVE
add_prefix (&exec_prefixes,
concat (tooldir_prefix, "bin", dir_separator_str, NULL_PTR),
"BINUTILS", 0, 0, NULL_PTR);
add_prefix (&startfile_prefixes,
concat (tooldir_prefix, "lib", dir_separator_str, NULL_PTR),
"BINUTILS", 0, 0, NULL_PTR);
+#endif /* FREEBSD_NATIVE */
/* More prefixes are enabled in main, after we read the specs file
and determine whether this is cross-compilation or not. */
@@ -3125,6 +3166,25 @@ process_command (argc, argv)
to the copy in the vector of switches.
Store all the infiles in their vector. */
+#if defined(FREEBSD_NATIVE)
+ switch (objformat)
+ {
+ case OBJFMT_AOUT:
+ switches[n_switches].part1 = "maout";
+ switches[n_switches].args = 0;
+ switches[n_switches].live_cond = 0;
+ switches[n_switches].validated = 0;
+ n_switches++;
+ putenv("OBJFORMAT=aout");
+ break;
+ case OBJFMT_ELF:
+ putenv("OBJFORMAT=elf");
+ break;
+ case OBJFMT_UNKNOWN:
+ fatal ("object format unknown");
+ }
+#endif
+
for (i = 1; i < argc; i++)
{
/* Just skip the switches that were handled by the preceding loop. */
@@ -4605,6 +4665,7 @@ is_directory (path1, path2, linker)
*cp++ = '.';
*cp = '\0';
+#ifndef FREEBSD_NATIVE
/* Exclude directories that the linker is known to search. */
if (linker
&& ((cp - path == 6
@@ -4615,6 +4676,7 @@ is_directory (path1, path2, linker)
dir_separator_str, "lib",
dir_separator_str, ".", NULL_PTR)) == 0)))
return 0;
+#endif /* FREEBSD_NATIVE */
return (stat (path, &st) >= 0 && S_ISDIR (st.st_mode));
}
@@ -4795,9 +4857,13 @@ main (argc, argv)
/* Read specs from a file if there is one. */
+#ifndef FREEBSD_NATIVE
machine_suffix = concat (spec_machine, dir_separator_str,
spec_version, dir_separator_str, NULL_PTR);
just_machine_suffix = concat (spec_machine, dir_separator_str, NULL_PTR);
+#else /* FREEBSD_NATIVE */
+ just_machine_suffix = "";
+#endif /* FREEBSD_NATIVE */
specs_file = find_a_file (&startfile_prefixes, "specs", R_OK);
/* Read the specs file unless it is a default one. */
@@ -4864,6 +4930,7 @@ main (argc, argv)
NULL_PTR, 0, 0, NULL_PTR);
}
+#ifndef FREEBSD_NATIVE
add_prefix (&startfile_prefixes, standard_startfile_prefix_1,
"BINUTILS", 0, 0, NULL_PTR);
add_prefix (&startfile_prefixes, standard_startfile_prefix_2,
@@ -4871,6 +4938,7 @@ main (argc, argv)
#if 0 /* Can cause surprises, and one can use -B./ instead. */
add_prefix (&startfile_prefixes, "./", NULL_PTR, 0, 1, NULL_PTR);
#endif
+#endif /* FREEBSD_NATIVE */
}
else
{
@@ -4996,7 +5064,7 @@ main (argc, argv)
}
if (n_infiles == added_libraries)
- fatal ("No input files");
+ fatal ("No input files specified");
/* Make a place to record the compiler output file names
that correspond to the input files. */
diff --git a/contrib/gcc/ginclude/stdarg.h b/contrib/gcc/ginclude/stdarg.h
index 3607db1..e3842f7 100644
--- a/contrib/gcc/ginclude/stdarg.h
+++ b/contrib/gcc/ginclude/stdarg.h
@@ -3,6 +3,8 @@
actual type **after default promotions**.
Thus, va_arg (..., short) is not valid. */
+/* $FreeBSD$ */
+
#ifndef _STDARG_H
#ifndef _ANSI_STDARG_H_
#ifndef __need___va_list
diff --git a/contrib/gcc/ginclude/stddef.h b/contrib/gcc/ginclude/stddef.h
index 615052e..1109391 100644
--- a/contrib/gcc/ginclude/stddef.h
+++ b/contrib/gcc/ginclude/stddef.h
@@ -1,3 +1,5 @@
+/* $FreeBSD$ */
+
#if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
&& !defined(__STDDEF_H__)) \
|| defined(__need_wchar_t) || defined(__need_size_t) \
diff --git a/contrib/gcc/ginclude/varargs.h b/contrib/gcc/ginclude/varargs.h
index bb9c98a..6519140 100644
--- a/contrib/gcc/ginclude/varargs.h
+++ b/contrib/gcc/ginclude/varargs.h
@@ -1,5 +1,7 @@
/* Record that this is varargs.h; this turns off stdarg.h. */
+/* $FreeBSD$ */
+
#ifndef _VARARGS_H
#define _VARARGS_H
diff --git a/contrib/gcc/invoke.texi b/contrib/gcc/invoke.texi
index b7faa6b..e10a9c6 100644
--- a/contrib/gcc/invoke.texi
+++ b/contrib/gcc/invoke.texi
@@ -2,6 +2,8 @@
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
+@c $FreeBSD$
+
@node Invoking GCC
@chapter GCC Command Options
@cindex GCC command options
@@ -337,9 +339,11 @@ in the following sections.
@emph{i386 Options}
-mcpu=@var{cpu type}
-march=@var{cpu type}
+-m386 -m486 -malign-double
-mieee-fp -mno-fancy-math-387
--mno-fp-ret-in-387 -msoft-float -msvr3-shlib
--mno-wide-multiply -mrtd -malign-double
+-mno-fp-ret-in-387 -mno-ieee-fp
+-mno-wide-multiply -mprofiler-epilogue -mrtd
+-msoft-float -msvr3-shlib
-mreg-alloc=@var{list} -mregparm=@var{num}
-malign-jumps=@var{num} -malign-loops=@var{num}
-malign-functions=@var{num} -mpreferred-stack-boundary=@var{num}
@@ -1186,7 +1190,7 @@ anachronism. Therefore, by default it is invalid to assign to
type @samp{X *}. However, for backwards compatibility, you can make it
valid with @samp{-fthis-is-variable}.
-@item -fvtable-thunks=@var{thunks-version}
+@item -fvtable-thunks
Use @samp{thunks} to implement the virtual function dispatch table
(@samp{vtable}). The traditional (cfront-style) approach to
implementing vtables was to store a pointer to the function and two
@@ -1194,27 +1198,13 @@ offsets for adjusting the @samp{this} pointer at the call site. Newer
implementations store a single pointer to a @samp{thunk} function which
does any necessary adjustment and then calls the target function.
-The original implementation of thunks (version 1) had a bug regarding
-virtual base classes; this bug is fixed with version 2 of the thunks
-implementation. With setting the version to 2, compatibility to the
-version 1 thunks is provided, at the cost of extra machine code. Version
-3 does not include this compatibility.
-
This option also enables a heuristic for controlling emission of
vtables; if a class has any non-inline virtual functions, the vtable
will be emitted in the translation unit containing the first one of
those.
Like all options that change the ABI, all C++ code, @emph{including
-libgcc.a} must be built with the same setting of this option. Since
-version 1 and version 2 are also incompatible (for classes with virtual
-bases defining virtual functions), all code must also be compiled with
-the same version.
-
-On some targets (e.g. Linux/GNU), version 2 thunks are the default. On these
-targets, no option or -fvtable-thunks will produce version 2 thunks. On
-all other targets, not giving the option will use the traditional
-implementation, and -fvtable-thunks will produce version 2 thunks.
+libgcc.a} must be built with the same setting of this option.
@item -nostdinc++
Do not search for header files in the standard directories specific to
@@ -5109,8 +5099,8 @@ specifying @samp{-march=@var{cpu type}} implies @samp{-mcpu=@var{cpu type}}.
Synonyms for -mcpu=i386, -mcpu=i486, -mcpu=pentium, and -mcpu=pentiumpro
respectively. These synonyms are deprecated.
-@item -mieee-fp
-@itemx -mno-ieee-fp
+@item -mno-ieee-fp
+@itemx -mieee-fp
Control whether or not the compiler uses IEEE floating point
comparisons. These handle correctly the case where the result of a
comparison is unordered.
@@ -5169,6 +5159,12 @@ Control whether GCC uses the @code{mul} and @code{imul} that produce
64 bit results in @code{eax:edx} from 32 bit operands to do @code{long
long} multiplies and 32-bit division by constants.
+@item -mprofiler-epilogue
+@itemx -mno-profiler-epilogue
+Generate extra code to write profile information for function exits.
+This option has no effect except in combination with @samp{-g} or
+@samp{-pg}.
+
@item -mrtd
Use a different function-calling convention, in which functions that
take a fixed number of arguments return with the @code{ret} @var{num}
diff --git a/contrib/gcc/libgcc2.c b/contrib/gcc/libgcc2.c
index 6d8fb0b..6618dfe 100644
--- a/contrib/gcc/libgcc2.c
+++ b/contrib/gcc/libgcc2.c
@@ -26,6 +26,8 @@ Boston, MA 02111-1307, USA. */
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License. */
+/* $FreeBSD$ */
+
/* It is incorrect to include config.h here, because this file is being
compiled for the target, and hence definitions concerning only the host
do not apply. */
diff --git a/contrib/gcc/objc/sendmsg.c b/contrib/gcc/objc/sendmsg.c
index 245b8b9..5428122 100644
--- a/contrib/gcc/objc/sendmsg.c
+++ b/contrib/gcc/objc/sendmsg.c
@@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA. */
however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */
+/* $FreeBSD$ */
+
#include "../tconfig.h"
#include "runtime.h"
#include "sarray.h"
diff --git a/contrib/gcc/pexecute.c b/contrib/gcc/pexecute.c
index 6f6a044..cd24f5b 100644
--- a/contrib/gcc/pexecute.c
+++ b/contrib/gcc/pexecute.c
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA. */
/* This file lives in at least two places: libiberty and gcc.
Don't change one without the other. */
+/* $FreeBSD$ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -698,7 +700,7 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
fprintf (stderr, "%s: ", this_pname);
fprintf (stderr, install_error_msg, program);
fprintf (stderr, ": %s\n", xstrerror (errno));
- exit (-1);
+ _exit (1);
/* NOTREACHED */
return 0;
diff --git a/contrib/gcc/print-tree.c b/contrib/gcc/print-tree.c
index 18ec929..7b29454 100644
--- a/contrib/gcc/print-tree.c
+++ b/contrib/gcc/print-tree.c
@@ -18,6 +18,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
#include "config.h"
#include "system.h"
diff --git a/contrib/gcc/reload.c b/contrib/gcc/reload.c
index d8b4136..7be6edc 100644
--- a/contrib/gcc/reload.c
+++ b/contrib/gcc/reload.c
@@ -18,6 +18,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
/* This file contains subroutines used only from the file reload1.c.
It knows how to scan one insn for operands and values
diff --git a/contrib/gcc/toplev.c b/contrib/gcc/toplev.c
index 9dac1fd..217305a 100644
--- a/contrib/gcc/toplev.c
+++ b/contrib/gcc/toplev.c
@@ -1,5 +1,5 @@
/* Top level of GNU C compiler
- Copyright (C) 1987, 88, 89, 92-98, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 89, 92-99, 2000 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -18,6 +18,8 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* $FreeBSD$ */
+
/* This is the top level of cc1/c++.
It parses command args, opens files, invokes the various passes
in the proper order, and counts the time used by each.
@@ -734,6 +736,9 @@ int flag_gnu_linker = 1;
/* Tag all structures with __attribute__(packed) */
int flag_pack_struct = 0;
+/* Nonzero means that -Wformat accepts certain system-dependent formats. */
+int flag_format_extensions = 0;
+
/* Emit code to check for stack overflow; also may cause large objects
to be allocated dynamically. */
int flag_stack_check;
@@ -957,6 +962,8 @@ lang_independent_options f_options[] =
"Do the full regmove optimization pass"},
{"pack-struct", &flag_pack_struct, 1,
"Pack structure members together without holes" },
+ {"format-extensions", &flag_format_extensions, 1,
+ "-Wformat accepts certain FreeBSD system-dependent formats" },
{"stack-check", &flag_stack_check, 1,
"Insert stack checking code into the program" },
{"argument-alias", &flag_argument_noalias, 0,
@@ -3870,13 +3877,15 @@ rest_of_compilation (decl)
TIMEVAR (cse_time, tem = cse_main (insns, max_reg_num (),
0, rtl_dump_file));
- TIMEVAR (cse_time, delete_trivially_dead_insns (insns, max_reg_num ()));
-
if (tem || optimize > 1)
TIMEVAR (jump_time, jump_optimize (insns, !JUMP_CROSS_JUMP,
!JUMP_NOOP_MOVES,
!JUMP_AFTER_REGSCAN));
+ /* Run this after jump optmizations remove all the unreachable code
+ so that unreachable code will not keep values live. */
+ TIMEVAR (cse_time, delete_trivially_dead_insns (insns, max_reg_num ()));
+
/* Dump rtl code after cse, if we are doing that. */
if (cse_dump)
@@ -4834,6 +4843,19 @@ main (argc, argv)
if (optimize_val != -1)
{
optimize = optimize_val;
+#ifdef __alpha__
+ if (optimize > 1)
+ {
+ #ifdef FORCE_OPTIMIZATION_DOWNGRADE
+ optimize = 1;
+ warning ("\n***\n***\t-O%d converted to \"-O1\" due to optimizer bugs on this platform\n***\n",
+ optimize_val);
+ #else
+ warning ("\n***\n***\tThe -O%d flag TRIGGERS KNOWN OPTIMIZER BUGS ON THIS PLATFORM\n***\n",
+ optimize_val);
+ #endif
+ }
+#endif
optimize_size = 0;
}
}
OpenPOWER on IntegriCloud