aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-14 17:10:31 +0000
committer(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-14 17:10:31 +0000
commitfdfe20b8a40e423ff3ae504ae92e008575c5e64e (patch)
tree021f951e97c32892b15a417f20dbbfbdb388fec2
parent473416c48238ecfaa0c79d8bc9bec8e6e37c54cc (diff)
This commit was manufactured by cvs2svn to create tagbefore-merge-HEAD-csl-sol210-1
'before-merge-HEAD-csl-sol210-1'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/before-merge-HEAD-csl-sol210-1@84694 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog48
-rw-r--r--gcc/c-format.c77
-rw-r--r--gcc/config.gcc10
-rw-r--r--gcc/config/i386/i386.c39
-rw-r--r--gcc/config/i386/scodbx.h84
-rw-r--r--gcc/config/i386/sol2-10-protos.h25
-rw-r--r--gcc/config/i386/sol2-10.h74
-rw-r--r--gcc/config/i386/sol2-c.c299
-rw-r--r--gcc/config/i386/sol2.h7
-rw-r--r--gcc/config/i386/t-sol2-106
-rw-r--r--gcc/config/i386/xm-dgux.h4
-rw-r--r--gcc/config/i386/xm-sun.h21
-rw-r--r--gcc/config/i386/xm-sysv3.h3
-rw-r--r--gcc/doc/extend.texi40
-rw-r--r--gcc/testsuite/ChangeLog10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb42.C19
-rw-r--r--gcc/testsuite/gcc.dg/format/cmn-err-1.c36
-rw-r--r--gcc/testsuite/gcc.dg/pragma-align-2.c54
-rw-r--r--gcc/testsuite/gcc.dg/pragma-align.c3
-rw-r--r--gcc/testsuite/gcc.dg/pragma-init-fini.c50
20 files changed, 762 insertions, 147 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 15bf4adc016..1745c7342f6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,51 @@
+2004-07-14 Daniel Jacobowitz <dan@debian.org>
+
+ * c-format.c (enum format_type): Add cmn_err_format_type.
+ (format_char_info): Document "b" flag.
+ (cmn_err_length_specs, cmn_err_flag_specs, cmn_err_flag_pairs)
+ (cmn_err_char_table): New.
+ (format_types_orig): Add cmn_err item.
+ (check_format_info_main): Handle 'b' in flags2.
+ * doc/extend.texi: Document cmn_err format type.
+
+2004-07-14 Daniel Jacobowitz <dan@debian.org>
+
+ * config/i386/i386.c (override_options): Move
+ SUBTARGET_OVERRIDE_OPTIONS before defaulting flag_omit_frame_pointer.
+ * config/i386/sol2-10.h (SUBTARGET_OVERRIDE_OPTIONS): Define.
+ (TARGET_SUBTARGET_DEFAULT): Define.
+
+2004-07-13 Daniel Jacobowitz <dan@debian.org>
+
+ * config/i386/sol2-10.h: Call the target "Solaris 10".
+
+2004-07-13 Daniel Jacobowitz <dan@debian.org>
+
+ * config.gcc (i[34567]86-*-solaris2.1[0-9]): Set tm_p_file,
+ tmake_file, c_target_objs, and cxx_target_objs.
+ * config/i386/i386.c (TARGET_INSERT_ATTRIBUTES): Define to
+ SUBTARGET_INSERT_ATTRIBUTES.
+ (ix86_attribute_table): Include "init" and "fini" if
+ TARGET_INIT_FINI_ATTRIBUTES.
+ * config/i386/sol2-10.h (SUBTARGET_INSERT_ATTRIBUTES)
+ (REGISTER_TARGET_PRAGMAS, ASM_DECLARE_FUNCTION_SIZE)
+ (TARGET_INIT_FINI_ATTRIBUTES): Define.
+ * config/i386/sol2-10-protos.h: New file.
+ * config/i386/sol2-c.c: New file.
+ * config/i386/t-sol2-10: New file.
+ * doc/extend.texi (Solaris Pragmas): New section.
+
+2004-07-12 Daniel Jacobowitz <dan@debian.org>
+
+ * config.gcc (i[34567]86-*-solaris2*): Handle Solaris 2.10.
+ * config/i386/sol2-10.h: New file.
+ * config/i386/sol2.h (ASM_QUAD): Don't undefine for biarch targets.
+
+2004-07-10 Daniel Jacobowitz <dan@debian.org>
+
+ * config/i386/i386.c (override_options): Pick a 64-bit CPU
+ for the default tuning if TARGET_64BIT.
+
2004-07-06 Jan Beulich <jbeulich@novell.com>
* varasm.c (asm_output_bss): Don't declare unless BSS_SECTION_ASM_OP.
diff --git a/gcc/c-format.c b/gcc/c-format.c
index 98274ee649d..69f70b8393f 100644
--- a/gcc/c-format.c
+++ b/gcc/c-format.c
@@ -59,7 +59,8 @@ enum format_type { printf_format_type, asm_fprintf_format_type,
gcc_diag_format_type, gcc_cdiag_format_type,
gcc_cxxdiag_format_type,
scanf_format_type, strftime_format_type,
- strfmon_format_type, format_type_error };
+ strfmon_format_type, cmn_err_format_type,
+ format_type_error };
typedef struct function_format_info
{
@@ -373,7 +374,8 @@ typedef struct
"W" if the argument is a pointer which is dereferenced and written into,
"R" if the argument is a pointer which is dereferenced and read from,
"i" for printf integer formats where the '0' flag is ignored with
- precision, and "[" for the starting character of a scanf scanset. */
+ precision, "[" for the starting character of a scanf scanset, and
+ "b" for the cmn_err "b" conversion. */
const char *flags2;
} format_char_info;
@@ -558,6 +560,13 @@ static const format_length_info strfmon_length_specs[] =
{ NULL, 0, 0, NULL, 0, 0 }
};
+/* cmn_err only accepts "l" and "ll". */
+static const format_length_info cmn_err_length_specs[] =
+{
+ { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C89 },
+ { NULL, 0, 0, NULL, 0, 0 }
+};
+
static const format_flag_spec printf_flag_specs[] =
{
{ ' ', 0, 0, N_("` ' flag"), N_("the ` ' printf flag"), STD_C89 },
@@ -698,6 +707,19 @@ static const format_flag_pair strfmon_flag_pairs[] =
};
+static const format_flag_spec cmn_err_flag_specs[] =
+{
+ { 'w', 0, 0, N_("field width"), N_("field width in printf format"), STD_C89 },
+ { 'L', 0, 0, N_("length modifier"), N_("length modifier in printf format"), STD_C89 },
+ { 0, 0, 0, NULL, NULL, 0 }
+};
+
+
+static const format_flag_pair cmn_err_flag_pairs[] =
+{
+ { 0, 0, 0, 0 }
+};
+
#define T_I &integer_type_node
#define T89_I { STD_C89, NULL, T_I }
#define T_L &long_integer_type_node
@@ -920,6 +942,18 @@ static const format_char_info monetary_char_table[] =
{ NULL, 0, 0, NOLENGTHS, NULL, NULL }
};
+static const format_char_info cmn_err_char_table[] =
+{
+ /* C89 conversion specifiers. */
+ { "dD", 0, STD_C89, { T89_I, BADLEN, BADLEN, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "" },
+ { "oOxX",0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "" },
+ { "u", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "" },
+ { "c", 0, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "" },
+ { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "cR" },
+ { "b", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "w", "cRb" },
+ { NULL, 0, 0, NOLENGTHS, NULL, NULL }
+};
+
/* This must be in the same order as enum format_type. */
static const format_kind_info format_types_orig[] =
@@ -969,7 +1003,13 @@ static const format_kind_info format_types_orig[] =
strfmon_flag_specs, strfmon_flag_pairs,
FMT_FLAG_ARG_CONVERT, 'w', '#', 'p', 0, 'L',
NULL, NULL
- }
+ },
+ { "cmn_err", cmn_err_length_specs, cmn_err_char_table, "", NULL,
+ cmn_err_flag_specs, cmn_err_flag_pairs,
+ FMT_FLAG_ARG_CONVERT|FMT_FLAG_EMPTY_PREC_OK,
+ 'w', 0, 0, 0, 'L',
+ &integer_type_node, &integer_type_node
+ },
};
/* This layer of indirection allows GCC to reassign format_types with
@@ -1660,6 +1700,7 @@ check_format_info_main (format_check_results *res,
const char *wanted_type_name;
format_wanted_type width_wanted_type;
format_wanted_type precision_wanted_type;
+ format_wanted_type bitfield_wanted_type;
format_wanted_type main_wanted_type;
format_wanted_type *first_wanted_type = NULL;
format_wanted_type *last_wanted_type = NULL;
@@ -2188,6 +2229,36 @@ check_format_info_main (format_check_results *res,
}
}
+ /* Handle cmn_err %b, which takes two arguments. */
+ if (strchr (fci->flags2, 'b') != NULL)
+ {
+ ++arg_num;
+
+ if (params == 0)
+ {
+ warning ("too few arguments for format");
+ return;
+ }
+
+ bitfield_wanted_type.wanted_type = integer_type_node;
+ bitfield_wanted_type.wanted_type_name = NULL;
+ bitfield_wanted_type.pointer_count = 0;
+ bitfield_wanted_type.char_lenient_flag = 0;
+ bitfield_wanted_type.writing_in_flag = 0;
+ bitfield_wanted_type.reading_from_flag = 0;
+ bitfield_wanted_type.name = NULL;
+ bitfield_wanted_type.param = TREE_VALUE (params);
+ bitfield_wanted_type.arg_num = arg_num;
+ bitfield_wanted_type.next = NULL;
+ if (last_wanted_type != 0)
+ last_wanted_type->next = &bitfield_wanted_type;
+ if (first_wanted_type == 0)
+ first_wanted_type = &bitfield_wanted_type;
+ last_wanted_type = &bitfield_wanted_type;
+
+ params = TREE_CHAIN (params);
+ }
+
/* Finally. . .check type of argument against desired type! */
if (info->first_arg_num == 0)
continue;
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 9bbda81f8d4..f30511e9958 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -983,6 +983,16 @@ i[34567]86-*-solaris2*)
tm_file="$tm_file tm-dwarf2.h"
;;
esac
+ case ${target} in
+ *-*-solaris2.1[0-9])
+ tm_file="${tm_file} i386/x86-64.h i386/sol2-10.h"
+ tm_p_file="${tm_p_file} i386/sol2-10-protos.h"
+ tm_defines="${tm_defines} TARGET_BI_ARCH=1"
+ tmake_file="${tmake_file} i386/t-sol2-10"
+ c_target_objs="sol2-c.o"
+ cxx_target_objs="sol2-c.o"
+ ;;
+ esac
extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
case ${enable_threads}:${have_pthread_h}:${have_thread_h} in
no:*:*) ;;
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index b51586f7151..2d1a923468e 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1075,6 +1075,11 @@ static void init_ext_80387_constants (void);
#undef TARGET_GIMPLIFY_VA_ARG_EXPR
#define TARGET_GIMPLIFY_VA_ARG_EXPR ix86_gimplify_va_arg
+#ifdef SUBTARGET_INSERT_ATTRIBUTES
+#undef TARGET_INSERT_ATTRIBUTES
+#define TARGET_INSERT_ATTRIBUTES SUBTARGET_INSERT_ATTRIBUTES
+#endif
+
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -1097,6 +1102,8 @@ void
override_options (void)
{
int i;
+ int ix86_tune_defaulted = 0;
+
/* Comes from final.c -- no real reason to change it. */
#define MAX_CODE_ALIGN 16
@@ -1193,6 +1200,10 @@ override_options (void)
int const pta_size = ARRAY_SIZE (processor_alias_table);
+#ifdef SUBTARGET_OVERRIDE_OPTIONS
+ SUBTARGET_OVERRIDE_OPTIONS;
+#endif
+
/* Set the default values for switches whose default depends on TARGET_64BIT
in case they weren't overwritten by command line options. */
if (TARGET_64BIT)
@@ -1214,14 +1225,13 @@ override_options (void)
flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
}
-#ifdef SUBTARGET_OVERRIDE_OPTIONS
- SUBTARGET_OVERRIDE_OPTIONS;
-#endif
-
if (!ix86_tune_string && ix86_arch_string)
ix86_tune_string = ix86_arch_string;
if (!ix86_tune_string)
- ix86_tune_string = cpu_names [TARGET_CPU_DEFAULT];
+ {
+ ix86_tune_string = cpu_names [TARGET_CPU_DEFAULT];
+ ix86_tune_defaulted = 1;
+ }
if (!ix86_arch_string)
ix86_arch_string = TARGET_64BIT ? "x86-64" : "i386";
@@ -1305,7 +1315,20 @@ override_options (void)
{
ix86_tune = processor_alias_table[i].processor;
if (TARGET_64BIT && !(processor_alias_table[i].flags & PTA_64BIT))
- error ("CPU you selected does not support x86-64 instruction set");
+ {
+ if (ix86_tune_defaulted)
+ {
+ ix86_tune_string = "x86-64";
+ for (i = 0; i < pta_size; i++)
+ if (! strcmp (ix86_tune_string,
+ processor_alias_table[i].name))
+ break;
+ ix86_tune = processor_alias_table[i].processor;
+ }
+ else
+ error ("CPU you selected does not support x86-64 "
+ "instruction set");
+ }
break;
}
if (i == pta_size)
@@ -1580,6 +1603,10 @@ const struct attribute_spec ix86_attribute_table[] =
#endif
{ "ms_struct", 0, 0, false, false, false, ix86_handle_struct_attribute },
{ "gcc_struct", 0, 0, false, false, false, ix86_handle_struct_attribute },
+#ifdef TARGET_INIT_FINI_ATTRIBUTES
+ { "init", 0, 0, true, false, false, NULL },
+ { "fini", 0, 0, true, false, false, NULL },
+#endif
{ NULL, 0, 0, false, false, false, NULL }
};
diff --git a/gcc/config/i386/scodbx.h b/gcc/config/i386/scodbx.h
deleted file mode 100644
index 7da93053256..00000000000
--- a/gcc/config/i386/scodbx.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Definitions for Intel 386 running SCO Unix System V,
- using dbx-in-coff encapsulation.
- Copyright (C) 1992, 1995, 1996, 1999 Free Software Foundation, Inc.
-
-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. */
-
-#include "i386/svr3dbx.h"
-
-/* Overridden defines for SCO systems from sco.h. */
-
-/* By default, target has a 80387, uses IEEE compatible arithmetic,
- and returns float values in the 387, ie,
- (TARGET_80387 | TARGET_FLOAT_RETURNS_IN_80387)
-
- SCO's software emulation of a 387 fails to handle the `fucomp'
- opcode. fucomp is only used when generating IEEE compliant code.
- So don't make TARGET_IEEE_FP default for SCO. */
-
-#undef TARGET_SUBTARGET_DEFAULT
-#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_FLOAT_RETURNS)
-
-/* Use crt1.o as a startup file and crtn.o as a closing file. */
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
- "%{!r:%{!z:svr3.ifile%s}%{z:svr3z.ifile%s}}\
- %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}"
-
-/* Library spec, including SCO international language support. */
-
-#undef LIB_SPEC
-#define LIB_SPEC \
- "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} %{scointl:libintl.a%s} -lc"
-
-/* Specify predefined symbols in preprocessor. */
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dunix -DM_UNIX -DM_I386 -DM_COFF -DM_WORDSWAP -Asystem=svr3"
-
-#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %{scointl:-DM_INTERNAT}"
-
-/* This spec is used for telling cpp whether char is signed or not. */
-
-#undef SIGNED_CHAR_SPEC
-#if DEFAULT_SIGNED_CHAR
-#define SIGNED_CHAR_SPEC \
- "%{funsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}"
-#else
-#define SIGNED_CHAR_SPEC \
- "%{!fsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}"
-#endif
-
-/* caller has to pop the extra argument passed to functions that return
- structures. */
-
-#undef RETURN_POPS_ARGS
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
- ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \
- : (TARGET_RTD \
- && (TYPE_ARG_TYPES (FUNTYPE) == 0 \
- || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \
- == void_type_node))) ? (SIZE) \
- : 0)
-/* On other 386 systems, the last line looks like this:
- : (aggregate_value_p (TREE_TYPE (FUNTYPE))) ? GET_MODE_SIZE (Pmode) : 0) */
-
-/* Handle #pragma pack. */
-#define HANDLE_SYSV_PRAGMA
diff --git a/gcc/config/i386/sol2-10-protos.h b/gcc/config/i386/sol2-10-protos.h
new file mode 100644
index 00000000000..c26b71ba82b
--- /dev/null
+++ b/gcc/config/i386/sol2-10-protos.h
@@ -0,0 +1,25 @@
+/* Prototypes.
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+extern void solaris_insert_attributes (tree, tree *);
+extern void solaris_pragma_align (struct cpp_reader *);
+extern void solaris_pragma_init (struct cpp_reader *);
+extern void solaris_pragma_fini (struct cpp_reader *);
+extern void solaris_output_init_fini (FILE *, tree);
diff --git a/gcc/config/i386/sol2-10.h b/gcc/config/i386/sol2-10.h
new file mode 100644
index 00000000000..878035bd97d
--- /dev/null
+++ b/gcc/config/i386/sol2-10.h
@@ -0,0 +1,74 @@
+/* Solaris 10 configuration.
+ Copyright (C) 2004 Free Software Foundation, Inc.
+ Contributed by CodeSourcery, LLC.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#undef ASM_COMMENT_START
+#define ASM_COMMENT_START "/"
+
+#undef ASM_SPEC
+#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} " \
+ "%{Wa,*:%*} %{m32:--32} %{m64:--64} -s %(asm_cpu)"
+
+#undef NO_PROFILE_COUNTERS
+
+#undef MCOUNT_NAME
+#define MCOUNT_NAME "_mcount"
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int")
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+#define SUBTARGET_INSERT_ATTRIBUTES solaris_insert_attributes
+
+#define REGISTER_TARGET_PRAGMAS() \
+ do { \
+ c_register_pragma (0, "align", solaris_pragma_align); \
+ c_register_pragma (0, "init", solaris_pragma_init); \
+ c_register_pragma (0, "fini", solaris_pragma_fini); \
+ } 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) \
+ ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
+ solaris_output_init_fini (FILE, DECL); \
+ } \
+ while (0)
+
+#define TARGET_INIT_FINI_ATTRIBUTES
+
+#define SUBTARGET_OVERRIDE_OPTIONS \
+ do \
+ { \
+ if (flag_omit_frame_pointer == 2) \
+ flag_omit_frame_pointer = 0; \
+ if (flag_asynchronous_unwind_tables == 2) \
+ flag_asynchronous_unwind_tables = 0; \
+ } \
+ while (0)
+
+#undef TARGET_SUBTARGET_DEFAULT
+#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP \
+ | MASK_FLOAT_RETURNS \
+ | MASK_OMIT_LEAF_FRAME_POINTER)
diff --git a/gcc/config/i386/sol2-c.c b/gcc/config/i386/sol2-c.c
new file mode 100644
index 00000000000..624556c9ab9
--- /dev/null
+++ b/gcc/config/i386/sol2-c.c
@@ -0,0 +1,299 @@
+/* Solaris support needed only by C/C++ frontends.
+ Copyright (C) 2004 Free Software Foundation, Inc.
+ Contributed by CodeSourcery, LLC.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "cpplib.h"
+#include "tree.h"
+#include "c-pragma.h"
+#include "c-tree.h"
+#include "c-incpath.h"
+#include "toplev.h"
+#include "tm_p.h"
+
+static GTY(()) tree pending_aligns, pending_inits, pending_finis;
+
+/* Handle #pragma align ALIGNMENT (VAR [, VAR]...) */
+
+void
+solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED)
+{
+ tree t, x;
+ enum cpp_ttype ttype;
+ HOST_WIDE_INT low;
+
+ if (c_lex (&x) != CPP_NUMBER
+ || c_lex (&t) != CPP_OPEN_PAREN)
+ {
+ warning ("malformed %<#pragma align%>, ignoring");
+ return;
+ }
+
+ low = TREE_INT_CST_LOW (x);
+ if (TREE_INT_CST_HIGH (x) != 0
+ || (low != 1 && low != 2 && low != 4 && low != 8 && low != 16
+ && low != 32 && low != 64 && low != 128))
+ {
+ warning ("invalid alignment for %<#pragma align%>, ignoring");
+ return;
+ }
+
+ ttype = c_lex (&t);
+ if (ttype != CPP_NAME)
+ {
+ warning ("malformed %<#pragma align%>, ignoring");
+ return;
+ }
+
+ while (1)
+ {
+ tree decl = identifier_global_value (t);
+ if (decl && TREE_CODE_CLASS (TREE_CODE (decl)) == 'd')
+ warning ("%<#pragma align%> must appear before the declaration of "
+ "%D, ignoring", decl);
+ else
+ pending_aligns = tree_cons (t, build_tree_list (NULL, x),
+ pending_aligns);
+
+ ttype = c_lex (&t);
+ if (ttype == CPP_COMMA)
+ {
+ ttype = c_lex (&t);
+ if (ttype != CPP_NAME)
+ {
+ warning ("malformed %<#pragma align%>");
+ return;
+ }
+ }
+ else if (ttype == CPP_CLOSE_PAREN)
+ {
+ if (c_lex (&t) != CPP_EOF)
+ warning ("junk at end of %<#pragma align%>");
+ return;
+ }
+ else
+ {
+ warning ("malformed %<#pragma align%>");
+ return;
+ }
+ }
+}
+
+/* Handle #pragma init (function [, function]...) */
+
+void
+solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED)
+{
+ tree t;
+ enum cpp_ttype ttype;
+
+ if (c_lex (&t) != CPP_OPEN_PAREN)
+ {
+ warning ("malformed %<#pragma init%>, ignoring");
+ return;
+ }
+
+ ttype = c_lex (&t);
+ if (ttype != CPP_NAME)
+ {
+ warning ("malformed %<#pragma init%>, ignoring");
+ return;
+ }
+
+ while (1)
+ {
+ tree decl = identifier_global_value (t);
+ if (decl && TREE_CODE_CLASS (TREE_CODE (decl)) == 'd')
+ {
+ tree init_list = build_tree_list (get_identifier ("init"),
+ NULL);
+ tree attrs = tree_cons (get_identifier ("used"), NULL, init_list);
+ decl_attributes (&decl, attrs, 0);
+ }
+ else
+ pending_inits = tree_cons (t, NULL, pending_inits);
+
+ ttype = c_lex (&t);
+ if (ttype == CPP_COMMA)
+ {
+ ttype = c_lex (&t);
+ if (ttype != CPP_NAME)
+ {
+ warning ("malformed %<#pragma init%>");
+ return;
+ }
+ }
+ else if (ttype == CPP_CLOSE_PAREN)
+ {
+ if (c_lex (&t) != CPP_EOF)
+ warning ("junk at end of %<#pragma init%>");
+ return;
+ }
+ else
+ {
+ warning ("malformed %<#pragma init%>");
+ return;
+ }
+ }
+}
+
+/* Handle #pragma fini (function [, function]...) */
+
+void
+solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED)
+{
+ tree t;
+ enum cpp_ttype ttype;
+
+ if (c_lex (&t) != CPP_OPEN_PAREN)
+ {
+ warning ("malformed %<#pragma fini%>, ignoring");
+ return;
+ }
+
+ ttype = c_lex (&t);
+ if (ttype != CPP_NAME)
+ {
+ warning ("malformed %<#pragma fini%>, ignoring");
+ return;
+ }
+
+ while (1)
+ {
+ tree decl = identifier_global_value (t);
+ if (decl && TREE_CODE_CLASS (TREE_CODE (decl)) == 'd')
+ {
+ tree fini_list = build_tree_list (get_identifier ("fini"),
+ NULL);
+ tree attrs = tree_cons (get_identifier ("used"), NULL, fini_list);
+ decl_attributes (&decl, attrs, 0);
+ }
+ else
+ pending_finis = tree_cons (t, NULL, pending_finis);
+
+ ttype = c_lex (&t);
+ if (ttype == CPP_COMMA)
+ {
+ ttype = c_lex (&t);
+ if (ttype != CPP_NAME)
+ {
+ warning ("malformed %<#pragma fini%>");
+ return;
+ }
+ }
+ else if (ttype == CPP_CLOSE_PAREN)
+ {
+ if (c_lex (&t) != CPP_EOF)
+ warning ("junk at end of %<#pragma fini%>");
+ return;
+ }
+ else
+ {
+ warning ("malformed %<#pragma fini%>");
+ return;
+ }
+ }
+}
+
+/* Attach any pending attributes for DECL to the list in *ATTRIBUTES. */
+
+void
+solaris_insert_attributes (tree decl, tree *attributes)
+{
+ tree *x, next;
+
+ if (pending_aligns != NULL && TREE_CODE (decl) == VAR_DECL)
+ for (x = &pending_aligns; *x; x = &TREE_CHAIN (pending_aligns))
+ {
+ tree name = TREE_PURPOSE (*x);
+ tree value = TREE_VALUE (*x);
+ if (DECL_NAME (decl) == name)
+ {
+ if (lookup_attribute ("aligned", DECL_ATTRIBUTES (decl))
+ || lookup_attribute ("aligned", *attributes))
+ warning ("%Jignoring %<#pragma align%> for explicitly "
+ "aligned %<%D%>", decl, decl);
+ else
+ *attributes = tree_cons (get_identifier ("aligned"), value,
+ *attributes);
+ next = TREE_CHAIN (*x);
+ ggc_free (*x);
+ *x = next;
+ break;
+ }
+ }
+
+ if (pending_inits != NULL && TREE_CODE (decl) == FUNCTION_DECL)
+ for (x = &pending_inits; *x; x = &TREE_CHAIN (pending_inits))
+ {
+ tree name = TREE_PURPOSE (*x);
+ if (DECL_NAME (decl) == name)
+ {
+ *attributes = tree_cons (get_identifier ("init"), NULL,
+ *attributes);
+ *attributes = tree_cons (get_identifier ("used"), NULL,
+ *attributes);
+ next = TREE_CHAIN (*x);
+ ggc_free (*x);
+ *x = next;
+ break;
+ }
+ }
+
+ if (pending_finis != NULL && TREE_CODE (decl) == FUNCTION_DECL)
+ for (x = &pending_finis; *x; x = &TREE_CHAIN (pending_finis))
+ {
+ tree name = TREE_PURPOSE (*x);
+ if (DECL_NAME (decl) == name)
+ {
+ *attributes = tree_cons (get_identifier ("fini"), NULL,
+ *attributes);
+ *attributes = tree_cons (get_identifier ("used"), NULL,
+ *attributes);
+ next = TREE_CHAIN (*x);
+ ggc_free (*x);
+ *x = next;
+ break;
+ }
+ }
+}
+
+/* Output initializer or finalizer entries for DECL to FILE. */
+
+void
+solaris_output_init_fini (FILE *file, tree decl)
+{
+ if (lookup_attribute ("init", DECL_ATTRIBUTES (decl)))
+ {
+ fprintf (file, "\t.section\t.init\n");
+ fprintf (file, "\tcall\t%s\n", IDENTIFIER_POINTER (DECL_NAME (decl)));
+ fprintf (file, "\t.popsection\n");
+ }
+
+ if (lookup_attribute ("fini", DECL_ATTRIBUTES (decl)))
+ {
+ fprintf (file, "\t.section\t.fini\n");
+ fprintf (file, "\tcall\t%s\n", IDENTIFIER_POINTER (DECL_NAME (decl)));
+ fprintf (file, "\t.popsection\n");
+ }
+}
diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h
index 78b2985cb7a..6d0c52c8c61 100644
--- a/gcc/config/i386/sol2.h
+++ b/gcc/config/i386/sol2.h
@@ -1,5 +1,6 @@
/* Target definitions for GCC for Intel 80386 running Solaris 2
- Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+ 2004
Free Software Foundation, Inc.
Contributed by Fred Fish (fnf@cygnus.com).
@@ -62,8 +63,10 @@ Boston, MA 02111-1307, USA. */
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
-/* The Solaris assembler does not support .quad. Do not use it. */
+/* The 32-bit Solaris assembler does not support .quad. Do not use it. */
+#ifndef TARGET_BI_ARCH
#undef ASM_QUAD
+#endif
/* The Solaris assembler wants a .local for non-exported aliases. */
#define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET) \
diff --git a/gcc/config/i386/t-sol2-10 b/gcc/config/i386/t-sol2-10
new file mode 100644
index 00000000000..3f29b099e1c
--- /dev/null
+++ b/gcc/config/i386/t-sol2-10
@@ -0,0 +1,6 @@
+# Solaris-specific pragmas
+sol2-c.o: $(srcdir)/config/i386/sol2-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(CPPLIB_H) tree.h c-pragma.h $(C_TREE_H) toplev.h $(TM_P_H) \
+ c-incpath.h
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+ $(srcdir)/config/i386/sol2-c.c
diff --git a/gcc/config/i386/xm-dgux.h b/gcc/config/i386/xm-dgux.h
deleted file mode 100644
index 881c5c7be9d..00000000000
--- a/gcc/config/i386/xm-dgux.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* Configuration for GCC for Intel i386 running DG/ux */
-
-/* looks just like sysv4 for now */
-#include "xm-svr4.h"
diff --git a/gcc/config/i386/xm-sun.h b/gcc/config/i386/xm-sun.h
deleted file mode 100644
index 6c0f0a25630..00000000000
--- a/gcc/config/i386/xm-sun.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Configuration for GNU C-compiler for Intel 80386 running SunOS 4.0.
- Copyright (C) 1988, 1997 Free Software Foundation, Inc.
-
-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. */
-
-#define USG
diff --git a/gcc/config/i386/xm-sysv3.h b/gcc/config/i386/xm-sysv3.h
deleted file mode 100644
index 9a655443ff5..00000000000
--- a/gcc/config/i386/xm-sysv3.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* Configuration for GCC for Intel i386 running System V Release 3. */
-
-#include "xm-svr3.h"
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 4f9b9d922be..e552a914ea0 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2124,9 +2124,10 @@ 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 @code{printf}, @code{scanf}, @code{strftime}
-or @code{strfmon}. (You can also use @code{__printf__},
-@code{__scanf__}, @code{__strftime__} or @code{__strfmon__}.) The
+interpreted, and should be @code{printf}, @code{scanf}, @code{strftime},
+@code{strfmon} or @code{cmn_err}. (You can also use @code{__printf__},
+@code{__scanf__}, @code{__strftime__}, @code{__strfmon__} or
+@code{__cmn_err__}.) 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
@@ -7209,6 +7210,7 @@ for further explanation.
* ARM Pragmas::
* RS/6000 and PowerPC Pragmas::
* Darwin Pragmas::
+* Solaris Pragmas::
* Symbol-Renaming Pragmas::
@end menu
@@ -7293,6 +7295,38 @@ that of the @code{unused} attribute, except that this pragma may appear
anywhere within the variables' scopes.
@end table
+@node Solaris Pragmas
+@subsection Solaris Pragmas
+
+The Solaris target supports @code{#pragma redefine_extname}
+(@pxref{Symbol-Renaming Pragmas}). The x86/AMD64 Solaris 10 target also
+supports additional @code{#pragma} directives for compatibility with system
+headers.
+
+@table @code
+@item align @var{alignment} (@var{variable} [, @var{variable}]...)
+@cindex pragma, align
+
+Increase the minimum alignment of each @var{variable} to @var{alignment}.
+This is the same as GCC's @code{aligned} attribute @pxref{Variable
+Attributes}).
+
+@item fini (@var{function} [, @var{function}]...)
+@cindex pragma, fini
+
+This pragma causes each listed @var{function} to be called after
+main, or during shared module unloading, by adding a call to the
+@code{.fini} section.
+
+@item init (@var{function} [, @var{function}]...)
+@cindex pragma, init
+
+This pragma causes each listed @var{function} to be called during
+initialization (before @code{main}) or during shared module loading, by
+adding a call to the @code{.init} section.
+
+@end table
+
@node Symbol-Renaming Pragmas
@subsection Symbol-Renaming Pragmas
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 244498efc22..a7f9ea50326 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2004-07-14 Daniel Jacobowitz <dan@debian.org>
+
+ * gcc.dg/format/cmn-err-1.c: New test.
+
+2004-07-13 Daniel Jacobowitz <dan@debian.org>
+
+ * gcc.dg/pragma-align-2.c: New testcase.
+ * gcc.dg/pragma-init-fini.c: New testcase.
+ * gcc.dg/pragma-align.c: Run test. Include i?86-solaris2.1[0-9]*.
+
2004-07-07 H.J. Lu <hongjiu.lu@intel.com>
PR c++/16276
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C
deleted file mode 100644
index c27aa8d2df7..00000000000
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C
+++ /dev/null
@@ -1,19 +0,0 @@
-//Build don't link:
-#include <vector>
-#include <algorithm>
-
-template <class T> class Expr
-{
-public :
-Expr(){};
-Expr(const T&){};
-};
-
-template <class T >
-inline bool compare(const Expr<T> a, const Expr<T> b){ return true; };
-
-int main()
-{
- std::vector<int> a(3);
- std::sort( a.begin(), a.end(), compare ); // ERROR - no matching function
-}
diff --git a/gcc/testsuite/gcc.dg/format/cmn-err-1.c b/gcc/testsuite/gcc.dg/format/cmn-err-1.c
new file mode 100644
index 00000000000..58579fcc74b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/format/cmn-err-1.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+#include "format.h"
+
+void cmn_err_func (int level, char * format, ...)
+ __attribute__((format (cmn_err, 2, 3)));
+
+void cmn_err_func (int level, char * format, ...)
+{
+}
+
+const char *string = "foo";
+
+int main()
+{
+ int i = 1;
+ long l = 2;
+ llong ll = 3;
+
+ cmn_err_func (0, "%s", string);
+ cmn_err_func (0, "%d %D %o %O %x %X %u", i, i, i, i, i, i, i);
+ cmn_err_func (0, "%ld %lD %lo %lO %lx %lX %lu", l, l, l, l, l, l, l);
+ cmn_err_func (0, "%lld %llD %llo %llO %llx %llX %llu",
+ ll, ll, ll, ll, ll, ll, ll);
+ cmn_err_func (0, "%b %s", i, "\01Foo", string);
+
+ cmn_err_func (0, "%i", i); /* { dg-error "unknown|too many" } */
+ cmn_err_func (0, "%d", l); /* { dg-error "expects type" } */
+ cmn_err_func (0, "%b"); /* { dg-error "too few" } */
+ cmn_err_func (0, "%b", i); /* { dg-error "too few" } */
+ cmn_err_func (0, "%b", i, i); /* { dg-error "expects type" } */
+ cmn_err_func (0, "%b", string, i); /* { dg-error "expects type" } */
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pragma-align-2.c b/gcc/testsuite/gcc.dg/pragma-align-2.c
new file mode 100644
index 00000000000..53c8faef45d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pragma-align-2.c
@@ -0,0 +1,54 @@
+/* { dg-do run { target i?86-*-solaris2.1[0-9]* } } */
+
+void abort (void);
+
+#pragma align 1(x1)
+#pragma align 2(x2)
+#pragma align 4(x4)
+#pragma align 8(x8,y8,z8)
+#pragma align 16(x16)
+#pragma align 32(x32)
+#pragma align 64(x64)
+#pragma align 128(x128)
+
+#pragma align 8(not_defined)
+
+#pragma align 9(odd_align) /* { dg-error "invalid alignment" } */
+#pragma align 256(high_align) /* { dg-error "invalid alignment" } */
+#pragma align -1(neg_align) /* { dg-error "malformed" } */
+#pragma align bad_align /* { dg-error "malformed" } */
+#pragma align 1(bad_align /* { dg-error "malformed" } */
+
+int x, x1, x2, x4, x8, y8, z8, x16, x32, x64, x128;
+
+#pragma align 16(x) /* { dg-error "must appear before" } */
+
+int
+main ()
+{
+ if (__alignof__ (x4) < 4)
+ abort ();
+
+ if (__alignof__ (x8) < 8)
+ abort ();
+
+ if (__alignof__ (y8) < 8)
+ abort ();
+
+ if (__alignof__ (z8) < 8)
+ abort ();
+
+ if (__alignof__ (x16) < 16)
+ abort ();
+
+ if (__alignof__ (x32) < 32)
+ abort ();
+
+ if (__alignof__ (x64) < 64)
+ abort ();
+
+ if (__alignof__ (x128) < 128)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pragma-align.c b/gcc/testsuite/gcc.dg/pragma-align.c
index f5d457e69d5..da0049aae2b 100644
--- a/gcc/testsuite/gcc.dg/pragma-align.c
+++ b/gcc/testsuite/gcc.dg/pragma-align.c
@@ -1,6 +1,6 @@
/* Prove that HANDLE_SYSTEMV_PRAGMA alignment handling works somewhat. */
-/* { dg-do compile { target i?86-*-linux* i?86-*-*bsd* i?86-*-sco3.2v5* } } */
+/* { dg-do run { target i?86-*-linux* i?86-*-*bsd* i?86-*-sco3.2v5* i?86-*-solaris2.1[0-9]* } } */
struct {
char one;
@@ -39,4 +39,3 @@ main()
if(sizeof(resetalign) != sizeof(defaultalign)) abort();
return 0;
}
-
diff --git a/gcc/testsuite/gcc.dg/pragma-init-fini.c b/gcc/testsuite/gcc.dg/pragma-init-fini.c
new file mode 100644
index 00000000000..312e43aaf8f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pragma-init-fini.c
@@ -0,0 +1,50 @@
+/* Tests for #pragma init and #pragma fini. */
+
+/* { dg-do run { target i?86-*-solaris2.1[0-9]* } } */
+
+extern void abort ();
+
+#pragma init /* { dg-error "malformed" } */
+#pragma init () /* { dg-error "malformed" } */
+#pragma init init_func /* { dg-error "malformed" } */
+
+#pragma fini /* { dg-error "malformed" } */
+#pragma fini () /* { dg-error "malformed" } */
+#pragma fini fini_func /* { dg-error "malformed" } */
+
+#pragma init (init_func, init_static_func)
+
+int glob_1, glob_2;
+
+void init_func (void)
+{
+ glob_1 = 1;
+}
+
+static void init_static_func (void)
+{
+ glob_2 = 2;
+}
+
+#pragma fini (fini_func, fini_static_func)
+
+void fini_func (void)
+{
+
+}
+
+static void fini_static_func (void)
+{
+
+}
+
+int main()
+{
+ if (glob_1 != 1)
+ abort ();
+
+ if (glob_2 != 2)
+ abort ();
+
+ return 0;
+}