This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[csl-sol210-branch] Patch to support Solaris 2.10


This patch adds a port to AMD64 Solaris 2.10.

Bootstrapped and tested on Solaris 2.10, applied on the
csl-sol210-3_4-branch.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2004-09-22  Mark Mitchell <mark@codesourcery.com>

	* gcc/config/i386/sol2.h (ASM_OUTPUT_CALL): Use print_operand.
	* gcc/config/sparc/sol2.h (ASM_OUTPUT_CALL): Likewise.

	* gcc/sol2-c.c (cmn_err_char_table): Add "p".

	* gcc/dwarf2out.c (scope_die_for): If the containing scope is a
	TRANSLATION_UNIT_DECL, consider it to be a global.

	* gcc/fixinc/inclhack.def (solaris_longlong): New test.
	(sun_auth_proto): Avoid modifying headers from Solaris 2.8 or
	higher.
	* gcc/fixinc/fixincl.x: Regenerated.

	* gcc/testsuite/lib/gcc-dg.exp (dg-forbid-option): New function.
	* gcc/testsuite/lib/target-supports.exp
	(check_visibility_available): Really test the compiler.
	* gcc/testsuite/g++.dg/abi/bitfield3.C: Use dg-forbid-option -m64.
	* gcc/testsuite/g++.dg/abi/bitfield8.C: Likewise.
	* gcc/testsuite/g++.dg/abi/dtor1.C: Likewise.
	* gcc/testsuite/g++.dg/abi/empty10.C: Likewise.
	* gcc/testsuite/g++.dg/abi/empty7.C: Likewise.
	* gcc/testsuite/g++.dg/abi/empty9.C: Likewise.
	* gcc/testsuite/g++.dg/abi/layout3.C: Likewise.
	* gcc/testsuite/g++.dg/abi/layout4.C: Likewise.
	* gcc/testsuite/g++.dg/abi/thunk1.C: Likewise.
	* gcc/testsuite/g++.dg/abi/thunk2.C: Likewise.
	* gcc/testsuite/g++.dg/abi/vbase11.C: Likewise.
	* gcc/testsuite/g++.dg/abi/vthunk2.C: Likewise.
	* gcc/testsuite/g++.dg/abi/vthunk3.C: Likewise.
	* gcc/testsuite/g++.dg/ext/attrib8.C: Likewise.
	* gcc/testsuite/g++.dg/opt/langbranch2.C: Likewise.
	* gcc/testsuite/g++.dg/opt/reg-stack4.C: Likewise.
	* gcc/testsuite/g++.old-deja/g++.ext/attrib1.C: Likewise.
	* gcc/testsuite/g++.old-deja/g++.ext/attrib2.C: Likewise.
	* gcc/testsuite/g++.old-deja/g++.ext/attrib3.C: Likewise.
	* gcc/testsuite/g++.old-deja/g++.other/store-expr1.C: Likewise.
	* gcc/testsuite/g++.old-deja/g++.other/store-expr2.C: Likewise.
	* gcc/testsuite/gcc.dg/20000609-1.c: Likewise.
	* gcc/testsuite/gcc.dg/20000720-1.c: Likewise.
	* gcc/testsuite/gcc.dg/20011107-1.c: Likewise.
	* gcc/testsuite/gcc.dg/20011119-1.c: Likewise.
	* gcc/testsuite/gcc.dg/20020108-1.c: Likewise.
	* gcc/testsuite/gcc.dg/20020122-2.c: Likewise.
	* gcc/testsuite/gcc.dg/20020122-3.c: Likewise.
	* gcc/testsuite/gcc.dg/20020201-3.c: Likewise.
	* gcc/testsuite/gcc.dg/20020206-1.c: Likewise.
	* gcc/testsuite/gcc.dg/20020218-1.c: Likewise.
	* gcc/testsuite/gcc.dg/20020310-1.c: Likewise.
	* gcc/testsuite/gcc.dg/20020411-1.c: Likewise.
	* gcc/testsuite/gcc.dg/20020418-2.c: Likewise.
	* gcc/testsuite/gcc.dg/20020426-1.c: Likewise.
	* gcc/testsuite/gcc.dg/20020426-2.c: Likewise.
	* gcc/testsuite/gcc.dg/20020517-1.c: Likewise.
	* gcc/testsuite/gcc.dg/20020523-1.c: Likewise.
	* gcc/testsuite/gcc.dg/20020523-2.c: Likewise.
	* gcc/testsuite/gcc.dg/20020729-1.c: Likewise.
	* gcc/testsuite/gcc.dg/20030204-1.c: Likewise.
	* gcc/testsuite/gcc.dg/20030826-2.c: Likewise.
	* gcc/testsuite/gcc.dg/20030926-1.c: Likewise.
	* gcc/testsuite/gcc.dg/20031202-1.c: Likewise.
	* gcc/testsuite/gcc.dg/980312-1.c: Likewise.
	* gcc/testsuite/gcc.dg/980313-1.c: Likewise.
	* gcc/testsuite/gcc.dg/990117-1.c: Likewise.
	* gcc/testsuite/gcc.dg/990424-1.c: Likewise.
	* gcc/testsuite/gcc.dg/990524-1.c: Likewise.
	* gcc/testsuite/gcc.dg/991230-1.c: Likewise.
	* gcc/testsuite/gcc.dg/const-elim-1.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-387-1.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-387-2.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-387-3.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-387-4.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-387-5.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-387-6.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-asm-1.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-bitfield1.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-bitfield2.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-loop-1.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-loop-2.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-loop-3.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-pentium4-not-mull.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-pic-1.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-regparm.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-signbit-1.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-signbit-2.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-signbit-3.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-sse-2.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-sse-5.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-sse-8.c: Likewise.
	* gcc/testsuite/gcc.dg/i386-unroll-1.c: Likewise.
	* gcc/testsuite/gcc.dg/tls/opt-1.c: Likewise.
	* gcc/testsuite/gcc.dg/tls/opt-2.c: Likewise.
	* gcc/testsuite/gcc.dg/unroll-1.c: Likewise.
	* gcc/testsuite/gcc.misc-tests/i386-pf-3dno-1.c: Likewise.
	* gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c: Likewise.
	* gcc/testsuite/gcc.misc-tests/i386-pf-none-1.c: Likewise.
	* gcc/testsuite/gcc.misc-tests/i386-pf-sse-1.c: Likewise.
	* gcc/testsuite/gcc.dg/tls/alias-1.c: Use dg-require-visibility. 
	* gcc/testsuite/gcc.c-torture/execute/20010129-1.x: Do not use
	-mtune=i686 when -m64 is specified.
	* gcc/testsuite/g++.dg/eh/badalloc1.C: Robustify.
	* libstdc++-v3/testsuite/27_io/basic_stream/extractors_arithmetic/char/12.cc: XFAIL on all Solaris targets.

	* gcc/c-decl.c (implicitly_declare): Call
	maybe_apply_renaming_pragma.
	(builtin_function): Call maybe_apply_renaming_pragma for all
	global variables and functions.
	* gcc/testsuite/gcc.dg/pragma-re-3.c: New test.
	Backport:
	2004-06-20  Zack Weinberg  <zack@codesourcery.com>
	* gcc/c-common.h (has_c_linkage): New interface.
	* gcc/c-cppbuiltin.c (maybe_apply_renaming_pragma): Rewrite 
	according to clarified semantics.  Always recognize, but do not 
	necessarily execute.
	* gcc/c-decl.c (builtin_function): Don't call make_decl_rtl.
	* gcc/c-objc-common.c (has_c_linkage): Stub implementation.
	* gcc/cp/except.c (nothrow_libfn_p): Look at DECL_NAME, not
	DECL_ASSEMBLER_NAME.
	
2004-08-04  Daniel Jacobowitz  <dan@debian.org>

	* config/sol2-c.c (solaris_pragma_align): Allow #pragma align after
	the first declaration.
	* config/i386/sol2-10.h (SUBTARGET_OVERRIDE_OPTIONS): Re-enable
	asynchronous unwind tables by default for 64-bit.

	* gcc.dg/pragma-align-2.c: Test for #pragma align after the
	definition of y16.

2004-08-03  Daniel Jacobowitz  <dan@debian.org>

	* c-pragma.c (maybe_apply_pending_pragma_weaks): Mark the new decl
	as weak.

2004-07-27  Daniel Jacobowitz  <dan@debian.org>

	* Makefile.in (c-objc-common.o): Update dependencies.
	* config/sol2-c.c (solaris_register_pragmas): Use
	c_register_pragma_with_expansion.
	* config/sol2.h (HANDLE_PRAGMA_PACK_WITH_EXPANSION): Define.
	* doc/extend.texi (Solaris Pragmas): Mention macro expansion
	for #pragma align.
	* c-objc-common.c: Include "c-pragma.h".
	(c_objc_common_finish_file): Call maybe_apply_pending_pragma_weaks.
	* c-pragma.c (maybe_apply_pending_pragma_weaks): New function.
	(c_register_pragma): Update call to cpp_register_pragma.
	(c_register_pragma_with_expansion): New function.
	(init_pragma): Honor HANDLE_PRAGMA_PACK_WITH_EXPANSION.
	* c-pragma.h (c_register_pragma_with_expansion)
	(maybe_apply_pending_pragma_weaks): New prototypes.
	* cpplib.c (struct pragma_entry): Add allow_expansion.
	(insert_pragma_entry): Take allow_expansion flag.
	(cpp_register_pragma): Likewise.
	(_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
	(do_pragma): Honor allow_expansion.
	* cpplib.h (cpp_register_pragma): Update prototype.

	* Make-lang.in (cp/decl2.c): Update dependencies.
	* decl2.c (finish_file): Call maybe_apply_pending_pragma_weaks.

	* gcc.dg/pragma-align-2.c: Test macro expansion.
	* gcc.dg/pragma-align.c: Fix abort on -m64.
	* gcc.dg/pragma-pack-2.c: New test.

2004-07-27  Daniel Jacobowitz  <dan@debian.org>

	* config/i386/sol2-10.h (LINK_ARCH64_SPEC_BASE)
	(LINK_ARCH64_SPEC, LINK_ARCH64_SPEC, TARGET_LD_EMULATION)
	(LINK_ARCH_SPEC): Define.
	* config/i386/t-sol2-10: Define MULTILIB_OSDIRNAMES.
	(EXTRA_MULTILIB_PARTS): Remove crti.o, crtn.o, crt1.o, gcrt1.o.
	* config.gcc (i[34567]86-*-solaris2*): Define TARGET_GNU_LD.

	* config/sol2-c.c, config/sol2.c: Replace %< and %> with "'".

2004-07-23  Daniel Jacobowitz  <dan@debian.org>

	* config/i386/sol2.h (ASM_PREFERRED_EH_DATA_FORMAT): Handle 64-bit.
	* config/i386/sol2-10.h (CRT_GET_RFIB_DATA): Redefine.
	* config.gcc (i[34567]86-*-solaris2*): Set need_64bit_hwint.
	* config/i386/t-sol2: Introduce multilib support.

2004-07-22  Daniel Jacobowitz  <dan@debian.org>

	* config/i386/sol2-10.h (MULTILIB_DEFAULTS): Define.
	* config/i386/t-sol2-10: New file.
	* config.gcc (i[34567]86-*-solaris2*): Use t-sol2-10.

2004-07-21  Daniel Jacobowitz  <dan@debian.org>

	* config/i386/i386.c (i386_solaris_elf_named_section): New function.
	* config/i386/i386-protos.h (i386_solaris_elf_named_section): Add
	prototype.
	* config/i386/sol2-10.h (TARGET_ASM_NAMED_SECTION): Redefine.

2004-07-20  Daniel Jacobowitz  <dan@debian.org>

	* config/i386/i386.c (override_options): Move
	SUBTARGET_OVERRIDE_OPTIONS before defaulting flag_omit_frame_pointer.

2004-07-20  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-19  Daniel Jacobowitz  <dan@debian.org>

	* Makefile.in (c-format.o): Depend on c-format.h.
	* c-format.h: New file.
	(struct format_char_info): Add CHAIN member.
	* c-format.c: Move some types and constants to c-format.h.
	(format_type_error): Set to -1.
	(struct function_format_info): Use an int for format_type.
	(decode_format_type): Return an int.  Return format_type_error
	on error.
	(print_char_table, asm_fprintf_char_table, gcc_diag_char_table)
	(gcc_diag_char_table, gcc_cdiag_char_table, gcc_cxxdiag_char_table)
	(scan_char_table, time_char_table, monetary_char_table): Initialize
	CHAIN to NULL.
	(n_format_types): New variable.
	(check_format_info_main): Handle CHAIN in format_char_info.
	(handle_format_attribute): Handle TARGET_FORMAT_TYPES and
	TARGET_N_FORMAT_TYPES.
	* config.gcc (i[34567]86-*-solaris2*, sparc64-*-solaris2*)
	(sparc-*-solaris2*): Include config/t-sol2 and config/sol2-c.c.
	* config/sol2-c.c: New file.
	* config/t-sol2: New file.
	* config/sol2.h (TARGET_N_FORMAT_TYPES, TARGET_FORMAT_TYPES): Define.
	* config/sparc/elf.h, config/sparc/sp64-elf.h: Undefine
	TARGET_N_FORMAT_TYPES and TARGET_FORMAT_TYPES.

	* doc/extend.texi (Target Format Checks): New section.
	(Function Attributes): Mention it.
	* doc/invoke.texi: Mention target format checks.
	* doc/sourcebuild.texi: Mention target format checks.
	* dc/tm.texi (Misc): Document TARGET_N_FORMAT_TYPES and
	TARGET_FORMAT_TYPES.

2004-07-19  Daniel Jacobowitz  <dan@debian.org>

	* gcc.dg/format/cmn-err-1.c: New test.

2004-07-19  Daniel Jacobowitz  <dan@debian.org>

	* config.gcc (i[34567]86-*-solaris2*, sparc64-*-solaris2*)
	(sparc-*-solaris2*): Include sol2.o and sol2-protos.h.
	* config/sol2-c.c: Include "tm.h", "tm_p.h", "toplev.h",
	"cpplib.h", "c-pragma.h", "c-common.h".
	(solaris_pragma_align, solaris_pragma_init, solaris_pragma_fini)
	(solaris_register_pragmas): New functions.
	* config/sol2-protos.h: New file.
	* config/sol2.c: New file.
	* config/sol2.h (SOLARIS_ATTRIBUTE_TABLE, ASM_DECLARE_FUNCTION_SIZE)
	(REGISTER_TARGET_PRAGMAS): New macros.
	(solaris_pending_aligns, solaris_pending_inits)
	(solaris_pending_finis): New variables.
	* config/t-sol2 (sol2-c.o): Update dependencies.
	(sol2.o): New rule.
	* config/i386/i386.c (TARGET_INSERT_ATTRIBUTES): Define in terms of
	SUBTARGET_INSERT_ATTRIBUTES.
	(ix86_attribute_table): Include SUBTARGET_ATTRIBUTE_TABLE.
	* config/i386/sol2.h (SUBTARGET_INSERT_ATTRIBUTES)
	(SUBTARGET_ATTRIBUTE_TABLE, ASM_OUTPUT_CALL): Define.
	* config/sparc/elf.h (ASM_DECLARE_FUNCTION_SIZE): Redefine.
	* config/sparc/sp64-elf.h (ASM_DECLARE_FUNCTION_SIZE): Redefine.
	* config/sparc/sol2.h (SUBTARGET_INSERT_ATTRIBUTES)
	(SUBTARGET_ATTRIBUTE_TABLE, ASM_OUTPUT_CALL): Define.
	* config/sparc/sparc.c (sparc_attribute_table): New.
	(TARGET_INSERT_ATTRIBUTES): Define in terms of
	SUBTARGET_INSERT_ATTRIBUTES.
	(TARGET_ATTRIBUTE_TABLE): Define if SUBTARGET_ATTRIBUTE_TABLE
	is defined.
	* doc/extend.texi (Solaris Pragmas): New section.

2004-07-19  Daniel Jacobowitz  <dan@debian.org>

	* testsuite/gcc.dg/pragma-align-2.c: New test.
	* testsuite/gcc.dg/pragma-init-fini.c: New test.
	* testsuite/gcc.dg/pragma-align.c: Change from compile to run.
	Run on Solaris 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.

diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/Makefile.in /export/home/mark/src/gcc-3.4.2/gcc/Makefile.in
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/Makefile.in	2004-06-17 14:56:58.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/Makefile.in	2004-09-20 16:59:51.885498000 -0700
@@ -1315,13 +1315,13 @@ c-ppoutput.o : c-ppoutput.c $(CONFIG_H) 
 c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
     $(C_TREE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) $(EXPR_H) $(C_TREE_H) \
     flags.h toplev.h tree-inline.h $(DIAGNOSTIC_H) $(VARRAY_H) \
-    langhooks.h $(GGC_H) $(TARGET_H) cgraph.h
+    langhooks.h $(GGC_H) $(TARGET_H) cgraph.h c-pragma.h
 c-aux-info.o : c-aux-info.c  $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
     $(C_TREE_H) flags.h toplev.h
 c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
     flags.h toplev.h $(C_COMMON_H) real.h
 c-pragma.o: c-pragma.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
-    function.h c-pragma.h toplev.h output.h $(GGC_H) $(TM_P_H) $(C_COMMON_H) gt-c-pragma.h
+    function.h c-pragma.h toplev.h output.h $(GGC_H) $(TM_P_H) $(C_COMMON_H) gt-c-pragma.h $(TARGET_H)
 graph.o: graph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h flags.h output.h \
     $(RTL_H) function.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h
 sbitmap.o: sbitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
@@ -1371,7 +1371,7 @@ attribs.o : attribs.c $(CONFIG_H) $(SYST
 	builtin-types.def $(TARGET_H) langhooks.h
 
 c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) langhooks.h \
-	$(C_COMMON_H) flags.h toplev.h intl.h $(DIAGNOSTIC_H)
+	$(C_COMMON_H) flags.h toplev.h intl.h $(DIAGNOSTIC_H) c-format.h
 
 c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
 	$(C_TREE_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/c-common.h /export/home/mark/src/gcc-3.4.2/gcc/c-common.h
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/c-common.h	2004-02-17 16:09:01.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/c-common.h	2004-09-20 16:59:51.904269000 -0700
@@ -348,6 +348,7 @@ extern void c_finish_while_stmt_cond (tr
 extern int field_decl_cmp (const void *, const void *);
 extern void resort_sorted_fields (void *, void *, gt_pointer_operator, 
                                   void *);
+extern bool has_c_linkage (tree decl);
 
 /* Switches common to the C front ends.  */
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/c-decl.c /export/home/mark/src/gcc-3.4.2/gcc/c-decl.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/c-decl.c	2004-08-17 09:24:57.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/c-decl.c	2004-09-21 19:44:43.776289000 -0700
@@ -1829,6 +1829,7 @@ tree
 implicitly_declare (tree functionid)
 {
   tree decl = any_external_decl (functionid);
+  tree asmspec_tree;
 
   if (decl)
     {
@@ -1858,6 +1859,17 @@ implicitly_declare (tree functionid)
   TREE_PUBLIC (decl) = 1;
   C_DECL_IMPLICIT (decl) = 1;
   implicit_decl_warning (functionid);
+  asmspec_tree = maybe_apply_renaming_pragma (decl, /*asmname=*/NULL);
+  if (asmspec_tree)
+    {
+      /* ASMSPEC is given, and not the name of a register.  Mark the
+	 name with a star so assemble_name won't munge it.  */
+      const char *asmspec = TREE_STRING_POINTER (asmspec_tree);
+      char *starred = alloca (strlen (asmspec) + 2);
+      starred[0] = '*';
+      strcpy (starred + 1, asmspec);
+      change_decl_assembler_name (decl, get_identifier (starred));
+    }
 
   /* C89 says implicit declarations are in the innermost block.
      So we record the decl in the standard fashion.  */
@@ -2311,7 +2323,7 @@ builtin_function (const char *name, tree
   TREE_PUBLIC (decl) = 1;
   if (library_name)
     SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name));
-  make_decl_rtl (decl, NULL);
+
   pushdecl (decl);
   DECL_BUILT_IN_CLASS (decl) = class;
   DECL_FUNCTION_CODE (decl) = function_code;
@@ -2688,7 +2700,9 @@ finish_decl (tree decl, tree init, tree 
   const char *asmspec = 0;
 
   /* If a name was specified, get the string.  */
-  if (current_scope == global_scope)
+  if ((TREE_CODE (decl) == FUNCTION_DECL 
+       || TREE_CODE (decl) == VAR_DECL)
+      && DECL_FILE_SCOPE_P (decl))
     asmspec_tree = maybe_apply_renaming_pragma (decl, asmspec_tree);
   if (asmspec_tree)
     asmspec = TREE_STRING_POINTER (asmspec_tree);
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/c-format.c /export/home/mark/src/gcc-3.4.2/gcc/c-format.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/c-format.c	2003-12-19 16:00:27.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/c-format.c	2004-09-20 16:59:51.912336000 -0700
@@ -30,6 +30,7 @@ Software Foundation, 59 Temple Place - S
 #include "intl.h"
 #include "diagnostic.h"
 #include "langhooks.h"
+#include "c-format.h"
 
 /* Set format warning options according to a -Wformat=n option.  */
 
@@ -53,23 +54,24 @@ set_Wformat (int setting)
 
 /* Handle attributes associated with format checking.  */
 
-/* This must be in the same order as format_types, with format_type_error
-   last.  */
+/* This must be in the same order as format_types, except for
+   format_type_error.  Target-specific format types do not have
+   matching enum values.  */
 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, format_type_error = -1};
 
 typedef struct function_format_info
 {
-  enum format_type format_type;	/* type of format (printf, scanf, etc.) */
+  int format_type;			/* type of format (printf, scanf, etc.) */
   unsigned HOST_WIDE_INT format_num;	/* number of format argument */
   unsigned HOST_WIDE_INT first_arg_num;	/* number of first arg (zero for varargs) */
 } function_format_info;
 
 static bool decode_format_attr (tree, function_format_info *, int);
-static enum format_type decode_format_type (const char *);
+static int decode_format_type (const char *);
 
 static bool check_format_string (tree argument,
 				 unsigned HOST_WIDE_INT format_num,
@@ -230,33 +232,6 @@ decode_format_attr (tree args, function_
 
 /* Check a call to a format function against a parameter list.  */
 
-/* The meaningfully distinct length modifiers for format checking recognized
-   by GCC.  */
-enum format_lengths
-{
-  FMT_LEN_none,
-  FMT_LEN_hh,
-  FMT_LEN_h,
-  FMT_LEN_l,
-  FMT_LEN_ll,
-  FMT_LEN_L,
-  FMT_LEN_z,
-  FMT_LEN_t,
-  FMT_LEN_j,
-  FMT_LEN_MAX
-};
-
-
-/* The standard versions in which various format features appeared.  */
-enum format_std_version
-{
-  STD_C89,
-  STD_C94,
-  STD_C9L, /* C99, but treat as C89 if -Wno-long-long.  */
-  STD_C99,
-  STD_EXT
-};
-
 /* The C standard version C++ is treated as equivalent to
    or inheriting from, for the purpose of format features supported.  */
 #define CPLUSPLUS_STD_VER	STD_C94
@@ -280,195 +255,6 @@ enum format_std_version
 				       ? (warn_long_long ? STD_C99 : STD_C89) \
 				       : (VER)))
 
-/* Flags that may apply to a particular kind of format checked by GCC.  */
-enum
-{
-  /* This format converts arguments of types determined by the
-     format string.  */
-  FMT_FLAG_ARG_CONVERT = 1,
-  /* The scanf allocation 'a' kludge applies to this format kind.  */
-  FMT_FLAG_SCANF_A_KLUDGE = 2,
-  /* A % during parsing a specifier is allowed to be a modified % rather
-     that indicating the format is broken and we are out-of-sync.  */
-  FMT_FLAG_FANCY_PERCENT_OK = 4,
-  /* With $ operand numbers, it is OK to reference the same argument more
-     than once.  */
-  FMT_FLAG_DOLLAR_MULTIPLE = 8,
-  /* This format type uses $ operand numbers (strfmon doesn't).  */
-  FMT_FLAG_USE_DOLLAR = 16,
-  /* Zero width is bad in this type of format (scanf).  */
-  FMT_FLAG_ZERO_WIDTH_BAD = 32,
-  /* Empty precision specification is OK in this type of format (printf).  */
-  FMT_FLAG_EMPTY_PREC_OK = 64,
-  /* Gaps are allowed in the arguments with $ operand numbers if all
-     arguments are pointers (scanf).  */
-  FMT_FLAG_DOLLAR_GAP_POINTER_OK = 128
-  /* Not included here: details of whether width or precision may occur
-     (controlled by width_char and precision_char); details of whether
-     '*' can be used for these (width_type and precision_type); details
-     of whether length modifiers can occur (length_char_specs).  */
-};
-
-
-/* Structure describing a length modifier supported in format checking, and
-   possibly a doubled version such as "hh".  */
-typedef struct
-{
-  /* Name of the single-character length modifier.  */
-  const char *name;
-  /* Index into a format_char_info.types array.  */
-  enum format_lengths index;
-  /* Standard version this length appears in.  */
-  enum format_std_version std;
-  /* Same, if the modifier can be repeated, or NULL if it can't.  */
-  const char *double_name;
-  enum format_lengths double_index;
-  enum format_std_version double_std;
-} format_length_info;
-
-
-/* Structure describing the combination of a conversion specifier
-   (or a set of specifiers which act identically) and a length modifier.  */
-typedef struct
-{
-  /* The standard version this combination of length and type appeared in.
-     This is only relevant if greater than those for length and type
-     individually; otherwise it is ignored.  */
-  enum format_std_version std;
-  /* The name to use for the type, if different from that generated internally
-     (e.g., "signed size_t").  */
-  const char *name;
-  /* The type itself.  */
-  tree *type;
-} format_type_detail;
-
-
-/* Macros to fill out tables of these.  */
-#define NOARGUMENTS	{ T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }
-#define BADLEN	{ 0, NULL, NULL }
-#define NOLENGTHS	{ BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }
-
-
-/* Structure describing a format conversion specifier (or a set of specifiers
-   which act identically), and the length modifiers used with it.  */
-typedef struct
-{
-  const char *format_chars;
-  int pointer_count;
-  enum format_std_version std;
-  /* Types accepted for each length modifier.  */
-  format_type_detail types[FMT_LEN_MAX];
-  /* List of other modifier characters allowed with these specifiers.
-     This lists flags, and additionally "w" for width, "p" for precision
-     (right precision, for strfmon), "#" for left precision (strfmon),
-     "a" for scanf "a" allocation extension (not applicable in C99 mode),
-     "*" for scanf suppression, and "E" and "O" for those strftime
-     modifiers.  */
-  const char *flag_chars;
-  /* List of additional flags describing these conversion specifiers.
-     "c" for generic character pointers being allowed, "2" for strftime
-     two digit year formats, "3" for strftime formats giving two digit
-     years in some locales, "4" for "2" which becomes "3" with an "E" modifier,
-     "o" if use of strftime "O" is a GNU extension beyond C99,
-     "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.  */
-  const char *flags2;
-} format_char_info;
-
-
-/* Structure describing a flag accepted by some kind of format.  */
-typedef struct
-{
-  /* The flag character in question (0 for end of array).  */
-  int flag_char;
-  /* Zero if this entry describes the flag character in general, or a
-     nonzero character that may be found in flags2 if it describes the
-     flag when used with certain formats only.  If the latter, only
-     the first such entry found that applies to the current conversion
-     specifier is used; the values of `name' and `long_name' it supplies
-     will be used, if non-NULL and the standard version is higher than
-     the unpredicated one, for any pedantic warning.  For example, 'o'
-     for strftime formats (meaning 'O' is an extension over C99).  */
-  int predicate;
-  /* Nonzero if the next character after this flag in the format should
-     be skipped ('=' in strfmon), zero otherwise.  */
-  int skip_next_char;
-  /* The name to use for this flag in diagnostic messages.  For example,
-     N_("`0' flag"), N_("field width").  */
-  const char *name;
-  /* Long name for this flag in diagnostic messages; currently only used for
-     "ISO C does not support ...".  For example, N_("the `I' printf flag").  */
-  const char *long_name;
-  /* The standard version in which it appeared.  */
-  enum format_std_version std;
-} format_flag_spec;
-
-
-/* Structure describing a combination of flags that is bad for some kind
-   of format.  */
-typedef struct
-{
-  /* The first flag character in question (0 for end of array).  */
-  int flag_char1;
-  /* The second flag character.  */
-  int flag_char2;
-  /* Nonzero if the message should say that the first flag is ignored with
-     the second, zero if the combination should simply be objected to.  */
-  int ignored;
-  /* Zero if this entry applies whenever this flag combination occurs,
-     a nonzero character from flags2 if it only applies in some
-     circumstances (e.g. 'i' for printf formats ignoring 0 with precision).  */
-  int predicate;
-} format_flag_pair;
-
-
-/* Structure describing a particular kind of format processed by GCC.  */
-typedef struct
-{
-  /* The name of this kind of format, for use in diagnostics.  Also
-     the name of the attribute (without preceding and following __).  */
-  const char *name;
-  /* Specifications of the length modifiers accepted; possibly NULL.  */
-  const format_length_info *length_char_specs;
-  /* Details of the conversion specification characters accepted.  */
-  const format_char_info *conversion_specs;
-  /* String listing the flag characters that are accepted.  */
-  const char *flag_chars;
-  /* String listing modifier characters (strftime) accepted.  May be NULL.  */
-  const char *modifier_chars;
-  /* Details of the flag characters, including pseudo-flags.  */
-  const format_flag_spec *flag_specs;
-  /* Details of bad combinations of flags.  */
-  const format_flag_pair *bad_flag_pairs;
-  /* Flags applicable to this kind of format.  */
-  int flags;
-  /* Flag character to treat a width as, or 0 if width not used.  */
-  int width_char;
-  /* Flag character to treat a left precision (strfmon) as,
-     or 0 if left precision not used.  */
-  int left_precision_char;
-  /* Flag character to treat a precision (for strfmon, right precision) as,
-     or 0 if precision not used.  */
-  int precision_char;
-  /* If a flag character has the effect of suppressing the conversion of
-     an argument ('*' in scanf), that flag character, otherwise 0.  */
-  int suppression_char;
-  /* Flag character to treat a length modifier as (ignored if length
-     modifiers not used).  Need not be placed in flag_chars for conversion
-     specifiers, but is used to check for bad combinations such as length
-     modifier with assignment suppression in scanf.  */
-  int length_code_char;
-  /* Pointer to type of argument expected if '*' is used for a width,
-     or NULL if '*' not used for widths.  */
-  tree *width_type;
-  /* Pointer to type of argument expected if '*' is used for a precision,
-     or NULL if '*' not used for precisions.  */
-  tree *precision_type;
-} format_kind_info;
-
-
 /* Structure describing details of a type expected in format checking,
    and the type to check against it.  */
 typedef struct format_wanted_type
@@ -698,226 +484,171 @@ static const format_flag_pair strfmon_fl
 };
 
 
-#define T_I	&integer_type_node
-#define T89_I	{ STD_C89, NULL, T_I }
-#define T_L	&long_integer_type_node
-#define T89_L	{ STD_C89, NULL, T_L }
-#define T_LL	&long_long_integer_type_node
-#define T9L_LL	{ STD_C9L, NULL, T_LL }
-#define TEX_LL	{ STD_EXT, NULL, T_LL }
-#define T_S	&short_integer_type_node
-#define T89_S	{ STD_C89, NULL, T_S }
-#define T_UI	&unsigned_type_node
-#define T89_UI	{ STD_C89, NULL, T_UI }
-#define T_UL	&long_unsigned_type_node
-#define T89_UL	{ STD_C89, NULL, T_UL }
-#define T_ULL	&long_long_unsigned_type_node
-#define T9L_ULL	{ STD_C9L, NULL, T_ULL }
-#define TEX_ULL	{ STD_EXT, NULL, T_ULL }
-#define T_US	&short_unsigned_type_node
-#define T89_US	{ STD_C89, NULL, T_US }
-#define T_F	&float_type_node
-#define T89_F	{ STD_C89, NULL, T_F }
-#define T99_F	{ STD_C99, NULL, T_F }
-#define T_D	&double_type_node
-#define T89_D	{ STD_C89, NULL, T_D }
-#define T99_D	{ STD_C99, NULL, T_D }
-#define T_LD	&long_double_type_node
-#define T89_LD	{ STD_C89, NULL, T_LD }
-#define T99_LD	{ STD_C99, NULL, T_LD }
-#define T_C	&char_type_node
-#define T89_C	{ STD_C89, NULL, T_C }
-#define T_SC	&signed_char_type_node
-#define T99_SC	{ STD_C99, NULL, T_SC }
-#define T_UC	&unsigned_char_type_node
-#define T99_UC	{ STD_C99, NULL, T_UC }
-#define T_V	&void_type_node
-#define T89_V	{ STD_C89, NULL, T_V }
-#define T_W	&wchar_type_node
-#define T94_W	{ STD_C94, "wchar_t", T_W }
-#define TEX_W	{ STD_EXT, "wchar_t", T_W }
-#define T_WI	&wint_type_node
-#define T94_WI	{ STD_C94, "wint_t", T_WI }
-#define TEX_WI	{ STD_EXT, "wint_t", T_WI }
-#define T_ST    &size_type_node
-#define T99_ST	{ STD_C99, "size_t", T_ST }
-#define T_SST   &signed_size_type_node
-#define T99_SST	{ STD_C99, "signed size_t", T_SST }
-#define T_PD    &ptrdiff_type_node
-#define T99_PD	{ STD_C99, "ptrdiff_t", T_PD }
-#define T_UPD   &unsigned_ptrdiff_type_node
-#define T99_UPD	{ STD_C99, "unsigned ptrdiff_t", T_UPD }
-#define T_IM    &intmax_type_node
-#define T99_IM	{ STD_C99, "intmax_t", T_IM }
-#define T_UIM   &uintmax_type_node
-#define T99_UIM	{ STD_C99, "uintmax_t", T_UIM }
-
 static const format_char_info print_char_table[] =
 {
   /* C89 conversion specifiers.  */
-  { "di",  0, STD_C89, { T89_I,   T99_SC,  T89_S,   T89_L,   T9L_LL,  TEX_LL,  T99_SST, T99_PD,  T99_IM  }, "-wp0 +'I",  "i"  },
-  { "oxX", 0, STD_C89, { T89_UI,  T99_UC,  T89_US,  T89_UL,  T9L_ULL, TEX_ULL, T99_ST,  T99_UPD, T99_UIM }, "-wp0#",     "i"  },
-  { "u",   0, STD_C89, { T89_UI,  T99_UC,  T89_US,  T89_UL,  T9L_ULL, TEX_ULL, T99_ST,  T99_UPD, T99_UIM }, "-wp0'I",    "i"  },
-  { "fgG", 0, STD_C89, { T89_D,   BADLEN,  BADLEN,  T99_D,   BADLEN,  T89_LD,  BADLEN,  BADLEN,  BADLEN  }, "-wp0 +#'I", ""   },
-  { "eE",  0, STD_C89, { T89_D,   BADLEN,  BADLEN,  T99_D,   BADLEN,  T89_LD,  BADLEN,  BADLEN,  BADLEN  }, "-wp0 +#I",  ""   },
-  { "c",   0, STD_C89, { T89_I,   BADLEN,  BADLEN,  T94_WI,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-w",        ""   },
-  { "s",   1, STD_C89, { T89_C,   BADLEN,  BADLEN,  T94_W,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-wp",       "cR" },
-  { "p",   1, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-w",        "c"  },
-  { "n",   1, STD_C89, { T89_I,   T99_SC,  T89_S,   T89_L,   T9L_LL,  BADLEN,  T99_SST, T99_PD,  T99_IM  }, "",          "W"  },
+  { "di",  0, STD_C89, { T89_I,   T99_SC,  T89_S,   T89_L,   T9L_LL,  TEX_LL,  T99_SST, T99_PD,  T99_IM  }, "-wp0 +'I",  "i",  NULL },
+  { "oxX", 0, STD_C89, { T89_UI,  T99_UC,  T89_US,  T89_UL,  T9L_ULL, TEX_ULL, T99_ST,  T99_UPD, T99_UIM }, "-wp0#",     "i",  NULL },
+  { "u",   0, STD_C89, { T89_UI,  T99_UC,  T89_US,  T89_UL,  T9L_ULL, TEX_ULL, T99_ST,  T99_UPD, T99_UIM }, "-wp0'I",    "i",  NULL },
+  { "fgG", 0, STD_C89, { T89_D,   BADLEN,  BADLEN,  T99_D,   BADLEN,  T89_LD,  BADLEN,  BADLEN,  BADLEN  }, "-wp0 +#'I", "",   NULL },
+  { "eE",  0, STD_C89, { T89_D,   BADLEN,  BADLEN,  T99_D,   BADLEN,  T89_LD,  BADLEN,  BADLEN,  BADLEN  }, "-wp0 +#I",  "",   NULL },
+  { "c",   0, STD_C89, { T89_I,   BADLEN,  BADLEN,  T94_WI,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-w",        "",   NULL },
+  { "s",   1, STD_C89, { T89_C,   BADLEN,  BADLEN,  T94_W,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-wp",       "cR", NULL },
+  { "p",   1, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-w",        "c",  NULL },
+  { "n",   1, STD_C89, { T89_I,   T99_SC,  T89_S,   T89_L,   T9L_LL,  BADLEN,  T99_SST, T99_PD,  T99_IM  }, "",          "W",  NULL },
   /* C99 conversion specifiers.  */
-  { "F",   0, STD_C99, { T99_D,   BADLEN,  BADLEN,  T99_D,   BADLEN,  T99_LD,  BADLEN,  BADLEN,  BADLEN  }, "-wp0 +#'I", ""   },
-  { "aA",  0, STD_C99, { T99_D,   BADLEN,  BADLEN,  T99_D,   BADLEN,  T99_LD,  BADLEN,  BADLEN,  BADLEN  }, "-wp0 +#",   ""   },
+  { "F",   0, STD_C99, { T99_D,   BADLEN,  BADLEN,  T99_D,   BADLEN,  T99_LD,  BADLEN,  BADLEN,  BADLEN  }, "-wp0 +#'I", "",   NULL },
+  { "aA",  0, STD_C99, { T99_D,   BADLEN,  BADLEN,  T99_D,   BADLEN,  T99_LD,  BADLEN,  BADLEN,  BADLEN  }, "-wp0 +#",   "",   NULL },
   /* X/Open conversion specifiers.  */
-  { "C",   0, STD_EXT, { TEX_WI,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-w",        ""   },
-  { "S",   1, STD_EXT, { TEX_W,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-wp",       "R"  },
+  { "C",   0, STD_EXT, { TEX_WI,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-w",        "",   NULL },
+  { "S",   1, STD_EXT, { TEX_W,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-wp",       "R",  NULL },
   /* GNU conversion specifiers.  */
-  { "m",   0, STD_EXT, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-wp",       ""   },
-  { NULL,  0, 0, NOLENGTHS, NULL, NULL }
+  { "m",   0, STD_EXT, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-wp",       "",   NULL },
+  { NULL,  0, 0, NOLENGTHS, NULL, NULL, NULL }
 };
 
 static const format_char_info asm_fprintf_char_table[] =
 {
   /* C89 conversion specifiers.  */
-  { "di",  0, STD_C89, { T89_I,   BADLEN,  BADLEN,  T89_L,   T9L_LL,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-wp0 +",  "i" },
-  { "oxX", 0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-wp0#",   "i" },
-  { "u",   0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-wp0",    "i" },
-  { "c",   0, STD_C89, { T89_I,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-w",       "" },
-  { "s",   1, STD_C89, { T89_C,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-wp",    "cR" },
+  { "di",  0, STD_C89, { T89_I,   BADLEN,  BADLEN,  T89_L,   T9L_LL,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-wp0 +",  "i", NULL },
+  { "oxX", 0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-wp0#",   "i", NULL },
+  { "u",   0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-wp0",    "i", NULL },
+  { "c",   0, STD_C89, { T89_I,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-w",       "", NULL },
+  { "s",   1, STD_C89, { T89_C,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "-wp",    "cR", NULL },
 
   /* asm_fprintf conversion specifiers.  */
-  { "O",   0, STD_C89, NOARGUMENTS, "",      ""   },
-  { "R",   0, STD_C89, NOARGUMENTS, "",      ""   },
-  { "I",   0, STD_C89, NOARGUMENTS, "",      ""   },
-  { "L",   0, STD_C89, NOARGUMENTS, "",      ""   },
-  { "U",   0, STD_C89, NOARGUMENTS, "",      ""   },
-  { "r",   0, STD_C89, { T89_I,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",  "" },
-  { "@",   0, STD_C89, NOARGUMENTS, "",      ""   },
-  { NULL,  0, 0, NOLENGTHS, NULL, NULL }
+  { "O",   0, STD_C89, NOARGUMENTS, "",      "",   NULL },
+  { "R",   0, STD_C89, NOARGUMENTS, "",      "",   NULL },
+  { "I",   0, STD_C89, NOARGUMENTS, "",      "",   NULL },
+  { "L",   0, STD_C89, NOARGUMENTS, "",      "",   NULL },
+  { "U",   0, STD_C89, NOARGUMENTS, "",      "",   NULL },
+  { "r",   0, STD_C89, { T89_I,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",  "", NULL },
+  { "@",   0, STD_C89, NOARGUMENTS, "",      "",   NULL },
+  { NULL,  0, 0, NOLENGTHS, NULL, NULL, NULL }
 };
 
 static const format_char_info gcc_diag_char_table[] =
 {
   /* C89 conversion specifiers.  */
-  { "di",  0, STD_C89, { T89_I,   BADLEN,  BADLEN,  T89_L,   T9L_LL,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",  ""   },
-  { "ox",  0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",  ""   },
-  { "u",   0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",  ""   },
-  { "c",   0, STD_C89, { T89_I,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   ""   },
-  { "s",   1, STD_C89, { T89_C,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "p",  "cR" },
-  { "p",   1, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "c"  },
+  { "di",  0, STD_C89, { T89_I,   BADLEN,  BADLEN,  T89_L,   T9L_LL,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   NULL },
+  { "ox",  0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   NULL },
+  { "u",   0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   NULL },
+  { "c",   0, STD_C89, { T89_I,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   NULL },
+  { "s",   1, STD_C89, { T89_C,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "p",  "cR", NULL },
+  { "p",   1, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "c",  NULL },
 
   /* Custom conversion specifiers.  */
 
   /* %H will require "location_t" at runtime.  */
-  { "H",   0, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   ""   },
+  { "H",   0, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   NULL },
 
   /* These will require a "tree" at runtime.  */
-  { "J", 0, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   ""   },
+  { "J", 0, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",     "",   NULL },
 
-  { "m",   0, STD_C89, NOARGUMENTS, "",      ""   },
-  { NULL,  0, 0, NOLENGTHS, NULL, NULL }
+  { "m",   0, STD_C89, NOARGUMENTS, "",      "",   NULL },
+  { NULL,  0, 0, NOLENGTHS, NULL, NULL, NULL }
 };
 
 static const format_char_info gcc_cdiag_char_table[] =
 {
   /* C89 conversion specifiers.  */
-  { "di",  0, STD_C89, { T89_I,   BADLEN,  BADLEN,  T89_L,   T9L_LL,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",  ""   },
-  { "ox",  0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",  ""   },
-  { "u",   0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",  ""   },
-  { "c",   0, STD_C89, { T89_I,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   ""   },
-  { "s",   1, STD_C89, { T89_C,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "p",  "cR" },
-  { "p",   1, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "c"  },
+  { "di",  0, STD_C89, { T89_I,   BADLEN,  BADLEN,  T89_L,   T9L_LL,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   NULL },
+  { "ox",  0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   NULL },
+  { "u",   0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   NULL },
+  { "c",   0, STD_C89, { T89_I,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   NULL },
+  { "s",   1, STD_C89, { T89_C,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "p",  "cR", NULL },
+  { "p",   1, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "c",  NULL },
 
   /* Custom conversion specifiers.  */
 
   /* %H will require "location_t" at runtime.  */
-  { "H",   0, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   ""   },
+  { "H",   0, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   NULL },
 
   /* These will require a "tree" at runtime.  */
-  { "DEFJT", 0, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   ""   },
+  { "DEFJT", 0, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",  "",   NULL },
 
-  { "m",   0, STD_C89, NOARGUMENTS, "",      ""   },
-  { NULL,  0, 0, NOLENGTHS, NULL, NULL }
+  { "m",   0, STD_C89, NOARGUMENTS, "",      "",   NULL },
+  { NULL,  0, 0, NOLENGTHS, NULL, NULL, NULL }
 };
 
 static const format_char_info gcc_cxxdiag_char_table[] =
 {
   /* C89 conversion specifiers.  */
-  { "di",  0, STD_C89, { T89_I,   BADLEN,  BADLEN,  T89_L,   T9L_LL,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",  ""   },
-  { "ox",  0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",  ""   },
-  { "u",   0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",  ""   },
-  { "c",   0, STD_C89, { T89_I,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   ""   },
-  { "s",   1, STD_C89, { T89_C,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "p",  "cR" },
-  { "p",   1, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "c"  },
+  { "di",  0, STD_C89, { T89_I,   BADLEN,  BADLEN,  T89_L,   T9L_LL,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   NULL },
+  { "ox",  0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   NULL },
+  { "u",   0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   NULL },
+  { "c",   0, STD_C89, { T89_I,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   NULL },
+  { "s",   1, STD_C89, { T89_C,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "p",  "cR", NULL },
+  { "p",   1, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "c",  NULL },
 
   /* Custom conversion specifiers.  */
 
   /* %H will require "location_t" at runtime.  */
-  { "H",   0, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   ""   },
+  { "H",   0, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   NULL },
 
   /* These will require a "tree" at runtime.  */
-  { "ADEFJTV",0,STD_C89,{ T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "+#",   ""   },
+  { "ADEFJTV",0,STD_C89,{ T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "+#",   "",   NULL },
 
   /* These accept either an `int' or an `enum tree_code' (which is handled as an `int'.)  */
-  { "CLOPQ",0,STD_C89, { T89_I,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   ""   },
+  { "CLOPQ",0,STD_C89, { T89_I,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   NULL },
 
-  { "m",   0, STD_C89, NOARGUMENTS, "",      ""   },
-  { NULL,  0, 0, NOLENGTHS, NULL, NULL }
+  { "m",   0, STD_C89, NOARGUMENTS, "",      "",   NULL },
+  { NULL,  0, 0, NOLENGTHS, NULL, NULL, NULL }
 };
 
 static const format_char_info scan_char_table[] =
 {
   /* C89 conversion specifiers.  */
-  { "di",    1, STD_C89, { T89_I,   T99_SC,  T89_S,   T89_L,   T9L_LL,  TEX_LL,  T99_SST, T99_PD,  T99_IM  }, "*w'I", "W"   },
-  { "u",     1, STD_C89, { T89_UI,  T99_UC,  T89_US,  T89_UL,  T9L_ULL, TEX_ULL, T99_ST,  T99_UPD, T99_UIM }, "*w'I", "W"   },
-  { "oxX",   1, STD_C89, { T89_UI,  T99_UC,  T89_US,  T89_UL,  T9L_ULL, TEX_ULL, T99_ST,  T99_UPD, T99_UIM }, "*w",   "W"   },
-  { "efgEG", 1, STD_C89, { T89_F,   BADLEN,  BADLEN,  T89_D,   BADLEN,  T89_LD,  BADLEN,  BADLEN,  BADLEN  }, "*w'",  "W"   },
-  { "c",     1, STD_C89, { T89_C,   BADLEN,  BADLEN,  T94_W,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "*w",   "cW"  },
-  { "s",     1, STD_C89, { T89_C,   BADLEN,  BADLEN,  T94_W,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "*aw",  "cW"  },
-  { "[",     1, STD_C89, { T89_C,   BADLEN,  BADLEN,  T94_W,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "*aw",  "cW[" },
-  { "p",     2, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "*w",   "W"   },
-  { "n",     1, STD_C89, { T89_I,   T99_SC,  T89_S,   T89_L,   T9L_LL,  BADLEN,  T99_SST, T99_PD,  T99_IM  }, "",     "W"   },
+  { "di",    1, STD_C89, { T89_I,   T99_SC,  T89_S,   T89_L,   T9L_LL,  TEX_LL,  T99_SST, T99_PD,  T99_IM  }, "*w'I", "W",   NULL },
+  { "u",     1, STD_C89, { T89_UI,  T99_UC,  T89_US,  T89_UL,  T9L_ULL, TEX_ULL, T99_ST,  T99_UPD, T99_UIM }, "*w'I", "W",   NULL },
+  { "oxX",   1, STD_C89, { T89_UI,  T99_UC,  T89_US,  T89_UL,  T9L_ULL, TEX_ULL, T99_ST,  T99_UPD, T99_UIM }, "*w",   "W",   NULL },
+  { "efgEG", 1, STD_C89, { T89_F,   BADLEN,  BADLEN,  T89_D,   BADLEN,  T89_LD,  BADLEN,  BADLEN,  BADLEN  }, "*w'",  "W",   NULL },
+  { "c",     1, STD_C89, { T89_C,   BADLEN,  BADLEN,  T94_W,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "*w",   "cW",  NULL },
+  { "s",     1, STD_C89, { T89_C,   BADLEN,  BADLEN,  T94_W,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "*aw",  "cW",  NULL },
+  { "[",     1, STD_C89, { T89_C,   BADLEN,  BADLEN,  T94_W,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "*aw",  "cW[", NULL },
+  { "p",     2, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "*w",   "W",   NULL },
+  { "n",     1, STD_C89, { T89_I,   T99_SC,  T89_S,   T89_L,   T9L_LL,  BADLEN,  T99_SST, T99_PD,  T99_IM  }, "",     "W",   NULL },
   /* C99 conversion specifiers.  */
-  { "FaA",   1, STD_C99, { T99_F,   BADLEN,  BADLEN,  T99_D,   BADLEN,  T99_LD,  BADLEN,  BADLEN,  BADLEN  }, "*w'",  "W"   },
+  { "FaA",   1, STD_C99, { T99_F,   BADLEN,  BADLEN,  T99_D,   BADLEN,  T99_LD,  BADLEN,  BADLEN,  BADLEN  }, "*w'",  "W",   NULL },
   /* X/Open conversion specifiers.  */
-  { "C",     1, STD_EXT, { TEX_W,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "*w",   "W"   },
-  { "S",     1, STD_EXT, { TEX_W,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "*aw",  "W"   },
-  { NULL, 0, 0, NOLENGTHS, NULL, NULL }
+  { "C",     1, STD_EXT, { TEX_W,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "*w",   "W",   NULL },
+  { "S",     1, STD_EXT, { TEX_W,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "*aw",  "W",   NULL },
+  { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL }
 };
 
 static const format_char_info time_char_table[] =
 {
   /* C89 conversion specifiers.  */
-  { "ABZab",		0, STD_C89, NOLENGTHS, "^#",     ""   },
-  { "cx", 		0, STD_C89, NOLENGTHS, "E",      "3"  },
-  { "HIMSUWdmw",	0, STD_C89, NOLENGTHS, "-_0Ow",  ""   },
-  { "j",		0, STD_C89, NOLENGTHS, "-_0Ow",  "o"  },
-  { "p",		0, STD_C89, NOLENGTHS, "#",      ""   },
-  { "X",		0, STD_C89, NOLENGTHS, "E",      ""   },
-  { "y", 		0, STD_C89, NOLENGTHS, "EO-_0w", "4"  },
-  { "Y",		0, STD_C89, NOLENGTHS, "-_0EOw", "o"  },
-  { "%",		0, STD_C89, NOLENGTHS, "",       ""   },
+  { "ABZab",		0, STD_C89, NOLENGTHS, "^#",     "",   NULL },
+  { "cx", 		0, STD_C89, NOLENGTHS, "E",      "3",  NULL },
+  { "HIMSUWdmw",	0, STD_C89, NOLENGTHS, "-_0Ow",  "",   NULL },
+  { "j",		0, STD_C89, NOLENGTHS, "-_0Ow",  "o",  NULL },
+  { "p",		0, STD_C89, NOLENGTHS, "#",      "",   NULL },
+  { "X",		0, STD_C89, NOLENGTHS, "E",      "",   NULL },
+  { "y", 		0, STD_C89, NOLENGTHS, "EO-_0w", "4",  NULL },
+  { "Y",		0, STD_C89, NOLENGTHS, "-_0EOw", "o",  NULL },
+  { "%",		0, STD_C89, NOLENGTHS, "",       "",   NULL },
   /* C99 conversion specifiers.  */
-  { "C",		0, STD_C99, NOLENGTHS, "-_0EOw", "o"  },
-  { "D", 		0, STD_C99, NOLENGTHS, "",       "2"  },
-  { "eVu",		0, STD_C99, NOLENGTHS, "-_0Ow",  ""   },
-  { "FRTnrt",		0, STD_C99, NOLENGTHS, "",       ""   },
-  { "g", 		0, STD_C99, NOLENGTHS, "O-_0w",  "2o" },
-  { "G",		0, STD_C99, NOLENGTHS, "-_0Ow",  "o"  },
-  { "h",		0, STD_C99, NOLENGTHS, "^#",     ""   },
-  { "z",		0, STD_C99, NOLENGTHS, "O",      "o"  },
+  { "C",		0, STD_C99, NOLENGTHS, "-_0EOw", "o",  NULL },
+  { "D", 		0, STD_C99, NOLENGTHS, "",       "2",  NULL },
+  { "eVu",		0, STD_C99, NOLENGTHS, "-_0Ow",  "",   NULL },
+  { "FRTnrt",		0, STD_C99, NOLENGTHS, "",       "",   NULL },
+  { "g", 		0, STD_C99, NOLENGTHS, "O-_0w",  "2o", NULL },
+  { "G",		0, STD_C99, NOLENGTHS, "-_0Ow",  "o",  NULL },
+  { "h",		0, STD_C99, NOLENGTHS, "^#",     "",   NULL },
+  { "z",		0, STD_C99, NOLENGTHS, "O",      "o",  NULL },
   /* GNU conversion specifiers.  */
-  { "kls",		0, STD_EXT, NOLENGTHS, "-_0Ow",  ""   },
-  { "P",		0, STD_EXT, NOLENGTHS, "",       ""   },
-  { NULL,		0, 0, NOLENGTHS, NULL, NULL }
+  { "kls",		0, STD_EXT, NOLENGTHS, "-_0Ow",  "",   NULL },
+  { "P",		0, STD_EXT, NOLENGTHS, "",       "",   NULL },
+  { NULL,		0, 0, NOLENGTHS, NULL, NULL, NULL }
 };
 
 static const format_char_info monetary_char_table[] =
 {
-  { "in", 0, STD_C89, { T89_D, BADLEN, BADLEN, BADLEN, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "=^+(!-w#p", "" },
-  { NULL, 0, 0, NOLENGTHS, NULL, NULL }
+  { "in", 0, STD_C89, { T89_D, BADLEN, BADLEN, BADLEN, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "=^+(!-w#p", "", NULL },
+  { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL }
 };
 
-
 /* This must be in the same order as enum format_type.  */
 static const format_kind_info format_types_orig[] =
 {
@@ -973,9 +704,12 @@ static const format_kind_info format_typ
    new data if necessary, while still allowing the original data to be
    const.  */
 static const format_kind_info *format_types = format_types_orig;
-/* We can modify this one.  */
+/* We can modify this one.  We also add target-specific format types
+   to the end of the array.  */
 static format_kind_info *dynamic_format_types;
 
+static int n_format_types = ARRAY_SIZE (format_types_orig);
+
 /* Structure detailing the results of checking a format function call
    where the format expression may be a conditional expression with
    many leaves resulting from nested conditional expressions.  */
@@ -1033,24 +767,24 @@ static void check_format_types (int *, f
 /* Decode a format type from a string, returning the type, or
    format_type_error if not valid, in which case the caller should print an
    error message.  */
-static enum format_type
+static int
 decode_format_type (const char *s)
 {
   int i;
   int slen;
   slen = strlen (s);
-  for (i = 0; i < (int) format_type_error; i++)
+  for (i = 0; i < n_format_types; i++)
     {
       int alen;
       if (!strcmp (s, format_types[i].name))
-	break;
+	return i;
       alen = strlen (format_types[i].name);
       if (slen == alen + 4 && s[0] == '_' && s[1] == '_'
 	  && s[slen - 1] == '_' && s[slen - 2] == '_'
 	  && !strncmp (s + 2, format_types[i].name, alen))
-	break;
+	return i;
     }
-  return ((enum format_type) i);
+  return format_type_error;
 }
 
 
@@ -2183,6 +1917,8 @@ check_format_info_main (int *status, for
 	    }
 	}
 
+      main_wanted_type.next = NULL;
+
       /* Finally. . .check type of argument against desired type!  */
       if (info->first_arg_num == 0)
 	continue;
@@ -2199,6 +1935,8 @@ check_format_info_main (int *status, for
 	}
       else
 	{
+	  format_wanted_type *wanted_type_ptr;
+
 	  if (main_arg_num != 0)
 	    {
 	      arg_num = main_arg_num;
@@ -2214,45 +1952,71 @@ check_format_info_main (int *status, for
 		}
 	      else
 		has_operand_number = 0;
+	    }
+
+	  wanted_type_ptr = &main_wanted_type;
+	  while (fci)
+	    {
 	      if (params == 0)
 		{
 		  status_warning (status, "too few arguments for format");
 		  return;
 		}
+
+	      cur_param = TREE_VALUE (params);
+	      params = TREE_CHAIN (params);
+
+	      wanted_type_ptr->wanted_type = wanted_type;
+	      wanted_type_ptr->wanted_type_name = wanted_type_name;
+	      wanted_type_ptr->pointer_count = fci->pointer_count + aflag;
+	      wanted_type_ptr->char_lenient_flag = 0;
+	      if (strchr (fci->flags2, 'c') != 0)
+		wanted_type_ptr->char_lenient_flag = 1;
+	      wanted_type_ptr->writing_in_flag = 0;
+	      wanted_type_ptr->reading_from_flag = 0;
+	      if (aflag)
+		wanted_type_ptr->writing_in_flag = 1;
+	      else
+		{
+		  if (strchr (fci->flags2, 'W') != 0)
+		    wanted_type_ptr->writing_in_flag = 1;
+		  if (strchr (fci->flags2, 'R') != 0)
+		    wanted_type_ptr->reading_from_flag = 1;
+		}
+	      wanted_type_ptr->name = NULL;
+	      wanted_type_ptr->param = cur_param;
+	      wanted_type_ptr->arg_num = arg_num;
+	      wanted_type_ptr->next = NULL;
+	      if (last_wanted_type != 0)
+		last_wanted_type->next = wanted_type_ptr;
+	      if (first_wanted_type == 0)
+		first_wanted_type = wanted_type_ptr;
+	      last_wanted_type = wanted_type_ptr;
+
+	      fci = fci->chain;
+	      if (fci)
+		{
+		  wanted_type_ptr = ggc_alloc (sizeof (main_wanted_type));
+		  arg_num++;
+		  wanted_type = *fci->types[length_chars_val].type;
+		  wanted_type_name = fci->types[length_chars_val].name;
+		}
 	    }
-	  cur_param = TREE_VALUE (params);
-	  params = TREE_CHAIN (params);
-	  main_wanted_type.wanted_type = wanted_type;
-	  main_wanted_type.wanted_type_name = wanted_type_name;
-	  main_wanted_type.pointer_count = fci->pointer_count + aflag;
-	  main_wanted_type.char_lenient_flag = 0;
-	  if (strchr (fci->flags2, 'c') != 0)
-	    main_wanted_type.char_lenient_flag = 1;
-	  main_wanted_type.writing_in_flag = 0;
-	  main_wanted_type.reading_from_flag = 0;
-	  if (aflag)
-	    main_wanted_type.writing_in_flag = 1;
-	  else
-	    {
-	      if (strchr (fci->flags2, 'W') != 0)
-		main_wanted_type.writing_in_flag = 1;
-	      if (strchr (fci->flags2, 'R') != 0)
-		main_wanted_type.reading_from_flag = 1;
-	    }
-	  main_wanted_type.name = NULL;
-	  main_wanted_type.param = cur_param;
-	  main_wanted_type.arg_num = arg_num;
-	  main_wanted_type.next = NULL;
-	  if (last_wanted_type != 0)
-	    last_wanted_type->next = &main_wanted_type;
-	  if (first_wanted_type == 0)
-	    first_wanted_type = &main_wanted_type;
-	  last_wanted_type = &main_wanted_type;
 	}
 
       if (first_wanted_type != 0)
 	check_format_types (status, first_wanted_type);
 
+      if (main_wanted_type.next != NULL)
+	{
+	  format_wanted_type *wanted_type_ptr = main_wanted_type.next;
+	  while (wanted_type_ptr)
+	    {
+	      format_wanted_type *next = wanted_type_ptr->next;
+	      /* ggc_free (wanted_type_ptr); */
+	      wanted_type_ptr = next;
+	    }
+	}
     }
 }
 
@@ -2666,6 +2430,10 @@ init_dynamic_diag_info (void)
     }
 }
 
+#ifdef TARGET_FORMAT_TYPES
+extern const format_kind_info TARGET_FORMAT_TYPES[];
+#endif
+
 /* Handle a "format" attribute; arguments as in
    struct attribute_spec.handler.  */
 tree
@@ -2676,6 +2444,23 @@ handle_format_attribute (tree *node, tre
   function_format_info info;
   tree argument;
 
+#ifdef TARGET_FORMAT_TYPES
+  /* If the target provides additional format types, we need to
+     add them to FORMAT_TYPES at first use.  */
+  if (TARGET_FORMAT_TYPES != NULL && !dynamic_format_types)
+    {
+      dynamic_format_types = xmalloc ((n_format_types + TARGET_N_FORMAT_TYPES)
+				      * sizeof (dynamic_format_types[0]));
+      memcpy (dynamic_format_types, format_types_orig,
+	      sizeof (format_types_orig));
+      memcpy (&dynamic_format_types[n_format_types], TARGET_FORMAT_TYPES,
+	      TARGET_N_FORMAT_TYPES * sizeof (dynamic_format_types[0]));
+
+      format_types = dynamic_format_types;
+      n_format_types += TARGET_N_FORMAT_TYPES;
+    }
+#endif
+
   if (!decode_format_attr (args, &info, 0))
     {
       *no_add_attrs = true;
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/c-format.h /export/home/mark/src/gcc-3.4.2/gcc/c-format.h
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/c-format.h	1969-12-31 16:00:00.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/c-format.h	2004-09-20 16:59:51.913576000 -0700
@@ -0,0 +1,299 @@
+/* Check calls to formatted I/O functions (-Wformat).
+   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+   2001, 2002, 2003, 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.  */
+
+#ifndef GCC_C_FORMAT_H
+#define GCC_C_FORMAT_H
+
+/* The meaningfully distinct length modifiers for format checking recognized
+   by GCC.  */
+enum format_lengths
+{
+  FMT_LEN_none,
+  FMT_LEN_hh,
+  FMT_LEN_h,
+  FMT_LEN_l,
+  FMT_LEN_ll,
+  FMT_LEN_L,
+  FMT_LEN_z,
+  FMT_LEN_t,
+  FMT_LEN_j,
+  FMT_LEN_MAX
+};
+
+
+/* The standard versions in which various format features appeared.  */
+enum format_std_version
+{
+  STD_C89,
+  STD_C94,
+  STD_C9L, /* C99, but treat as C89 if -Wno-long-long.  */
+  STD_C99,
+  STD_EXT
+};
+
+/* Flags that may apply to a particular kind of format checked by GCC.  */
+enum
+{
+  /* This format converts arguments of types determined by the
+     format string.  */
+  FMT_FLAG_ARG_CONVERT = 1,
+  /* The scanf allocation 'a' kludge applies to this format kind.  */
+  FMT_FLAG_SCANF_A_KLUDGE = 2,
+  /* A % during parsing a specifier is allowed to be a modified % rather
+     that indicating the format is broken and we are out-of-sync.  */
+  FMT_FLAG_FANCY_PERCENT_OK = 4,
+  /* With $ operand numbers, it is OK to reference the same argument more
+     than once.  */
+  FMT_FLAG_DOLLAR_MULTIPLE = 8,
+  /* This format type uses $ operand numbers (strfmon doesn't).  */
+  FMT_FLAG_USE_DOLLAR = 16,
+  /* Zero width is bad in this type of format (scanf).  */
+  FMT_FLAG_ZERO_WIDTH_BAD = 32,
+  /* Empty precision specification is OK in this type of format (printf).  */
+  FMT_FLAG_EMPTY_PREC_OK = 64,
+  /* Gaps are allowed in the arguments with $ operand numbers if all
+     arguments are pointers (scanf).  */
+  FMT_FLAG_DOLLAR_GAP_POINTER_OK = 128
+  /* Not included here: details of whether width or precision may occur
+     (controlled by width_char and precision_char); details of whether
+     '*' can be used for these (width_type and precision_type); details
+     of whether length modifiers can occur (length_char_specs).  */
+};
+
+
+/* Structure describing a length modifier supported in format checking, and
+   possibly a doubled version such as "hh".  */
+typedef struct
+{
+  /* Name of the single-character length modifier.  */
+  const char *name;
+  /* Index into a format_char_info.types array.  */
+  enum format_lengths index;
+  /* Standard version this length appears in.  */
+  enum format_std_version std;
+  /* Same, if the modifier can be repeated, or NULL if it can't.  */
+  const char *double_name;
+  enum format_lengths double_index;
+  enum format_std_version double_std;
+} format_length_info;
+
+
+/* Structure describing the combination of a conversion specifier
+   (or a set of specifiers which act identically) and a length modifier.  */
+typedef struct
+{
+  /* The standard version this combination of length and type appeared in.
+     This is only relevant if greater than those for length and type
+     individually; otherwise it is ignored.  */
+  enum format_std_version std;
+  /* The name to use for the type, if different from that generated internally
+     (e.g., "signed size_t").  */
+  const char *name;
+  /* The type itself.  */
+  tree *type;
+} format_type_detail;
+
+
+/* Macros to fill out tables of these.  */
+#define NOARGUMENTS	{ T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }
+#define BADLEN	{ 0, NULL, NULL }
+#define NOLENGTHS	{ BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }
+
+
+/* Structure describing a format conversion specifier (or a set of specifiers
+   which act identically), and the length modifiers used with it.  */
+typedef struct format_char_info
+{
+  const char *format_chars;
+  int pointer_count;
+  enum format_std_version std;
+  /* Types accepted for each length modifier.  */
+  format_type_detail types[FMT_LEN_MAX];
+  /* List of other modifier characters allowed with these specifiers.
+     This lists flags, and additionally "w" for width, "p" for precision
+     (right precision, for strfmon), "#" for left precision (strfmon),
+     "a" for scanf "a" allocation extension (not applicable in C99 mode),
+     "*" for scanf suppression, and "E" and "O" for those strftime
+     modifiers.  */
+  const char *flag_chars;
+  /* List of additional flags describing these conversion specifiers.
+     "c" for generic character pointers being allowed, "2" for strftime
+     two digit year formats, "3" for strftime formats giving two digit
+     years in some locales, "4" for "2" which becomes "3" with an "E" modifier,
+     "o" if use of strftime "O" is a GNU extension beyond C99,
+     "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.  */
+  const char *flags2;
+  /* If this format conversion character consumes more than one argument,
+     CHAIN points to information about the next argument.  For later
+     arguments, only POINTER_COUNT, TYPES, and the "c", "R", and "W" flags
+     in FLAGS2 are used.  */
+  const struct format_char_info *chain;
+} format_char_info;
+
+
+/* Structure describing a flag accepted by some kind of format.  */
+typedef struct
+{
+  /* The flag character in question (0 for end of array).  */
+  int flag_char;
+  /* Zero if this entry describes the flag character in general, or a
+     nonzero character that may be found in flags2 if it describes the
+     flag when used with certain formats only.  If the latter, only
+     the first such entry found that applies to the current conversion
+     specifier is used; the values of `name' and `long_name' it supplies
+     will be used, if non-NULL and the standard version is higher than
+     the unpredicated one, for any pedantic warning.  For example, 'o'
+     for strftime formats (meaning 'O' is an extension over C99).  */
+  int predicate;
+  /* Nonzero if the next character after this flag in the format should
+     be skipped ('=' in strfmon), zero otherwise.  */
+  int skip_next_char;
+  /* The name to use for this flag in diagnostic messages.  For example,
+     N_("`0' flag"), N_("field width").  */
+  const char *name;
+  /* Long name for this flag in diagnostic messages; currently only used for
+     "ISO C does not support ...".  For example, N_("the `I' printf flag").  */
+  const char *long_name;
+  /* The standard version in which it appeared.  */
+  enum format_std_version std;
+} format_flag_spec;
+
+
+/* Structure describing a combination of flags that is bad for some kind
+   of format.  */
+typedef struct
+{
+  /* The first flag character in question (0 for end of array).  */
+  int flag_char1;
+  /* The second flag character.  */
+  int flag_char2;
+  /* Nonzero if the message should say that the first flag is ignored with
+     the second, zero if the combination should simply be objected to.  */
+  int ignored;
+  /* Zero if this entry applies whenever this flag combination occurs,
+     a nonzero character from flags2 if it only applies in some
+     circumstances (e.g. 'i' for printf formats ignoring 0 with precision).  */
+  int predicate;
+} format_flag_pair;
+
+
+/* Structure describing a particular kind of format processed by GCC.  */
+typedef struct
+{
+  /* The name of this kind of format, for use in diagnostics.  Also
+     the name of the attribute (without preceding and following __).  */
+  const char *name;
+  /* Specifications of the length modifiers accepted; possibly NULL.  */
+  const format_length_info *length_char_specs;
+  /* Details of the conversion specification characters accepted.  */
+  const format_char_info *conversion_specs;
+  /* String listing the flag characters that are accepted.  */
+  const char *flag_chars;
+  /* String listing modifier characters (strftime) accepted.  May be NULL.  */
+  const char *modifier_chars;
+  /* Details of the flag characters, including pseudo-flags.  */
+  const format_flag_spec *flag_specs;
+  /* Details of bad combinations of flags.  */
+  const format_flag_pair *bad_flag_pairs;
+  /* Flags applicable to this kind of format.  */
+  int flags;
+  /* Flag character to treat a width as, or 0 if width not used.  */
+  int width_char;
+  /* Flag character to treat a left precision (strfmon) as,
+     or 0 if left precision not used.  */
+  int left_precision_char;
+  /* Flag character to treat a precision (for strfmon, right precision) as,
+     or 0 if precision not used.  */
+  int precision_char;
+  /* If a flag character has the effect of suppressing the conversion of
+     an argument ('*' in scanf), that flag character, otherwise 0.  */
+  int suppression_char;
+  /* Flag character to treat a length modifier as (ignored if length
+     modifiers not used).  Need not be placed in flag_chars for conversion
+     specifiers, but is used to check for bad combinations such as length
+     modifier with assignment suppression in scanf.  */
+  int length_code_char;
+  /* Pointer to type of argument expected if '*' is used for a width,
+     or NULL if '*' not used for widths.  */
+  tree *width_type;
+  /* Pointer to type of argument expected if '*' is used for a precision,
+     or NULL if '*' not used for precisions.  */
+  tree *precision_type;
+} format_kind_info;
+
+#define T_I	&integer_type_node
+#define T89_I	{ STD_C89, NULL, T_I }
+#define T_L	&long_integer_type_node
+#define T89_L	{ STD_C89, NULL, T_L }
+#define T_LL	&long_long_integer_type_node
+#define T9L_LL	{ STD_C9L, NULL, T_LL }
+#define TEX_LL	{ STD_EXT, NULL, T_LL }
+#define T_S	&short_integer_type_node
+#define T89_S	{ STD_C89, NULL, T_S }
+#define T_UI	&unsigned_type_node
+#define T89_UI	{ STD_C89, NULL, T_UI }
+#define T_UL	&long_unsigned_type_node
+#define T89_UL	{ STD_C89, NULL, T_UL }
+#define T_ULL	&long_long_unsigned_type_node
+#define T9L_ULL	{ STD_C9L, NULL, T_ULL }
+#define TEX_ULL	{ STD_EXT, NULL, T_ULL }
+#define T_US	&short_unsigned_type_node
+#define T89_US	{ STD_C89, NULL, T_US }
+#define T_F	&float_type_node
+#define T89_F	{ STD_C89, NULL, T_F }
+#define T99_F	{ STD_C99, NULL, T_F }
+#define T_D	&double_type_node
+#define T89_D	{ STD_C89, NULL, T_D }
+#define T99_D	{ STD_C99, NULL, T_D }
+#define T_LD	&long_double_type_node
+#define T89_LD	{ STD_C89, NULL, T_LD }
+#define T99_LD	{ STD_C99, NULL, T_LD }
+#define T_C	&char_type_node
+#define T89_C	{ STD_C89, NULL, T_C }
+#define T_SC	&signed_char_type_node
+#define T99_SC	{ STD_C99, NULL, T_SC }
+#define T_UC	&unsigned_char_type_node
+#define T99_UC	{ STD_C99, NULL, T_UC }
+#define T_V	&void_type_node
+#define T89_V	{ STD_C89, NULL, T_V }
+#define T_W	&wchar_type_node
+#define T94_W	{ STD_C94, "wchar_t", T_W }
+#define TEX_W	{ STD_EXT, "wchar_t", T_W }
+#define T_WI	&wint_type_node
+#define T94_WI	{ STD_C94, "wint_t", T_WI }
+#define TEX_WI	{ STD_EXT, "wint_t", T_WI }
+#define T_ST    &size_type_node
+#define T99_ST	{ STD_C99, "size_t", T_ST }
+#define T_SST   &signed_size_type_node
+#define T99_SST	{ STD_C99, "signed size_t", T_SST }
+#define T_PD    &ptrdiff_type_node
+#define T99_PD	{ STD_C99, "ptrdiff_t", T_PD }
+#define T_UPD   &unsigned_ptrdiff_type_node
+#define T99_UPD	{ STD_C99, "unsigned ptrdiff_t", T_UPD }
+#define T_IM    &intmax_type_node
+#define T99_IM	{ STD_C99, "intmax_t", T_IM }
+#define T_UIM   &uintmax_type_node
+#define T99_UIM	{ STD_C99, "uintmax_t", T_UIM }
+
+#endif /* GCC_C_FORMAT_H */
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/c-objc-common.c /export/home/mark/src/gcc-3.4.2/gcc/c-objc-common.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/c-objc-common.c	2004-02-08 15:12:17.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/c-objc-common.c	2004-09-20 16:59:51.921869000 -0700
@@ -38,6 +38,7 @@ Software Foundation, 59 Temple Place - S
 #include "langhooks.h"
 #include "target.h"
 #include "cgraph.h"
+#include "c-pragma.h"
 
 static bool c_tree_printer (pretty_printer *, text_info *);
 static tree start_cdtor (int);
@@ -266,6 +267,8 @@ c_objc_common_finish_file (void)
       finish_cdtor (body);
     }
 
+  maybe_apply_pending_pragma_weaks ();
+
   {
     int flags;
     FILE *stream = dump_begin (TDI_all, &flags);
@@ -332,3 +335,10 @@ c_tree_printer (pretty_printer *pp, text
   pp_string (pp, n);
   return true;
 }
+
+/* In C and ObjC, all decls have "C" linkage.  */
+bool
+has_c_linkage (tree decl ATTRIBUTE_UNUSED)
+{
+  return true;
+}
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/c-pragma.c /export/home/mark/src/gcc-3.4.2/gcc/c-pragma.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/c-pragma.c	2004-05-07 00:07:30.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/c-pragma.c	2004-09-20 16:59:51.931253000 -0700
@@ -34,6 +34,7 @@ Software Foundation, 59 Temple Place - S
 #include "c-common.h"
 #include "output.h"
 #include "tm_p.h"
+#include "target.h"
 
 #define GCC_BAD(msgid) do { warning (msgid); return; } while (0)
 #define GCC_BAD2(msgid, arg) do { warning (msgid, arg); return; } while (0)
@@ -312,6 +313,33 @@ maybe_apply_pragma_weak (tree decl)
       }
 }
 
+/* Process all "#pragma weak A = B" directives where we have not seen
+   a decl for A.  */
+void
+maybe_apply_pending_pragma_weaks (void)
+{
+  tree *p, t, alias_id, id, decl, *next;
+
+  for (p = &pending_weaks; (t = *p) ; p = next)
+    {
+      next = &TREE_CHAIN (t);
+      alias_id = TREE_PURPOSE (t);
+      id = TREE_VALUE (t);
+
+      if (TREE_VALUE (t) == NULL)
+	continue;
+
+      decl = build_decl (FUNCTION_DECL, alias_id, default_function_type);
+
+      DECL_ARTIFICIAL (decl) = 1;
+      TREE_PUBLIC (decl) = 1;
+      DECL_EXTERNAL (decl) = 1;
+      DECL_WEAK (decl) = 1;
+
+      assemble_alias (decl, id);
+    }
+}
+
 /* #pragma weak name [= value] */
 static void
 handle_pragma_weak (cpp_reader *dummy ATTRIBUTE_UNUSED)
@@ -348,6 +376,11 @@ void
 maybe_apply_pragma_weak (tree decl ATTRIBUTE_UNUSED)
 {
 }
+
+void
+maybe_apply_pending_pragma_weaks (void)
+{
+}
 #endif /* HANDLE_PRAGMA_WEAK */
 
 static GTY(()) tree pending_redefine_extname;
@@ -429,65 +462,104 @@ handle_pragma_extern_prefix (cpp_reader 
 tree
 maybe_apply_renaming_pragma (tree decl, tree asmname)
 {
-  tree oldname;
+  tree *p, t;
 
-  /* Copied from the check in set_decl_assembler_name.  */
-  if (TREE_CODE (decl) == FUNCTION_DECL
-      || (TREE_CODE (decl) == VAR_DECL 
-          && (TREE_STATIC (decl) 
-              || DECL_EXTERNAL (decl) 
-              || TREE_PUBLIC (decl))))
-    oldname = DECL_ASSEMBLER_NAME (decl);
-  else
+  /* The renaming pragmas are only applied to declarations with
+     external linkage.  */
+  if ((TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL)
+      || (!TREE_PUBLIC (decl) && !DECL_EXTERNAL (decl))
+      || !has_c_linkage (decl))
     return asmname;
 
-  /* If the name begins with a *, that's a sign of an asmname attached to
-     a previous declaration.  */
-  if (IDENTIFIER_POINTER (oldname)[0] == '*')
-    {
-      const char *oldasmname = IDENTIFIER_POINTER (oldname) + 1;
-      if (asmname && strcmp (TREE_STRING_POINTER (asmname), oldasmname) != 0)
-	warning ("asm declaration conflicts with previous rename");
-      asmname = build_string (strlen (oldasmname), oldasmname);
+  /* If the DECL_ASSEMBLER_NAME is already set, it does not change,
+     but we may warn about a rename that conflicts.  */
+  if (DECL_ASSEMBLER_NAME_SET_P (decl))
+    {
+      const char *oldname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+      oldname = targetm.strip_name_encoding (oldname);
+
+      if (asmname && strcmp (TREE_STRING_POINTER (asmname), oldname))
+	  warning ("asm declaration ignored due to "
+		   "conflict with previous rename");
+
+      /* Take any pending redefine_extname off the list.  */
+      for (p = &pending_redefine_extname; (t = *p); p = &TREE_CHAIN (t))
+	if (DECL_NAME (decl) == TREE_PURPOSE (t))
+	  {
+	    /* Only warn if there is a conflict.  */
+	    if (strcmp (IDENTIFIER_POINTER (TREE_VALUE (t)), oldname))
+	      warning ("#pragma redefine_extname ignored due to "
+		       "conflict with previous rename");
+
+	    *p = TREE_CHAIN (t);
+	    break;
+	  }
+      return 0;
     }
 
-  {
-    tree *p, t;
+  /* Find out if we have a pending #pragma redefine_extname.  */
+  for (p = &pending_redefine_extname; (t = *p); p = &TREE_CHAIN (t))
+    if (DECL_NAME (decl) == TREE_PURPOSE (t))
+      {
+	tree newname = TREE_VALUE (t);
+	*p = TREE_CHAIN (t);
 
-    for (p = &pending_redefine_extname; (t = *p) ; p = &TREE_CHAIN (t))
-      if (oldname == TREE_PURPOSE (t))
-	{
-	  const char *newname = IDENTIFIER_POINTER (TREE_VALUE (t));
+	/* If we already have an asmname, #pragma redefine_extname is
+ 	   ignored (with a warning if it conflicts).  */
+	if (asmname)
+	  {
+	    if (strcmp (TREE_STRING_POINTER (asmname),
+			IDENTIFIER_POINTER (newname)) != 0)
+	      warning ("#pragma redefine_extname ignored due to "
+		       "conflict with __asm__ declaration");
+	    return asmname;
+	  }
 
-	  if (asmname && strcmp (TREE_STRING_POINTER (asmname), newname) != 0)
-            warning ("#pragma redefine_extname conflicts with declaration");
-	  *p = TREE_CHAIN (t);
+	/* Otherwise we use what we've got; #pragma extern_prefix is
+	   silently ignored.  */
+	return build_string (IDENTIFIER_LENGTH (newname),
+			     IDENTIFIER_POINTER (newname));
+      }
 
-	  return build_string (strlen (newname), newname);
-	}
-  }
+  /* If we've got an asmname, #pragma extern_prefix is silently ignored.  */
+  if (asmname)
+    return asmname;
 
-#ifdef HANDLE_PRAGMA_EXTERN_PREFIX
-  if (pragma_extern_prefix && !asmname)
+  /* If #pragma extern_prefix is in effect, apply it.  */
+  if (pragma_extern_prefix)
     {
-      char *x = concat (TREE_STRING_POINTER (pragma_extern_prefix),
-			IDENTIFIER_POINTER (oldname), NULL);
-      asmname = build_string (strlen (x), x);
-      free (x);
-      return asmname;
+      const char *prefix = TREE_STRING_POINTER (pragma_extern_prefix);
+      size_t plen = TREE_STRING_LENGTH (pragma_extern_prefix) - 1;
+
+      const char *id = IDENTIFIER_POINTER (DECL_NAME (decl));
+      size_t ilen = IDENTIFIER_LENGTH (DECL_NAME (decl));
+	
+      char *newname = (char *) alloca (plen + ilen + 1);
+
+      memcpy (newname,        prefix, plen);
+      memcpy (newname + plen, id, ilen + 1);
+
+      return build_string (plen + ilen, newname);
     }
-#endif
 
-  return asmname;
+  /* Nada.  */
+  return 0;
 }
 
-/* Front-end wrapper for pragma registration to avoid dragging
+/* Front-end wrappers for pragma registration to avoid dragging
    cpplib.h in almost everywhere.  */
 void
 c_register_pragma (const char *space, const char *name,
 		   void (*handler) (struct cpp_reader *))
 {
-  cpp_register_pragma (parse_in, space, name, handler);
+  cpp_register_pragma (parse_in, space, name, handler, 0);
+}
+
+void
+c_register_pragma_with_expansion (const char *space, const char *name,
+				  void (*handler) (struct cpp_reader *))
+{
+  cpp_register_pragma (parse_in, space, name, handler, 1);
 }
 
 /* Set up front-end pragmas.  */
@@ -495,8 +567,12 @@ void
 init_pragma (void)
 {
 #ifdef HANDLE_PRAGMA_PACK
+#ifdef HANDLE_PRAGMA_PACK_WITH_EXPANSION
+  c_register_pragma_with_expansion (0, "pack", handle_pragma_pack);
+#else
   c_register_pragma (0, "pack", handle_pragma_pack);
 #endif
+#endif
 #ifdef HANDLE_PRAGMA_WEAK
   c_register_pragma (0, "weak", handle_pragma_weak);
 #endif
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/c-pragma.h /export/home/mark/src/gcc-3.4.2/gcc/c-pragma.h
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/c-pragma.h	2004-01-30 22:18:05.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/c-pragma.h	2004-09-20 16:59:51.931752000 -0700
@@ -46,11 +46,14 @@ extern struct cpp_reader* parse_in;
 
 extern void init_pragma (void);
 
-/* Front-end wrapper for pragma registration to avoid dragging
+/* Front-end wrappers for pragma registration to avoid dragging
    cpplib.h in almost everywhere.  */
 extern void c_register_pragma (const char *, const char *,
 			       void (*) (struct cpp_reader *));
+extern void c_register_pragma_with_expansion (const char *, const char *,
+					      void (*) (struct cpp_reader *));
 extern void maybe_apply_pragma_weak (tree);
+extern void maybe_apply_pending_pragma_weaks (void);
 extern tree maybe_apply_renaming_pragma (tree, tree);
 extern void add_to_renaming_pragma_list (tree, tree);
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/config/i386/i386-protos.h /export/home/mark/src/gcc-3.4.2/gcc/config/i386/i386-protos.h
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/config/i386/i386-protos.h	2004-02-10 10:07:58.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/config/i386/i386-protos.h	2004-09-20 16:59:51.935459000 -0700
@@ -211,6 +211,7 @@ extern tree ix86_handle_shared_attribute
 extern unsigned int i386_pe_section_type_flags (tree, const char *, int);
 extern void i386_pe_asm_named_section (const char *, unsigned int);
 extern int x86_field_alignment (tree, int);
+extern void i386_solaris_elf_named_section (const char *, unsigned int);
 #endif
 
 extern rtx ix86_tls_get_addr (void);
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/config/i386/i386.c /export/home/mark/src/gcc-3.4.2/gcc/config/i386/i386.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/config/i386/i386.c	2004-08-24 22:19:08.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/config/i386/i386.c	2004-09-20 19:04:23.058353000 -0700
@@ -1023,6 +1023,11 @@ static void init_ext_80387_constants (vo
 #undef TARGET_BUILD_BUILTIN_VA_LIST
 #define TARGET_BUILD_BUILTIN_VA_LIST ix86_build_builtin_va_list
 
+#ifdef SUBTARGET_INSERT_ATTRIBUTES
+#undef TARGET_INSERT_ATTRIBUTES
+#define TARGET_INSERT_ATTRIBUTES SUBTARGET_INSERT_ATTRIBUTES
+#endif
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* The svr4 ABI for the i386 says that records and unions are returned
@@ -1044,6 +1049,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
 
@@ -1139,6 +1146,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)
@@ -1160,14 +1171,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";
 
@@ -1251,7 +1261,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");
+	  }
 
 	/* Intel CPUs have always interpreted SSE prefetch instructions as
 	   NOPs; so, we can enable SSE prefetch instructions even when
@@ -1534,6 +1557,9 @@ const struct attribute_spec ix86_attribu
 #endif
   { "ms_struct", 0, 0, false, false,  false, ix86_handle_struct_attribute },
   { "gcc_struct", 0, 0, false, false,  false, ix86_handle_struct_attribute },
+#ifdef SUBTARGET_ATTRIBUTE_TABLE
+  SUBTARGET_ATTRIBUTE_TABLE,
+#endif
   { NULL,        0, 0, false, false, false, NULL }
 };
 
@@ -16025,4 +16051,19 @@ ix86_expand_vector_init (rtx target, rtx
     }
 }
 
+void
+i386_solaris_elf_named_section (const char *name, unsigned int flags)
+{
+  /* The "@unwind" marker must be specified on every occurrence of the
+     ".eh_frame" section, not just the first one.  */
+  if (TARGET_64BIT
+      && strcmp (name, ".eh_frame") == 0)
+    {
+      fprintf (asm_out_file, "\t.section\t%s,\"%s\",@unwind\n", name,
+	       flags & SECTION_WRITE ? "aw" : "a");
+      return;
+    }
+  default_elf_asm_named_section (name, flags);
+}
+
 #include "gt-i386.h"
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/config/i386/sol2-10.h /export/home/mark/src/gcc-3.4.2/gcc/config/i386/sol2-10.h
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/config/i386/sol2-10.h	1969-12-31 16:00:00.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/config/i386/sol2-10.h	2004-09-21 23:24:09.152987000 -0700
@@ -0,0 +1,113 @@
+/* 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.  */
+
+/* The Solaris 2.10 headers expect _LONGLONG_TYPE to be defined if
+  "long long" is recognized by the compiler.  */
+#undef TARGET_SUB_OS_CPP_BUILTINS
+#define TARGET_SUB_OS_CPP_BUILTINS()		\
+  do {						\
+    builtin_define ("_LONGLONG_TYPE");		\
+  } while (0)
+
+#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
+
+#undef WINT_TYPE
+#define WINT_TYPE (TARGET_64BIT ? "int" : "long int")
+#undef WINT_TYPE_SIZE
+#define WINT_TYPE_SIZE 32
+
+#define SUBTARGET_OVERRIDE_OPTIONS				\
+  do								\
+    {								\
+      if (flag_omit_frame_pointer == 2)				\
+	flag_omit_frame_pointer = 0;				\
+    }								\
+  while (0)
+
+#undef TARGET_SUBTARGET_DEFAULT
+#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP	\
+				  | MASK_FLOAT_RETURNS		\
+				  | MASK_OMIT_LEAF_FRAME_POINTER)
+
+#define MULTILIB_DEFAULTS { "m32" }
+
+#undef LINK_ARCH64_SPEC_BASE
+#define LINK_ARCH64_SPEC_BASE \
+  "%{G:-G} \
+   %{YP,*} \
+   %{R*} \
+   %{compat-bsd: \
+     %{!YP,*:%{p|pg:-Y P,/usr/ucblib/64:/usr/lib/libp/64:/lib/64:/usr/lib/64} \
+             %{!p:%{!pg:-Y P,/usr/ucblib/64:/lib:/usr/lib/64}}} \
+             -R /usr/ucblib/64} \
+   %{!compat-bsd: \
+     %{!YP,*:%{p|pg:-Y P,/usr/lib/libp/64:/lib/64:/usr/lib/64} \
+             %{!p:%{!pg:-Y P,/lib/64:/usr/lib/64}}}}"
+
+#undef LINK_ARCH64_SPEC
+#define LINK_ARCH64_SPEC LINK_ARCH64_SPEC_BASE
+
+#ifdef TARGET_GNU_LD
+#define TARGET_LD_EMULATION "%{m64:-m elf_x86_64}%{!m64:-m elf_i386} "
+#else
+#define TARGET_LD_EMULATION ""
+#endif
+
+#undef LINK_ARCH_SPEC
+#define LINK_ARCH_SPEC TARGET_LD_EMULATION \
+		       "%{m64:" LINK_ARCH64_SPEC "}%{!m64:" LINK_ARCH32_SPEC "}"
+
+#undef TARGET_ASM_NAMED_SECTION
+#define TARGET_ASM_NAMED_SECTION i386_solaris_elf_named_section
+
+/* In 32-bit mode, follow the SVR4 ABI definition; in 64-bit mode, use
+   the AMD64 ABI definition.  */
+#undef RETURN_IN_MEMORY
+#define RETURN_IN_MEMORY(TYPE)			\
+  (TARGET_64BIT 				\
+   ? ix86_return_in_memory (TYPE)		\
+   : (TYPE_MODE (TYPE) == BLKmode		\
+      || (VECTOR_MODE_P (TYPE_MODE (TYPE)) 	\
+	  && int_size_in_bytes (TYPE) == 8)))
+
+/* The following can use target preprocessor macros, because it is only used
+   by crtstuff.c.  */
+
+/* If the Solaris dynamic linker will automatically register .eh_frame_hdr
+   from the program header, we can define this to avoid duplicate
+   registration.  */
+/* #define USE_PT_GNU_EH_FRAME */
+
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/config/i386/sol2.h /export/home/mark/src/gcc-3.4.2/gcc/config/i386/sol2.h
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/config/i386/sol2.h	2004-06-14 10:34:11.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/config/i386/sol2.h	2004-09-20 16:59:52.035385000 -0700
@@ -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).
 
@@ -30,12 +31,13 @@ Boston, MA 02111-1307, USA.  */
    it knows what it is doing.  */
 #define FORCE_CODE_SECTION_ALIGN  asm(ALIGN_ASM_OP "16");
 
-/* Select a format to encode pointers in exception handling data.  CODE
-   is 0 for data, 1 for code labels, 2 for function pointers.  GLOBAL is
-   true if the symbol may be affected by dynamic relocations.  */
+/* Old versions of the Solaris assembler can not handle the difference of
+   labels in different sections, so force DW_EH_PE_datarel.  */
 #undef ASM_PREFERRED_EH_DATA_FORMAT
 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)			\
-  (flag_pic ? (GLOBAL ? DW_EH_PE_indirect : 0) | DW_EH_PE_datarel	\
+  (flag_pic ? ((GLOBAL ? DW_EH_PE_indirect : 0)				\
+	       | (TARGET_64BIT ? DW_EH_PE_pcrel | DW_EH_PE_sdata4	\
+		  : DW_EH_PE_datarel))					\
    : DW_EH_PE_absptr)
 
 /* Solaris 2/Intel as chokes on #line directives.  */
@@ -62,8 +64,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)	\
@@ -79,3 +83,18 @@ Boston, MA 02111-1307, USA.  */
 	fprintf ((FILE), "\n");				\
       }							\
   } while (0)
+
+/* Solaris-specific #pragmas are implemented on top of attributes.  Hook in
+   the bits from config/sol2.c.  */
+#define SUBTARGET_INSERT_ATTRIBUTES solaris_insert_attributes
+#define SUBTARGET_ATTRIBUTE_TABLE SOLARIS_ATTRIBUTE_TABLE
+
+/* Output a simple call for .init/.fini.  */
+#define ASM_OUTPUT_CALL(FILE, FN)				\
+  do								\
+    {								\
+      fprintf (FILE, "\tcall\t");				\
+      print_operand (FILE, XEXP (DECL_RTL (FN), 0), 'P');	\
+      fprintf (FILE, "\n");					\
+    }								\
+  while (0)
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/config/i386/t-sol2 /export/home/mark/src/gcc-3.4.2/gcc/config/i386/t-sol2
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/config/i386/t-sol2	2001-05-16 20:15:56.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/config/i386/t-sol2	2004-09-20 16:59:52.043808000 -0700
@@ -1,24 +1,24 @@
 # gmon build rule:
-gmon.o:	$(srcdir)/config/i386/gmon-sol2.c $(GCC_PASSES) $(CONFIG_H)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) \
-		-c $(srcdir)/config/i386/gmon-sol2.c -o gmon.o
+$(T)gmon.o:	$(srcdir)/config/i386/gmon-sol2.c $(GCC_PASSES) $(CONFIG_H)
+	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) \
+		-c $(srcdir)/config/i386/gmon-sol2.c -o $(T)gmon.o
 
 # Assemble startup files.
 # Apparently Sun believes that assembler files don't need comments, because no
 # single ASCII character is valid (tried them all).  So we manually strip out
 # the comments with sed.  This bug may only be in the Early Access releases.
-gcrt1.o: $(srcdir)/config/i386/sol2-gc1.asm
+$(T)gcrt1.o: $(srcdir)/config/i386/sol2-gc1.asm $(GCC_PASSES)
 	sed -e '/^!/d' <$(srcdir)/config/i386/sol2-gc1.asm >gcrt1.s
-	$(AS) -o gcrt1.o gcrt1.s
-crt1.o: $(srcdir)/config/i386/sol2-c1.asm $(GCC_PASSES)
+	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)gcrt1.o gcrt1.s
+$(T)crt1.o: $(srcdir)/config/i386/sol2-c1.asm $(GCC_PASSES)
 	sed -e '/^!/d' <$(srcdir)/config/i386/sol2-c1.asm >crt1.s
-	$(GCC_FOR_TARGET) -c -o crt1.o crt1.s
-crti.o: $(srcdir)/config/i386/sol2-ci.asm $(GCC_PASSES)
+	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crt1.o crt1.s
+$(T)crti.o: $(srcdir)/config/i386/sol2-ci.asm $(GCC_PASSES)
 	sed -e '/^!/d' <$(srcdir)/config/i386/sol2-ci.asm >crti.s
-	$(GCC_FOR_TARGET) -c -o crti.o crti.s
-crtn.o: $(srcdir)/config/i386/sol2-cn.asm $(GCC_PASSES)
+	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crti.o crti.s
+$(T)crtn.o: $(srcdir)/config/i386/sol2-cn.asm $(GCC_PASSES)
 	sed -e '/^!/d' <$(srcdir)/config/i386/sol2-cn.asm >crtn.s
-	$(GCC_FOR_TARGET) -c -o crtn.o crtn.s
+	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o crtn.s
 
 # We need to use -fPIC when we are using gcc to compile the routines in
 # crtstuff.c.  This is only really needed when we are going to use gcc/g++
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/config/i386/t-sol2-10 /export/home/mark/src/gcc-3.4.2/gcc/config/i386/t-sol2-10
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/config/i386/t-sol2-10	1969-12-31 16:00:00.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/config/i386/t-sol2-10	2004-09-20 16:59:52.044309000 -0700
@@ -0,0 +1,11 @@
+MULTILIB_OPTIONS = m32/m64
+MULTILIB_DIRNAMES = 32 64
+MULTILIB_OSDIRNAMES = . 64
+
+LIBGCC = stmp-multilib
+INSTALL_LIBGCC = install-multilib
+
+# GCC contains i386 assembler sources for some of the startfiles
+# which aren't appropriate for amd64.  Just use the installed
+# versions of: crt1.o crti.o crtn.o gcrt1.o
+EXTRA_MULTILIB_PARTS=gmon.o crtbegin.o crtend.o
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/config/sol2-c.c /export/home/mark/src/gcc-3.4.2/gcc/config/sol2-c.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/config/sol2-c.c	1969-12-31 16:00:00.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/config/sol2-c.c	2004-09-21 18:58:10.080096000 -0700
@@ -0,0 +1,275 @@
+/* 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 "tree.h"
+#include "tm.h"
+#include "tm_p.h"
+#include "toplev.h"
+
+#include "c-format.h"
+#include "intl.h"
+
+#include "cpplib.h"
+#include "c-pragma.h"
+#include "c-common.h"
+
+/* 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 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 }
+};
+
+static const format_char_info bitfield_string_type =
+  { "b",   1, STD_C89, { T89_C,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "cR", 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",  "",   NULL },
+  { "oOxX",0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "w",  "",   NULL },
+  { "u",   0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "w",  "",   NULL },
+  { "c",   0, STD_C89, { T89_C,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "w",  "",   NULL },
+  { "p",   1, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "w", "c",  NULL },
+  { "s",   1, STD_C89, { T89_C,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "w",  "cR", NULL },
+  { "b",   0, STD_C89, { T89_I,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   &bitfield_string_type },
+  { NULL,  0, 0, NOLENGTHS, NULL, NULL, NULL }
+};
+
+const format_kind_info solaris_format_types[] = {
+  { "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
+  }
+};
+
+/* Handle #pragma align ALIGNMENT (VAR [, VAR]...)  */
+
+static 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')
+	{
+	  decl_attributes (&decl, build_tree_list (get_identifier ("aligned"),
+						   build_tree_list (NULL, x)),
+			   0);
+	}
+      else
+	solaris_pending_aligns = tree_cons (t, build_tree_list (NULL, x),
+					    solaris_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]...)  */
+
+static 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
+	solaris_pending_inits = tree_cons (t, NULL, solaris_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]...)  */
+
+static 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
+	solaris_pending_finis = tree_cons (t, NULL, solaris_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;
+	}
+    }
+}
+
+/* Register Solaris-specific #pragma directives.  */
+
+void
+solaris_register_pragmas (void)
+{
+  c_register_pragma_with_expansion (0, "align", solaris_pragma_align);
+  c_register_pragma (0, "init", solaris_pragma_init);
+  c_register_pragma (0, "fini", solaris_pragma_fini);
+}
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/config/sol2-protos.h /export/home/mark/src/gcc-3.4.2/gcc/config/sol2-protos.h
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/config/sol2-protos.h	1969-12-31 16:00:00.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/config/sol2-protos.h	2004-09-20 16:59:52.045862000 -0700
@@ -0,0 +1,24 @@
+/* Operating system specific prototypes to be used when targeting GCC for any
+   Solaris 2 system.
+   Copyright 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_register_pragmas (void);
+extern void solaris_output_init_fini (FILE *, tree);
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/config/sol2.c /export/home/mark/src/gcc-3.4.2/gcc/config/sol2.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/config/sol2.c	1969-12-31 16:00:00.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/config/sol2.c	2004-09-20 16:59:52.046399000 -0700
@@ -0,0 +1,119 @@
+/* General Solaris system support.
+   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 "tree.h"
+#include "tm.h"
+#include "rtl.h"
+#include "tm_p.h"
+#include "toplev.h"
+#include "ggc.h"
+
+tree solaris_pending_aligns, solaris_pending_inits, solaris_pending_finis;
+
+/* Attach any pending attributes for DECL to the list in *ATTRIBUTES.
+   Pending attributes come from #pragma or _Pragma, so this code is
+   only useful in the C family front ends, but it is included in
+   all languages to avoid changing the target machine initializer
+   depending on the language.  */
+
+void
+solaris_insert_attributes (tree decl, tree *attributes)
+{
+  tree *x, next;
+
+  if (solaris_pending_aligns != NULL && TREE_CODE (decl) == VAR_DECL)
+    for (x = &solaris_pending_aligns; *x; x = &TREE_CHAIN (*x))
+      {
+	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 (solaris_pending_inits != NULL && TREE_CODE (decl) == FUNCTION_DECL)
+    for (x = &solaris_pending_inits; *x; x = &TREE_CHAIN (*x))
+      {
+	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 (solaris_pending_finis != NULL && TREE_CODE (decl) == FUNCTION_DECL)
+    for (x = &solaris_pending_finis; *x; x = &TREE_CHAIN (*x))
+      {
+	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.pushsection\t\".init\"\n");
+      ASM_OUTPUT_CALL (file, decl);
+      fprintf (file, "\t.popsection\n");
+    }
+
+  if (lookup_attribute ("fini", DECL_ATTRIBUTES (decl)))
+    {
+      fprintf (file, "\t.pushsection\t\".fini\"\n");
+      ASM_OUTPUT_CALL (file, decl);
+      fprintf (file, "\t.popsection\n");
+    }
+}
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/config/sol2.h /export/home/mark/src/gcc-3.4.2/gcc/config/sol2.h
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/config/sol2.h	2004-07-17 14:18:56.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/config/sol2.h	2004-09-21 14:39:26.098657000 -0700
@@ -1,6 +1,6 @@
 /* Operating system specific defines to be used when targeting GCC for any
    Solaris 2 system.
-   Copyright 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -53,6 +53,98 @@ Boston, MA 02111-1307, USA.  */
 "
 
 /* Names to predefine in the preprocessor for this target machine.  */
+#define TARGET_SUB_OS_CP/* Target definitions for GCC for Intel 80386 running Solaris 2
+   Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+   2004
+   Free Software Foundation, Inc.
+   Contributed by Fred Fish (fnf@cygnus.com).
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* The Solaris 2.0 x86 linker botches alignment of code sections.
+   It tries to align to a 16 byte boundary by padding with 0x00000090
+   ints, rather than 0x90 bytes (nop).  This generates trash in the
+   ".init" section since the contribution from crtbegin.o is only 7
+   bytes.  The linker pads it to 16 bytes with a single 0x90 byte, and
+   two 0x00000090 ints, which generates a segmentation violation when
+   executed.  This macro forces the assembler to do the padding, since
+   it knows what it is doing.  */
+#define FORCE_CODE_SECTION_ALIGN  asm(ALIGN_ASM_OP "16");
+
+/* Old versions of the Solaris assembler can not handle the difference of
+   labels in different sections, so force DW_EH_PE_datarel.  */
+#undef ASM_PREFERRED_EH_DATA_FORMAT
+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)			\
+  (flag_pic ? ((GLOBAL ? DW_EH_PE_indirect : 0)				\
+	       | (TARGET_64BIT ? DW_EH_PE_pcrel | DW_EH_PE_sdata4	\
+		  : DW_EH_PE_datarel))					\
+   : DW_EH_PE_absptr)
+
+/* Solaris 2/Intel as chokes on #line directives.  */
+#undef CPP_SPEC
+#define CPP_SPEC "%{.S:-P} %(cpp_subtarget)"
+
+/* FIXME: Removed -K PIC from generic Solaris 2 ASM_SPEC: the native assembler
+   gives many warnings: R_386_32 relocation is used for symbol ".text".  */
+#undef ASM_SPEC
+#define ASM_SPEC "\
+%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s \
+%(asm_cpu) \
+"
+
+#define ASM_CPU_SPEC ""
+ 
+#undef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
+  { "cpp_subtarget",	CPP_SUBTARGET_SPEC },	\
+  { "asm_cpu",		ASM_CPU_SPEC },		\
+  { "startfile_arch",	STARTFILE_ARCH_SPEC },	\
+  { "link_arch",	LINK_ARCH_SPEC }
+
+#undef LOCAL_LABEL_PREFIX
+#define LOCAL_LABEL_PREFIX "."
+
+/* 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)	\
+  do {							\
+    const char *declname =				\
+      IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL));	\
+    ASM_OUTPUT_DEF ((FILE), declname,			\
+		    IDENTIFIER_POINTER (TARGET));	\
+    if (! TREE_PUBLIC (DECL))				\
+      {							\
+	fprintf ((FILE), "%s", LOCAL_ASM_OP);		\
+	assemble_name ((FILE), declname);		\
+	fprintf ((FILE), "\n");				\
+      }							\
+  } while (0)
+
+/* Solaris-specific #pragmas are implemented on top of attributes.  Hook in
+   the bits from config/sol2.c.  */
+#define SUBTARGET_INSERT_ATTRIBUTES solaris_insert_attributes
+#define SUBTARGET_ATTRIBUTE_TABLE SOLARIS_ATTRIBUTE_TABLE
+
+/* Names to predefine in the preprocessor for this target machine.  */
 #define TARGET_SUB_OS_CPP_BUILTINS()
 #define TARGET_OS_CPP_BUILTINS()			\
     do {						\
@@ -73,6 +165,11 @@ Boston, MA 02111-1307, USA.  */
 	    builtin_define ("_LARGEFILE64_SOURCE=1");	\
 	    builtin_define ("__EXTENSIONS__");		\
 	  }						\
+	if (flag_pic)					\
+	  {						\
+	    builtin_define ("__PIC__");			\
+	    builtin_define ("__pic__");			\
+	  }						\
 	TARGET_SUB_OS_CPP_BUILTINS();			\
     } while (0)
 
@@ -149,6 +246,12 @@ Boston, MA 02111-1307, USA.  */
    %(link_arch) \
    %{Qy:} %{!Qn:-Qy}"
 
+/* The Solaris linker doesn't understand constructor priorities.  (The
+   GNU linker does support constructor priorities, so GNU ld
+   configuration files for Solaris override this setting.)  */
+#undef SUPPORTS_INIT_PRIORITY
+#define SUPPORTS_INIT_PRIORITY 0
+
 /* This defines which switch letters take arguments.
    It is as in svr4.h but with -R added.  */
 #undef SWITCH_TAKES_ARG
@@ -206,3 +309,35 @@ __enable_execute_stack (void *addr)					
       perror ("mprotect of trampoline code");				\
   }									\
 }
+
+/* Support Solaris-specific format checking for cmn_err.  */
+#define TARGET_N_FORMAT_TYPES 1
+#define TARGET_FORMAT_TYPES solaris_format_types
+
+/* #pragma init and #pragma fini are implemented on top of init and
+   fini attributes.  */
+#define SOLARIS_ATTRIBUTE_TABLE						\
+  { "init",      0, 0, true,  false,  false, NULL },			\
+  { "fini",      0, 0, true,  false,  false, NULL }
+
+/* This is how to declare the size of a function.  For Solaris, we output
+   any .init or .fini entries here.  */
+#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)
+
+/* Register the Solaris-specific #pragma directives.  */
+#define REGISTER_TARGET_PRAGMAS() solaris_register_pragmas ()
+
+extern GTY(()) tree solaris_pending_aligns;
+extern GTY(()) tree solaris_pending_inits;
+extern GTY(()) tree solaris_pending_finis;
+
+/* Allow macro expansion in #pragma pack.  */
+#define HANDLE_PRAGMA_PACK_WITH_EXPANSION
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/config/sparc/elf.h /export/home/mark/src/gcc-3.4.2/gcc/config/sparc/elf.h
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/config/sparc/elf.h	2003-10-01 17:44:28.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/config/sparc/elf.h	2004-09-20 16:59:52.067394000 -0700
@@ -48,3 +48,17 @@ Boston, MA 02111-1307, USA.  */
 
 #undef SUN_INTEGER_MULTIPLY_64
 #define SUN_INTEGER_MULTIPLY_64 0
+
+/* Don't include Solaris-specific format checks.  */
+#undef TARGET_N_FORMAT_TYPES
+#undef TARGET_FORMAT_TYPES
+
+/* Don't include Solaris-specific .init / .fini support.  */
+#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);			\
+    }								\
+  while (0)
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/config/sparc/sol2.h /export/home/mark/src/gcc-3.4.2/gcc/config/sparc/sol2.h
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/config/sparc/sol2.h	2004-04-01 08:13:07.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/config/sparc/sol2.h	2004-09-20 16:59:52.076393000 -0700
@@ -131,9 +131,6 @@ Boston, MA 02111-1307, USA.  */
   ((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr)
 #endif
 
-/* The Solaris linker doesn't understand constructor priorities.  */
-#undef SUPPORTS_INIT_PRIORITY
-#define SUPPORTS_INIT_PRIORITY 0
 
 /* ??? This does not work in SunOS 4.x, so it is not enabled in sparc.h.
    Instead, it is enabled here, because it does work under Solaris.  */
@@ -163,3 +160,18 @@ Boston, MA 02111-1307, USA.  */
    sparc_override_options will disable V8+ if not generating V9 code.  */
 #undef TARGET_DEFAULT
 #define TARGET_DEFAULT (MASK_V8PLUS + MASK_FPU + MASK_LONG_DOUBLE_128)
+
+/* Solaris-specific #pragmas are implemented on top of attributes.  Hook in
+   the bits from config/sol2.c.  */
+#define SUBTARGET_INSERT_ATTRIBUTES solaris_insert_attributes
+#define SUBTARGET_ATTRIBUTE_TABLE SOLARIS_ATTRIBUTE_TABLE
+
+/* Output a simple call for .init/.fini.  */
+#define ASM_OUTPUT_CALL(FILE, NAME)			        \
+  do								\
+    {								\
+      fprintf (FILE, "\tcall\t");				\
+      print_operand (FILE, XEXP (DECL_RTL (FN), 0), 0);	\
+      fprintf (FILE, "\n\tnop\n");				\
+    }								\
+  while (0)
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/config/sparc/sp64-elf.h /export/home/mark/src/gcc-3.4.2/gcc/config/sparc/sp64-elf.h
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/config/sparc/sp64-elf.h	2003-06-16 18:00:43.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/config/sparc/sp64-elf.h	2004-09-20 16:59:52.080982000 -0700
@@ -122,3 +122,17 @@ crtbegin.o%s \
 
 #undef PREFERRED_DEBUGGING_TYPE
 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+
+/* Don't include Solaris-specific format checks.  */
+#undef TARGET_N_FORMAT_TYPES
+#undef TARGET_FORMAT_TYPES
+
+/* Don't include Solaris-specific .init / .fini support.  */
+#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);			\
+    }								\
+  while (0)
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/config/sparc/sparc.c /export/home/mark/src/gcc-3.4.2/gcc/config/sparc/sparc.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/config/sparc/sparc.c	2004-07-17 14:18:57.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/config/sparc/sparc.c	2004-09-20 16:59:52.120927000 -0700
@@ -194,6 +194,9 @@ static rtx sparc_tls_got (void);
 static const char *get_some_local_dynamic_name (void);
 static int get_some_local_dynamic_name_1 (rtx *, void *);
 static bool sparc_rtx_costs (rtx, int, int, int *);
+#ifdef SUBTARGET_ATTRIBUTE_TABLE
+const struct attribute_spec sparc_attribute_table[];
+#endif
 
 /* Option handling.  */
 
@@ -277,6 +280,16 @@ enum processor_type sparc_cpu;
 #undef TARGET_ADDRESS_COST
 #define TARGET_ADDRESS_COST hook_int_rtx_0
 
+#ifdef SUBTARGET_INSERT_ATTRIBUTES
+#undef TARGET_INSERT_ATTRIBUTES
+#define TARGET_INSERT_ATTRIBUTES SUBTARGET_INSERT_ATTRIBUTES
+#endif
+
+#ifdef SUBTARGET_ATTRIBUTE_TABLE
+#undef TARGET_ATTRIBUTE_TABLE
+#define TARGET_ATTRIBUTE_TABLE sparc_attribute_table
+#endif
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Validate and override various options, and do some machine dependent
@@ -480,6 +493,16 @@ sparc_override_options (void)
   init_machine_status = sparc_init_machine_status;
 }
 
+#ifdef SUBTARGET_ATTRIBUTE_TABLE
+/* Table of valid machine attributes.  */
+const struct attribute_spec sparc_attribute_table[] =
+{
+  /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
+  SUBTARGET_ATTRIBUTE_TABLE,
+  { NULL,        0, 0, false, false, false, NULL }
+};
+#endif
+
 /* Miscellaneous utilities.  */
 
 /* Nonzero if CODE, a comparison, is suitable for use in v9 conditional move
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/config/t-sol2 /export/home/mark/src/gcc-3.4.2/gcc/config/t-sol2
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/config/t-sol2	1969-12-31 16:00:00.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/config/t-sol2	2004-09-20 16:59:52.121966000 -0700
@@ -0,0 +1,12 @@
+# Solaris-specific format checking and pragmas
+sol2-c.o: $(srcdir)/config/sol2-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+  tree.h c-format.h intl.h $(CPPLIB_H) c-pragma.h $(TM_H) $(TM_P_H) \
+  toplev.h $(C_COMMON_H)
+	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+	  $(srcdir)/config/sol2-c.c
+
+# Solaris-specific attributes
+sol2.o: $(srcdir)/config/sol2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+  tree.h $(TM_H) $(TM_P_H) toplev.h $(GGC_H)
+	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+	  $(srcdir)/config/sol2.c
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/config.gcc /export/home/mark/src/gcc-3.4.2/gcc/config.gcc
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/config.gcc	2004-04-21 08:12:35.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/config.gcc	2004-09-20 18:45:07.397425000 -0700
@@ -1060,9 +1060,14 @@ i[34567]86-*-sco3.2v5*)	# 80386 running 
 i[34567]86-*-solaris2*)
 	xm_defines="SMALL_ARG_MAX"
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h sol2.h i386/sol2.h"
-	tmake_file="i386/t-sol2 t-svr4"
+	tmake_file="t-sol2 i386/t-sol2 t-svr4"
+	c_target_objs="sol2-c.o"
+	cxx_target_objs="sol2-c.o"
+	extra_objs="sol2.o"
+	tm_p_file="${tm_p_file} sol2-protos.h"
 	if test x$gnu_ld = xyes; then
 		tmake_file="$tmake_file t-slibgcc-elf-ver"
+		tm_defines="${tm_defines} TARGET_GNU_LD=1"
 	else
 		tmake_file="$tmake_file t-slibgcc-sld"
 	fi
@@ -1071,6 +1076,14 @@ 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_defines="${tm_defines} TARGET_BI_ARCH=1"
+		tmake_file="$tmake_file i386/t-sol2-10"
+		need_64bit_hwint=yes
+		;;
+	esac
 	extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
 	if test x${enable_threads} = x; then
 	    enable_threads=$have_pthread_h
@@ -2029,12 +2042,16 @@ sparc64-*-solaris2* | sparcv9-*-solaris2
 	if test x$gas = xyes; then
 		tm_file="${tm_file} sparc/sol2-gas-bi.h"
 	fi
-	tmake_file="sparc/t-sol2 sparc/t-sol2-64 sparc/t-crtfm"
+	tmake_file="t-sol2 sparc/t-sol2 sparc/t-sol2-64 sparc/t-crtfm"
 	if test x$gnu_ld = xyes; then
 		tmake_file="$tmake_file t-slibgcc-elf-ver"
 	else
 		tmake_file="$tmake_file t-slibgcc-sld"
 	fi
+	c_target_objs="sol2-c.o"
+	cxx_target_objs="sol2-c.o"
+	extra_objs="sol2.o"
+	tm_p_file="${tm_p_file} sol2-protos.h"
 	extra_parts="crt1.o crti.o crtn.o gcrt1.o crtbegin.o crtend.o"
 	if test x${enable_threads} = x ; then
 	    enable_threads=$have_pthread_h
@@ -2056,7 +2073,7 @@ sparc-*-solaris2*)
 	if test x$gnu_ld = xyes; then
 		tm_file="${tm_file} sparc/sol2-gld.h"
 	fi
-	tmake_file="sparc/t-sol2 sparc/t-crtfm"
+	tmake_file="t-sol2 sparc/t-sol2 sparc/t-crtfm"
 	if test x$gnu_ld = xyes; then
 		tmake_file="$tmake_file t-slibgcc-elf-ver"
 	else
@@ -2080,6 +2097,10 @@ sparc-*-solaris2*)
 		need_64bit_hwint=yes
 		;;
 	esac
+	c_target_objs="sol2-c.o"
+	cxx_target_objs="sol2-c.o"
+	extra_objs="sol2.o"
+	tm_p_file="${tm_p_file} sol2-protos.h"
 	extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
 	if test x${enable_threads} = x; then
 	    enable_threads=$have_pthread_h
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/cp/Make-lang.in /export/home/mark/src/gcc-3.4.2/gcc/cp/Make-lang.in
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/cp/Make-lang.in	2004-08-23 11:03:06.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/cp/Make-lang.in	2004-09-20 16:59:52.154912000 -0700
@@ -223,7 +223,7 @@ cp/decl.o: cp/decl.c $(CXX_TREE_H) $(TM_
   cp/operators.def $(TM_P_H) tree-inline.h diagnostic.h c-pragma.h \
   debug.h gt-cp-decl.h gtype-cp.h timevar.h
 cp/decl2.o: cp/decl2.c $(CXX_TREE_H) $(TM_H) flags.h cp/lex.h cp/decl.h $(EXPR_H) \
-  output.h except.h toplev.h $(RTL_H) c-common.h gt-cp-decl2.h cgraph.h
+  output.h except.h toplev.h $(RTL_H) c-common.h gt-cp-decl2.h cgraph.h c-pragma.h
 cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h output.h $(TM_P_H) \
    diagnostic.h
 cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/cp/cp-lang.c /export/home/mark/src/gcc-3.4.2/gcc/cp/cp-lang.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/cp/cp-lang.c	2003-12-23 08:53:47.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/cp/cp-lang.c	2004-09-20 16:59:52.164693000 -0700
@@ -412,3 +412,10 @@ cxx_initialize_diagnostics (diagnostic_c
   /* It is safe to free this object because it was previously malloc()'d.  */
   free (base);
 }
+
+/* c-pragma.c needs to query whether a decl has extern "C" linkage.  */
+bool
+has_c_linkage (tree decl)
+{
+  return DECL_EXTERN_C_P (decl);
+}
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/cp/decl2.c /export/home/mark/src/gcc-3.4.2/gcc/cp/decl2.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/cp/decl2.c	2004-06-25 14:58:54.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/cp/decl2.c	2004-09-20 16:59:52.177060000 -0700
@@ -48,6 +48,7 @@ Boston, MA 02111-1307, USA.  */
 #include "c-common.h"
 #include "cgraph.h"
 #include "tree-inline.h"
+#include "c-pragma.h"
 extern cpp_reader *parse_in;
 
 /* This structure contains information about the initializations
@@ -2840,6 +2841,9 @@ finish_file (void)
   if (priority_info_map)
     splay_tree_delete (priority_info_map);
 
+  /* Generate any missing aliases.  */
+  maybe_apply_pending_pragma_weaks ();
+
   /* We're done with static constructors, so we can go back to "C++"
      linkage now.  */
   pop_lang_context ();
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/cp/except.c /export/home/mark/src/gcc-3.4.2/gcc/cp/except.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/cp/except.c	2004-08-11 22:19:27.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/cp/except.c	2004-09-21 15:41:23.983354000 -0700
@@ -840,7 +840,10 @@ nothrow_libfn_p (tree fn)
     /* Can't be a C library function.  */
     return 0;
 
-  id = DECL_ASSEMBLER_NAME (fn);
+  /* Being a C library function, DECL_ASSEMBLER_NAME == DECL_NAME
+     unless the system headers are playing rename tricks, and if
+     they are, we don't want to be confused by them.  */
+  id = DECL_NAME (fn);
   return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
 }
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/cpplib.c /export/home/mark/src/gcc-3.4.2/gcc/cpplib.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/cpplib.c	2004-03-23 19:19:01.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/cpplib.c	2004-09-20 16:59:52.213614000 -0700
@@ -52,6 +52,7 @@ struct pragma_entry
   struct pragma_entry *next;
   const cpp_hashnode *pragma;	/* Name and length.  */
   int is_nspace;
+  int allow_expansion;
   union {
     pragma_cb handler;
     struct pragma_entry *space;
@@ -113,7 +114,7 @@ static struct pragma_entry *lookup_pragm
 static struct pragma_entry *insert_pragma_entry (cpp_reader *,
                                                  struct pragma_entry **,
                                                  const cpp_hashnode *,
-                                                 pragma_cb);
+                                                 pragma_cb, int);
 static int count_registered_pragmas (struct pragma_entry *);
 static char ** save_registered_pragmas (struct pragma_entry *, char **);
 static char ** restore_registered_pragmas (cpp_reader *, struct pragma_entry *,
@@ -968,7 +969,8 @@ lookup_pragma_entry (struct pragma_entry
    otherwise it is a pragma and its handler.  */
 static struct pragma_entry *
 insert_pragma_entry (cpp_reader *pfile, struct pragma_entry **chain,
-		     const cpp_hashnode *pragma, pragma_cb handler)
+		     const cpp_hashnode *pragma, pragma_cb handler,
+		     int allow_expansion)
 {
   struct pragma_entry *new;
 
@@ -986,6 +988,7 @@ insert_pragma_entry (cpp_reader *pfile, 
       new->u.space = NULL;
     }
 
+  new->allow_expansion = allow_expansion;
   new->next = *chain;
   *chain = new;
   return new;
@@ -993,10 +996,11 @@ insert_pragma_entry (cpp_reader *pfile, 
 
 /* Register a pragma NAME in namespace SPACE.  If SPACE is null, it
    goes in the global namespace.  HANDLER is the handler it will call,
-   which must be non-NULL.  */
+   which must be non-NULL.  If ALLOW_EXPANSION is set, allow macro
+   expansion while parsing pragma NAME.  */
 void
 cpp_register_pragma (cpp_reader *pfile, const char *space, const char *name,
-		     pragma_cb handler)
+		     pragma_cb handler, int allow_expansion)
 {
   struct pragma_entry **chain = &pfile->pragmas;
   struct pragma_entry *entry;
@@ -1010,7 +1014,7 @@ cpp_register_pragma (cpp_reader *pfile, 
       node = cpp_lookup (pfile, U space, strlen (space));
       entry = lookup_pragma_entry (*chain, node);
       if (!entry)
-	entry = insert_pragma_entry (pfile, chain, node, NULL);
+	entry = insert_pragma_entry (pfile, chain, node, NULL, allow_expansion);
       else if (!entry->is_nspace)
 	goto clash;
       chain = &entry->u.space;
@@ -1033,7 +1037,7 @@ cpp_register_pragma (cpp_reader *pfile, 
 	cpp_error (pfile, CPP_DL_ICE, "#pragma %s is already registered", name);
     }
   else
-    insert_pragma_entry (pfile, chain, node, handler);
+    insert_pragma_entry (pfile, chain, node, handler, allow_expansion);
 }
 
 /* Register the pragmas the preprocessor itself handles.  */
@@ -1041,12 +1045,12 @@ void
 _cpp_init_internal_pragmas (cpp_reader *pfile)
 {
   /* Pragmas in the global namespace.  */
-  cpp_register_pragma (pfile, 0, "once", do_pragma_once);
+  cpp_register_pragma (pfile, 0, "once", do_pragma_once, 0);
 
   /* New GCC-specific pragmas should be put in the GCC namespace.  */
-  cpp_register_pragma (pfile, "GCC", "poison", do_pragma_poison);
-  cpp_register_pragma (pfile, "GCC", "system_header", do_pragma_system_header);
-  cpp_register_pragma (pfile, "GCC", "dependency", do_pragma_dependency);
+  cpp_register_pragma (pfile, "GCC", "poison", do_pragma_poison, 0);
+  cpp_register_pragma (pfile, "GCC", "system_header", do_pragma_system_header, 0);
+  cpp_register_pragma (pfile, "GCC", "dependency", do_pragma_dependency, 0);
 }
 
 /* Return the number of registered pragmas in PE.  */
@@ -1156,6 +1160,9 @@ do_pragma (cpp_reader *pfile)
 	 numbers in place.  */
       if (pfile->cb.line_change)
 	(*pfile->cb.line_change) (pfile, pragma_token, false);
+
+      if (p->allow_expansion)
+	pfile->state.prevent_expansion--;
       (*p->u.handler) (pfile);
     }
   else if (pfile->cb.def_pragma)
@@ -1164,7 +1171,8 @@ do_pragma (cpp_reader *pfile)
       pfile->cb.def_pragma (pfile, pfile->directive_line);
     }
 
-  pfile->state.prevent_expansion--;
+  if (!p || !p->allow_expansion)
+    pfile->state.prevent_expansion--;
 }
 
 /* Handle #pragma once.  */
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/cpplib.h /export/home/mark/src/gcc-3.4.2/gcc/cpplib.h
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/cpplib.h	2004-02-09 04:23:51.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/cpplib.h	2004-09-20 16:59:52.227593000 -0700
@@ -567,7 +567,7 @@ extern unsigned char *cpp_token_as_text 
 extern unsigned char *cpp_spell_token (cpp_reader *, const cpp_token *,
 				       unsigned char *);
 extern void cpp_register_pragma (cpp_reader *, const char *, const char *,
-				 void (*) (cpp_reader *));
+				 void (*) (cpp_reader *), int);
 extern int cpp_avoid_paste (cpp_reader *, const cpp_token *,
 			    const cpp_token *);
 extern const cpp_token *cpp_get_token (cpp_reader *);
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/doc/extend.texi /export/home/mark/src/gcc-3.4.2/gcc/doc/extend.texi
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/doc/extend.texi	2004-08-23 11:02:58.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/doc/extend.texi	2004-09-20 16:59:52.282073000 -0700
@@ -472,6 +472,7 @@ extensions, accepted by GCC in C89 mode 
 * Vector Extensions::   Using vector instructions through built-in functions.
 * Other Builtins::      Other built-in functions.
 * Target Builtins::     Built-in functions specific to particular targets.
+* Target Format Checks:: Format checks specific to particular targets.
 * Pragmas::             Pragmas accepted by GCC.
 * Unnamed Fields::      Unnamed struct/union fields within structs/unions.
 * Thread-Local::        Per-thread variables.
@@ -2175,6 +2176,10 @@ standard modes, the X/Open function @cod
 are @code{printf_unlocked} and @code{fprintf_unlocked}.
 @xref{C Dialect Options,,Options Controlling C Dialect}.
 
+The target may provide additional types of format checks.
+@xref{Target Format Checks,,Format Checks Specific to Particular
+Target Machines}.
+
 @item format_arg (@var{string-index})
 @cindex @code{format_arg} function attribute
 @opindex Wformat-nonliteral
@@ -8009,6 +8014,25 @@ int vec_any_numeric (vector float);
 int vec_any_out (vector float, vector float);
 @end smallexample
 
+@node Target Format Checks
+@section Format Checks Specific to Particular Target Machines
+
+For some target machines, GCC supports additional options to the
+format attribute
+(@pxref{Function Attributes,,Declaring Attributes of Functions}).
+
+@menu
+* Solaris Format Checks::
+@end menu
+
+@node Solaris Format Checks
+@subsection Solaris Format Checks
+
+Solaris targets support the @code{cmn_err} (or @code{__cmn_err__}) format
+check.  @code{cmn_err} accepts a subset of the standard @code{printf}
+conversions, and the two-argument @code{%b} conversion for displaying
+bit-fields.  See the Solaris man page for @code{cmn_err} for more information.
+
 @node Pragmas
 @section Pragmas Accepted by GCC
 @cindex pragmas
@@ -8113,8 +8137,8 @@ anywhere within the variables' scopes.
 @node Solaris Pragmas
 @subsection Solaris Pragmas
 
-For compatibility with the SunPRO compiler, the following pragma
-is supported.
+For compatibility with the SunPRO compiler, the following pragmas
+are supported.
 
 @table @code
 @item redefine_extname @var{oldname} @var{newname}
@@ -8125,6 +8149,27 @@ This pragma gives the C function @var{ol
 This pragma is equivalent to the asm labels extension (@pxref{Asm
 Labels}).  The preprocessor defines @code{__PRAGMA_REDEFINE_EXTNAME}
 if the pragma is available.
+
+@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}).  Macro expansion occurs on the arguments to this pragma.
+
+@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 Tru64 Pragmas
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/doc/invoke.texi /export/home/mark/src/gcc-3.4.2/gcc/doc/invoke.texi
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/doc/invoke.texi	2004-07-13 03:43:39.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/doc/invoke.texi	2004-09-20 16:59:52.363166000 -0700
@@ -2084,7 +2084,7 @@ specified, and that the conversions spec
 sense.  This includes standard functions, and others specified by format
 attributes (@pxref{Function Attributes}), in the @code{printf},
 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
-not in the C standard) families.
+not in the C standard) families (or other target-specific families).
 
 The formats are checked against the format features supported by GNU
 libc version 2.2.  These include all ISO C90 and C99 features, as well
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/doc/sourcebuild.texi /export/home/mark/src/gcc-3.4.2/gcc/doc/sourcebuild.texi
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/doc/sourcebuild.texi	2004-07-06 16:22:51.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/doc/sourcebuild.texi	2004-09-20 16:59:52.412036000 -0700
@@ -749,6 +749,9 @@ pragmas supported.
 Documentation in @file{gcc/doc/extend.texi} of any target-specific
 built-in functions supported.
 @item
+Documentation in @file{gcc/doc/extend.texi} of any target-specific
+format checking styles supported.
+@item
 Documentation in @file{gcc/doc/md.texi} of any target-specific
 constraint letters (@pxref{Machine Constraints, , Constraints for
 Particular Machines}).
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/doc/tm.texi /export/home/mark/src/gcc-3.4.2/gcc/doc/tm.texi
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/doc/tm.texi	2004-08-23 11:03:01.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/doc/tm.texi	2004-09-20 16:59:52.451247000 -0700
@@ -9274,3 +9274,14 @@ more than this number of multiplications
 system library's @code{pow}, @code{powf} or @code{powl} routines.
 The default value places no upper bound on the multiplication count.
 @end defmac
+
+@defmac TARGET_FORMAT_TYPES
+If defined, this macro is the name of a global variable containing
+target-specific format checking information for the @option{-Wformat}
+option.  The default is to have no target-specific format checks.
+@end defmac
+
+@defmac TARGET_N_FORMAT_TYPES
+If defined, this macro is the number of entries in
+@code{TARGET_FORMAT_TYPES}.
+@end defmac
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/dwarf2out.c /export/home/mark/src/gcc-3.4.2/gcc/dwarf2out.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/dwarf2out.c	2004-08-23 19:07:22.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/dwarf2out.c	2004-09-22 13:31:07.201182000 -0700
@@ -10215,7 +10215,8 @@ scope_die_for (tree t, dw_die_ref contex
   if (containing_scope && TREE_CODE (containing_scope) == FUNCTION_TYPE)
     containing_scope = NULL_TREE;
 
-  if (containing_scope == NULL_TREE)
+  if (containing_scope == NULL_TREE 
+      || TREE_CODE (containing_scope) == TRANSLATION_UNIT_DECL)
     scope_die = comp_unit_die;
   else if (TYPE_P (containing_scope))
     {
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/fixinc/fixincl.x /export/home/mark/src/gcc-3.4.2/gcc/fixinc/fixincl.x
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/fixinc/fixincl.x	2004-08-14 09:38:10.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/fixinc/fixincl.x	2004-09-21 23:22:56.000000000 -0700
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Thursday August 12, 2004 at 05:42:28 PM MDT
+ * It has been AutoGen-ed  Tuesday September 21, 2004 at 11:22:56 PM PDT
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT CVS-MERGE THIS FILE, EITHER Thu Aug 12 17:42:28 MDT 2004
+/* DO NOT CVS-MERGE THIS FILE, EITHER Tue Sep 21 23:22:56 PDT 2004
  *
  * You must regenerate it.  Use the ./genfixes script.
  *
@@ -15,7 +15,7 @@
  * certain ANSI-incompatible system header files which are fixed to work
  * correctly with ANSI C and placed in a directory that GNU C will search.
  *
- * This file contains 177 fixup descriptions.
+ * This file contains 178 fixup descriptions.
  *
  * See README for more information.
  *
@@ -4480,6 +4480,46 @@ static const char* apzSco_UtimePatch[] =
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
+ *  Description of Solaris_Longlong fix
+ */
+tSCC zSolaris_LonglongName[] =
+     "solaris_longlong";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zSolaris_LonglongList[] =
+  "|sys/feature_tests.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzSolaris_LonglongMachs[] = {
+        "*-*-solaris2.1[0-9]",
+        "*-*-solaris2.1[0-9].*",
+        (const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zSolaris_LonglongSelect0[] =
+       "#error.*No long long.*";
+
+#define    SOLARIS_LONGLONG_TEST_CT  1
+static tTestDesc aSolaris_LonglongTests[] = {
+  { TT_EGREP,    zSolaris_LonglongSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Solaris_Longlong
+ */
+static const char* apzSolaris_LonglongPatch[] = {
+    "format",
+    "#ifndef __GNUC__\n\
+%0\n\
+#endif",
+    (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
  *  Description of Solaris_Mutex_Init_1 fix
  */
 tSCC zSolaris_Mutex_Init_1Name[] =
@@ -5067,8 +5107,24 @@ tSCC zSun_Auth_ProtoList[] =
 tSCC zSun_Auth_ProtoSelect0[] =
        "\\(\\*[a-z][a-z_]*\\)\\(\\)";
 
-#define    SUN_AUTH_PROTO_TEST_CT  1
+/*
+ *  content bypass pattern - skip fix if pattern found
+ */
+tSCC zSun_Auth_ProtoBypass0[] =
+       "pragma ident.*auth.*(1.4[3-9]|1.[5-9][0-9]).*SMI";
+tSCC zSun_Auth_ProtoBypass1[] =
+       "pragma ident.*clnt.*1.[6-9][0-9].*SMI";
+tSCC zSun_Auth_ProtoBypass2[] =
+       "pragma ident.*svc.*(1.69|1.[7-9][0-9]).*SMI";
+tSCC zSun_Auth_ProtoBypass3[] =
+       "pragma ident.*xdr.*(1.4[5-9]|1.[5-9][0-9]).*SMI";
+
+#define    SUN_AUTH_PROTO_TEST_CT  5
 static tTestDesc aSun_Auth_ProtoTests[] = {
+  { TT_NEGREP,   zSun_Auth_ProtoBypass0, (regex_t*)NULL },
+  { TT_NEGREP,   zSun_Auth_ProtoBypass1, (regex_t*)NULL },
+  { TT_NEGREP,   zSun_Auth_ProtoBypass2, (regex_t*)NULL },
+  { TT_NEGREP,   zSun_Auth_ProtoBypass3, (regex_t*)NULL },
   { TT_EGREP,    zSun_Auth_ProtoSelect0, (regex_t*)NULL }, };
 
 /*
@@ -7018,9 +7074,9 @@ static const char* apzX11_SprintfPatch[]
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          199
+#define REGEX_COUNT          204
 #define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT            177
+#define FIX_COUNT            178
 
 /*
  *  Enumerate the fixes
@@ -7137,6 +7193,7 @@ typedef enum {
     SCO_REGSET_FIXIDX,
     SCO_STATIC_FUNC_FIXIDX,
     SCO_UTIME_FIXIDX,
+    SOLARIS_LONGLONG_FIXIDX,
     SOLARIS_MUTEX_INIT_1_FIXIDX,
     SOLARIS_MUTEX_INIT_2_FIXIDX,
     SOLARIS_SOCKET_FIXIDX,
@@ -7761,6 +7818,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      SCO_UTIME_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aSco_UtimeTests,   apzSco_UtimePatch, 0 },
 
+  {  zSolaris_LonglongName,    zSolaris_LonglongList,
+     apzSolaris_LonglongMachs,
+     SOLARIS_LONGLONG_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aSolaris_LonglongTests,   apzSolaris_LonglongPatch, 0 },
+
   {  zSolaris_Mutex_Init_1Name,    zSolaris_Mutex_Init_1List,
      apzSolaris_Mutex_Init_1Machs,
      SOLARIS_MUTEX_INIT_1_TEST_CT, FD_MACH_ONLY,
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/fixinc/inclhack.def /export/home/mark/src/gcc-3.4.2/gcc/fixinc/inclhack.def
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/fixinc/inclhack.def	2004-08-14 09:38:10.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/fixinc/inclhack.def	2004-09-21 23:22:43.506727000 -0700
@@ -2484,6 +2484,24 @@ fix = {
     test_text = "extern int utime(const char *, struct utimbuf *);";
 };
 
+/*
+ * Sun Solaris 2.10 checks that _LONGLONG_TYPE is not defined in
+ * strict ANSI mode, on the theory that a strict ANSI compiler will
+ * not accept "long long".  However, GCC will always accept "long long"
+ * in system headers, and some of the Solaris headers unconditionally
+ * use "int64_t" which requires "long long".  So, we remove the 
+ * #error message.
+ */
+fix = {
+    hackname = solaris_longlong;
+    files    = sys/feature_tests.h;
+    mach      = '*-*-solaris2.1[0-9]';
+    mach      = '*-*-solaris2.1[0-9].*';
+    select    = "#error.*No long long.*";
+    c_fix     = format;
+    c_fix_arg = "#ifndef __GNUC__\n%0\n#endif";
+    test_text = "#error\tNo long long in strictly";
+};
 
 /*
  *  Sun Solaris 2.5.1, 2.6 defines PTHREAD_{MUTEX|COND}_INITIALIZER
@@ -2605,7 +2623,6 @@ fix = {
     test_text = "#include <euc.h>";
 };
 
-
 /*
  *  a missing semi-colon at the end of the statsswtch structure definition.
  */
@@ -2814,6 +2831,21 @@ fix = {
      */
     select    = '\(\*[a-z][a-z_]*\)\(\)';
 
+    /* Solaris 2.8 and above (and perhaps earlier versions) do not
+       need these fixes.  The unprototyped declarations in these files
+       are only visible if __STDC__ is not defined.  This test looks
+       for a #pragma ident directives with particular versions, since
+       we know those versions are OK.  (Earlier versions may also be
+       OK, but we do not know that.)  */
+    /* For rpc/auth.h, 1.43 or better is OK.  */
+    bypass    = "pragma ident.*auth.*(1\.4[3-9]|1\.[5-9][0-9]).*SMI";
+    /* For rpc/clnt.h, 1.60 or better is OK.  */
+    bypass    = "pragma ident.*clnt.*1\.[6-9][0-9].*SMI";
+    /* For rpc/svc.h, 1.69 or better is OK.  */
+    bypass    = "pragma ident.*svc.*(1\.69|1\.[7-9][0-9]).*SMI";
+    /* For rpc/xdr.h, 1.45 or better is OK.  */
+    bypass    = "pragma ident.*xdr.*(1\.4[5-9]|1\.[5-9][0-9]).*SMI";
+
     c_fix     = format;
     c_fix_arg = "#ifdef __cplusplus\n%1(...);%2\n"
                 "#else\n%1();%2\n#endif";
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/bitfield3.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/bitfield3.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/bitfield3.C	2002-08-07 14:05:16.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/bitfield3.C	2004-09-20 16:59:52.530257000 -0700
@@ -1,6 +1,7 @@
 // Test for oversized bitfield alignment in structs on IA-32
 // { dg-do run { target i?86-*-* } }
 // { dg-options "-O2" }
+// { dg-forbid-option "-m64" }
 
 struct A
 {
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/bitfield8.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/bitfield8.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/bitfield8.C	2002-09-23 02:22:17.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/bitfield8.C	2004-09-20 16:59:52.530849000 -0700
@@ -1,5 +1,6 @@
 // { dg-do run { target i?86-*-* } }
 // { dg-options "-fabi-version=0" }
+// { dg-forbid-option "-m64" }
 
 struct A { 
   virtual void f() {}
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/dtor1.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/dtor1.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/dtor1.C	2002-11-07 13:33:44.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/dtor1.C	2004-09-20 16:59:52.533474000 -0700
@@ -1,4 +1,5 @@
 // { dg-do compile { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 // { dg-options "-fabi-version=0" }
 
 struct A {
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/empty10.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/empty10.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/empty10.C	2002-11-26 11:37:45.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/empty10.C	2004-09-20 16:59:52.534018000 -0700
@@ -1,4 +1,5 @@
 // { dg-do run { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 // { dg-options "-fabi-version=0 -w" }
 
 struct E {};
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/empty7.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/empty7.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/empty7.C	2002-09-30 09:52:19.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/empty7.C	2004-09-20 16:59:52.534599000 -0700
@@ -1,4 +1,5 @@
 // { dg-do run { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 // { dg-options "-fabi-version=0" }
 
 struct S1 {};
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/empty9.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/empty9.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/empty9.C	2002-10-24 23:01:55.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/empty9.C	2004-09-20 16:59:52.535105000 -0700
@@ -1,4 +1,5 @@
 // { dg-do run { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 // { dg-options "-w -fabi-version=0" }
 
 struct E1 {};
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/layout3.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/layout3.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/layout3.C	2003-03-05 12:52:53.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/layout3.C	2004-09-20 16:59:52.535631000 -0700
@@ -1,4 +1,5 @@
 // { dg-do run { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 // { dg-options "-fabi-version=0 -w" }
 
 struct S {
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/layout4.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/layout4.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/layout4.C	2003-09-03 15:00:42.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/layout4.C	2004-09-20 16:59:52.536123000 -0700
@@ -1,4 +1,5 @@
 // { dg-do run { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 // { dg-options "-fabi-version=1" }
 
 struct C4
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/thunk1.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/thunk1.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/thunk1.C	2002-11-03 17:45:58.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/thunk1.C	2004-09-20 16:59:52.540154000 -0700
@@ -1,4 +1,5 @@
 // { dg-do compile { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 
 struct A {
   virtual void f ();
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/thunk2.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/thunk2.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/thunk2.C	2002-11-03 17:45:58.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/thunk2.C	2004-09-20 16:59:52.540669000 -0700
@@ -1,4 +1,5 @@
 // { dg-do compile { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 // { dg-options -w }
 
 struct A {
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/vbase11.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/vbase11.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/vbase11.C	2002-09-23 02:22:17.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/vbase11.C	2004-09-20 16:59:52.541198000 -0700
@@ -1,4 +1,5 @@
 // { dg-do run { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 // { dg-options "-fabi-version=0" }
 
 struct A { virtual void f(); char c1; };
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/vthunk2.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/vthunk2.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/vthunk2.C	2002-10-25 12:39:47.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/vthunk2.C	2004-09-20 16:59:52.543705000 -0700
@@ -1,4 +1,5 @@
 // { dg-do compile { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 
 struct c0 {
   virtual void f ();
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/vthunk3.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/vthunk3.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/abi/vthunk3.C	2002-11-10 18:20:37.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/abi/vthunk3.C	2004-09-20 16:59:52.544227000 -0700
@@ -1,4 +1,5 @@
 // { dg-do compile { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 // { dg-options "-fabi-version=0" }
 
 struct A {
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/ext/attrib8.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/ext/attrib8.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/ext/attrib8.C	2003-10-09 11:08:50.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/ext/attrib8.C	2004-09-20 16:59:52.546029000 -0700
@@ -1,5 +1,6 @@
 // PR 8656
 // { dg-do compile { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 
 extern int * (__attribute__((stdcall)) *fooPtr)( void);
 int * __attribute__((stdcall)) myFn01( void) { return 0; }
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/opt/longbranch2.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/opt/longbranch2.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/opt/longbranch2.C	2003-09-07 23:41:49.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/opt/longbranch2.C	2004-09-20 16:59:52.552995000 -0700
@@ -3,6 +3,7 @@
 
 // { dg-do compile }
 // { dg-options "-O3 -funroll-loops -mtune=k6 -fomit-frame-pointer" { target i?86-*-*  } }
+// { dg-forbid-option "-m64" }
 
 // This used to fail to assemble because of an out-of-range 'loop' instructions.
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/opt/reg-stack4.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/opt/reg-stack4.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.dg/opt/reg-stack4.C	2003-11-26 22:36:52.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.dg/opt/reg-stack4.C	2004-09-20 16:59:52.558414000 -0700
@@ -6,6 +6,7 @@
 
 // { dg-do compile }
 // { dg-options "-mtune=i586 -O2" { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 
 struct array {
   double data;
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C	2003-12-16 03:48:50.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C	2004-09-21 23:37:30.496287000 -0700
@@ -14,10 +14,9 @@ extern "C" void *memcpy(void *, const vo
 #ifdef STACK_SIZE
 const int arena_size = 256;
 #else
-#ifdef __FreeBSD__
-// FreeBSD with threads requires even more space at initialization time.
-#include "bits/c++config.h"
-#include "bits/gthr.h"
+#if defined(__FreeBSD__) || defined(__sun__)
+// FreeBSD with threads and Solaris with threads require even more
+// space at initialization time.
 const int arena_size = 131072;
 #else
 const int arena_size = 32768;
@@ -105,16 +104,15 @@ void fn_catchthrow() throw(int)
 
 int main()
 {
-#ifdef __FreeBSD__
-// FreeBSD with threads fails the test unless each thread primes itself.
-  if (__gthread_active_p())
-    {
-      try{fn_throw();}
-      catch(int a){}
-    }
-// This was added to test with well-known idiom to detect regressions here
-// rather than always failing with -pthread.
-#endif
+  /* On some systems (including FreeBSD and Solaris 2.10),
+     __cxa_get_globals will try to call "malloc" when threads are in
+     use.  Therefore, we throw one exception up front so that
+     __cxa_get_globals is all set up.  Ideally, this would not be
+     necessary, but it is a well-known idiom, and using this technique
+     means that we can still validate the fact that exceptions can be
+     thrown when malloc fails.  */
+  try{fn_throw();}
+  catch(int a){}
 
   fail = 1;
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.old-deja/g++.ext/attrib1.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.old-deja/g++.ext/attrib1.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.old-deja/g++.ext/attrib1.C	2003-04-30 19:02:39.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.old-deja/g++.ext/attrib1.C	2004-09-20 16:59:52.566697000 -0700
@@ -1,4 +1,5 @@
 // { dg-do assemble { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 // Test for using prefix attributes in a parameter decl.
 // Contributed by Jason Merrill <jason@cygnus.com>
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.old-deja/g++.ext/attrib2.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.old-deja/g++.ext/attrib2.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.old-deja/g++.ext/attrib2.C	2003-04-30 19:02:39.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.old-deja/g++.ext/attrib2.C	2004-09-20 16:59:52.567205000 -0700
@@ -1,4 +1,5 @@
 // { dg-do run { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 // Test that stdcall doesn't prevent us from using op delete.
 // Contributed by Jason Merrill <jason@cygnus.com>
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.old-deja/g++.ext/attrib3.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.old-deja/g++.ext/attrib3.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.old-deja/g++.ext/attrib3.C	2003-04-30 19:02:39.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.old-deja/g++.ext/attrib3.C	2004-09-20 16:59:52.567702000 -0700
@@ -1,4 +1,5 @@
 // { dg-do run { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 // Test for proper handling of attributes in template instantiation.
 // Contributed by Jason Merrill <jason@cygnus.com>
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.old-deja/g++.other/store-expr1.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.old-deja/g++.other/store-expr1.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.old-deja/g++.other/store-expr1.C	2003-04-30 19:02:51.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.old-deja/g++.other/store-expr1.C	2004-09-20 16:59:52.568230000 -0700
@@ -1,4 +1,5 @@
 // { dg-do run { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 // { dg-options "-mtune=i686 -O2 -fpic" }
 class G {};
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.old-deja/g++.other/store-expr2.C /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.old-deja/g++.other/store-expr2.C
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/g++.old-deja/g++.other/store-expr2.C	2003-04-30 19:02:51.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/g++.old-deja/g++.other/store-expr2.C	2004-09-20 16:59:52.578130000 -0700
@@ -1,4 +1,5 @@
 // { dg-do run { target i?86-*-* } }
+// { dg-forbid-option "-m64" }
 // { dg-options "-mtune=i686 -O2" }
 class G {};
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.c-torture/execute/20010129-1.x /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.c-torture/execute/20010129-1.x
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.c-torture/execute/20010129-1.x	2003-02-22 19:10:03.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.c-torture/execute/20010129-1.x	2004-09-20 16:59:52.581645000 -0700
@@ -1,4 +1,13 @@
+# Use "-mtune=i686" on i?86-*-* unless "-m64" is specified.
 if { [istarget "i?86-*-*"] } {
-  set additional_flags "-mtune=i686"
+  set target_name [target_info name]
+  if {[board_info $target_name exists multilib_flags]} {
+    set multilib_flags [board_info $target_name multilib_flags]
+    if { ![regexp -- "-m64" $multilib_flags] } {
+      set additional_flags "-mtune=i686"
+    }
+  } else {
+    set additional_flags "-mtune=i686"
+  }
 }
 return 0
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20000609-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20000609-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20000609-1.c	2000-06-09 19:57:20.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20000609-1.c	2004-09-20 16:59:52.582597000 -0700
@@ -1,5 +1,6 @@
 /* { dg-do run { target i?86-*-* } } */
 /* { dg-options "-O1 -ffast-math -march=i686" } */
+/* { dg-forbid-option "-m64" } */
 
 /* Sanity check for fp_jcc_* with TARGET_CMOVE.  */
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20000720-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20000720-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20000720-1.c	2000-07-25 12:35:45.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20000720-1.c	2004-09-20 16:59:52.582983000 -0700
@@ -1,4 +1,5 @@
 /* { dg-do compile { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-mpreferred-stack-boundary=2 -march=i586 -O2 -fomit-frame-pointer" } */
 
 extern void *foo(void *a, const void *b, unsigned c);
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20011107-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20011107-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20011107-1.c	2003-02-22 19:10:03.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20011107-1.c	2004-09-20 16:59:52.583362000 -0700
@@ -1,4 +1,5 @@
 /* { dg-do compile { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O2 -mtune=k6" } */
 
 void
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20011119-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20011119-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20011119-1.c	2001-11-20 16:04:47.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20011119-1.c	2004-09-20 16:59:52.583741000 -0700
@@ -1,5 +1,6 @@
 /* Test for reload failing to eliminate from argp to sp.  */
 /* { dg-do run { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O2 -fomit-frame-pointer" } */
 
 static int ustrsize (const char *s);
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020108-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020108-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020108-1.c	2003-02-22 19:10:03.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020108-1.c	2004-09-20 16:59:52.587351000 -0700
@@ -6,6 +6,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2" } */
 /* { dg-options "-O2 -mtune=i686" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" {target i?86-*-* } } */
 
 void
 foo (unsigned short *cp)
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020122-2.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020122-2.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020122-2.c	2002-01-22 13:21:42.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020122-2.c	2004-09-20 16:59:52.588011000 -0700
@@ -4,6 +4,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fprefetch-loop-arrays -w" } */
 /* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" {target i?86-*-* } } */
 
 extern int access( char* );
 extern int a();
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020122-3.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020122-3.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020122-3.c	2003-02-22 19:10:03.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020122-3.c	2004-09-20 16:59:52.602456000 -0700
@@ -5,6 +5,7 @@
 /* { dg-do compile } */
 /* { dg-options "-Os -fprefetch-loop-arrays -w" } */
 /* { dg-options "-Os -fprefetch-loop-arrays -mtune=pentium3 -w" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" {target i?86-*-* } } */
 
 int foo (int *p, int n)
 {
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020201-3.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020201-3.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020201-3.c	2002-02-02 01:22:00.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020201-3.c	2004-09-20 16:59:52.602874000 -0700
@@ -1,6 +1,7 @@
 /* This testcase ICEd because a SFmode variable was given a MMX register
    for which there is no movsf exists.  */
 /* { dg-do compile { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O2 -march=i686 -mmmx -fno-strict-aliasing" } */
 
 struct A { unsigned int a, b; };
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020206-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020206-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020206-1.c	2003-02-22 19:10:03.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020206-1.c	2004-09-20 16:59:52.603427000 -0700
@@ -5,6 +5,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -fprefetch-loop-arrays -w" } */
 /* { dg-options "-O2 -fprefetch-loop-arrays -mtune=pentium3 -w" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" {target i?86-*-* } } */
 
 struct reload
 {
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020218-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020218-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020218-1.c	2002-01-21 07:53:31.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020218-1.c	2004-09-20 16:59:52.603786000 -0700
@@ -1,5 +1,6 @@
 /* Verify that X86-64 only SSE registers aren't restored on IA-32.  */
 /* { dg-do compile { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O2 -msse" } */
 /* { dg-final { scan-assembler-not "xmm8" } } */
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020310-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020310-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020310-1.c	2003-02-22 19:10:03.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020310-1.c	2004-09-20 16:59:52.604157000 -0700
@@ -3,6 +3,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2" } */
 /* { dg-options "-O2 -mtune=i586" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" {target i?86-*-* } } */
 
 struct A
 {
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020411-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020411-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020411-1.c	2002-10-06 21:38:56.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020411-1.c	2004-09-20 16:59:52.604657000 -0700
@@ -4,6 +4,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2" } */
 /* { dg-options "-O2 -march=i686" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" {target i?86-*-* } } */
 
 #if __INT_MAX__ > 32767
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020418-2.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020418-2.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020418-2.c	2002-04-18 13:10:48.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020418-2.c	2004-09-20 16:59:52.605022000 -0700
@@ -2,6 +2,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -funroll-all-loops" } */
 /* { dg-options "-O2 -funroll-all-loops -march=pentium3" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" {target i?86-*-* } } */
 
 void bar (float);
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020426-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020426-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020426-1.c	2002-04-26 14:28:46.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020426-1.c	2004-09-20 16:59:52.615462000 -0700
@@ -1,5 +1,6 @@
 /* { dg-do compile { target i?86-*-* } } */
 /* { dg-options "-msoft-float -mfp-ret-in-387" } */
+/* { dg-forbid-option "-m64" } */
 
 void f() {
   __builtin_apply(0, 0, 0);
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020426-2.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020426-2.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020426-2.c	2003-02-22 19:10:03.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020426-2.c	2004-09-20 16:59:52.616130000 -0700
@@ -3,6 +3,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2" } */
 /* { dg-options "-O2 -frename-registers -fomit-frame-pointer -fPIC -mtune=i686" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 
 typedef struct
 {
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020517-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020517-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020517-1.c	2003-02-22 19:10:03.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020517-1.c	2004-09-20 16:59:52.616510000 -0700
@@ -3,6 +3,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2" } */
 /* { dg-options "-O2 -mtune=i686" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" {target i?86-*-* } } */
 
 #include <limits.h>
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020523-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020523-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020523-1.c	2002-05-23 02:29:29.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020523-1.c	2004-09-20 16:59:52.617000000 -0700
@@ -2,6 +2,7 @@
    This testcase was miscompiled because sse_mov?fcc_const0*
    patterns were missing earlyclobber.  */
 /* { dg-do run { target i386-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-march=pentium3 -msse -ffast-math -O2" } */
 
 extern void abort (void);
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020523-2.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020523-2.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020523-2.c	2004-01-08 17:01:50.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020523-2.c	2004-09-20 16:59:52.617470000 -0700
@@ -2,6 +2,7 @@
    This testcase was miscompiled because sse_mov?fcc_const0*
    patterns were missing earlyclobber.  */
 /* { dg-do run { target i386-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-march=pentium3 -msse -ffast-math -O2" } */
 
 #include "i386-cpuid.h"
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020729-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020729-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20020729-1.c	2003-05-16 12:35:43.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20020729-1.c	2004-09-20 16:59:52.617833000 -0700
@@ -1,4 +1,5 @@
 /* { dg-do compile { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O2 -march=k6" } */
 
 static inline void *
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20030204-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20030204-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20030204-1.c	2003-02-05 03:29:15.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20030204-1.c	2004-09-20 16:59:52.618221000 -0700
@@ -2,6 +2,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O -ffast-math -funroll-loops" } */
 /* { dg-options "-march=pentium3 -O -ffast-math -funroll-loops" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" {target i?86-*-* } } */
 
 float foo (float *a, int i)
 {
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20030826-2.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20030826-2.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20030826-2.c	2003-08-27 03:52:09.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20030826-2.c	2004-09-20 16:59:52.618607000 -0700
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -fomit-frame-pointer" } */
 /* { dg-options "-O2 -fomit-frame-pointer -march=i386" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" {target i?86-*-* } } */
 
 extern void abort (void);
 extern void exit (int);
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20030926-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20030926-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20030926-1.c	2003-11-11 22:44:46.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20030926-1.c	2004-09-20 16:59:52.625016000 -0700
@@ -2,6 +2,7 @@
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
 /* { dg-options "-O2 -minline-all-stringops" } */
 /* { dg-options "-O2 -minline-all-stringops -march=pentium4" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" {target i?86-*-* } } */
 
 void
 foo (char *p)
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20031202-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20031202-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/20031202-1.c	2003-12-03 14:40:58.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/20031202-1.c	2004-09-20 16:59:52.627264000 -0700
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2" } */
 /* { dg-options "-O2 -mtune=i686" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" {target i?86-*-* } } */
 
 extern void abort (void);
 extern void exit (int);
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/980312-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/980312-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/980312-1.c	1998-12-16 14:23:06.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/980312-1.c	2004-09-20 16:59:52.627644000 -0700
@@ -1,4 +1,5 @@
 /* { dg-do link { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O2 -march=pentiumpro" } */
 
 extern __inline  double
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/980313-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/980313-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/980313-1.c	1998-12-16 14:23:07.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/980313-1.c	2004-09-20 16:59:52.631629000 -0700
@@ -1,4 +1,5 @@
 /* { dg-do link { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O2 -march=pentiumpro" } */
 
 extern __inline  double
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/990117-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/990117-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/990117-1.c	2002-02-06 12:40:17.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/990117-1.c	2004-09-20 16:59:52.634261000 -0700
@@ -1,4 +1,5 @@
 /* { dg-do compile { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O2 -march=pentiumpro" } */
 
 extern __inline  double
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/990424-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/990424-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/990424-1.c	2000-05-23 12:30:44.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/990424-1.c	2004-09-20 16:59:52.635912000 -0700
@@ -2,6 +2,7 @@
    with stdcall functions.  */
 
 /* { dg-do run { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options -mpreferred-stack-boundary=4 } */
 
 void __attribute__((stdcall)) foo(int a, int b, int c);
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/990524-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/990524-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/990524-1.c	2002-02-06 12:40:17.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/990524-1.c	2004-09-20 16:59:52.656272000 -0700
@@ -1,4 +1,5 @@
 /* { dg-do compile { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O2 -march=pentiumpro" } */
 
 typedef struct t_anim_info {
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/991230-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/991230-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/991230-1.c	2003-02-22 19:10:03.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/991230-1.c	2004-09-20 16:59:52.657073000 -0700
@@ -1,4 +1,5 @@
 /* { dg-do run { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O -ffast-math -mtune=i486" } */
 
 /* Test that floating point greater-than tests are compiled correctly with
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/const-elim-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/const-elim-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/const-elim-1.c	2004-04-23 17:36:09.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/const-elim-1.c	2004-09-20 20:34:53.172759000 -0700
@@ -12,8 +12,9 @@
    to eliminate the block move, so the constant gets emitted.
    Currently known targets with this problem: all ARM; PA32 ("hppa*.*"
    matches "hppa2.0w" but not "hppa64"); PPC if string instructions
-   are enabled (notably under AIX); S/390; Xtensa.  */
-/* { dg-final { scan-assembler-not "L\\\$?C\[^A-Z\]" { xfail arm-*-* strongarm-*-* xscale-*-* hppa-*-* hppa*.*-*-* powerpc*-*-aix* s390*-*-* xtensa-*-* } } } */
+   are enabled (notably under AIX); S/390; Xtensa; i386 and i486 (but
+   not later IA32 processors).  */
+/* { dg-final { scan-assembler-not "L\\\$?C\[^A-Z\]" { xfail arm-*-* strongarm-*-* xscale-*-* hppa-*-* hppa*.*-*-* powerpc*-*-aix* s390*-*-* xtensa-*-* i[34]86-*-* } } } */
 
 #define I (__extension__ 1.0iF)
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/format/cmn-err-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/format/cmn-err-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/format/cmn-err-1.c	1969-12-31 16:00:00.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/format/cmn-err-1.c	2004-09-21 19:02:45.304674000 -0700
@@ -0,0 +1,37 @@
+/* { dg-do compile { target *-*-solaris2.* } } */
+/* { 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, "%p", string);
+
+  cmn_err_func (0, "%i", i);		/* { dg-error "unknown|too many" } */
+  cmn_err_func (0, "%d", l);		/* { dg-error "int format, (long int|different type) arg" } */
+  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 "is not a pointer" } */
+  cmn_err_func (0, "%b", string, i);	/* { dg-error "int format, pointer arg|is not a pointer" } */
+  cmn_err_func (0, "%p", 3);            /* { dg-error "is not a pointer" } */
+  return 0;
+}
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-387-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-387-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-387-1.c	2003-07-30 15:48:45.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-387-1.c	2004-09-20 16:59:52.681771000 -0700
@@ -1,5 +1,6 @@
 /* Verify that -mno-fancy-math-387 works.  */
 /* { dg-do compile { target "i?86-*-*" } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O -ffast-math -mfpmath=387 -mno-fancy-math-387 -march=i386" } */
 /* { dg-final { scan-assembler "call\t_?sin" } } */
 /* { dg-final { scan-assembler "call\t_?cos" } } */
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-387-2.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-387-2.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-387-2.c	2003-06-15 06:32:31.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-387-2.c	2004-09-20 16:59:52.683973000 -0700
@@ -1,5 +1,6 @@
 /* Verify that -march overrides -mno-fancy-math-387.  */
 /* { dg-do compile { target "i?86-*-*" } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O -ffast-math -mfpmath=387 -march=i686 -mno-fancy-math-387" } */
 /* { dg-final { scan-assembler "fsin" } } */
 /* { dg-final { scan-assembler "fcos" } } */
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-387-3.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-387-3.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-387-3.c	2003-02-15 17:35:38.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-387-3.c	2004-09-20 16:59:52.684525000 -0700
@@ -1,5 +1,6 @@
 /* Verify that 387 mathematical constants are recognized.  */
 /* { dg-do compile { target "i?86-*-*" } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O2 -march=i686" } */
 /* { dg-final { scan-assembler "fldpi" } } */
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-387-4.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-387-4.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-387-4.c	2003-06-04 05:20:40.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-387-4.c	2004-09-20 16:59:52.684899000 -0700
@@ -1,4 +1,5 @@
 /* { dg-do compile { target "i?86-*-*" } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O2 -march=i686" } */
 /* { dg-final { scan-assembler "fldpi" } } */
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-387-5.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-387-5.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-387-5.c	2003-07-30 15:48:45.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-387-5.c	2004-09-20 16:59:52.685250000 -0700
@@ -1,5 +1,6 @@
 /* Verify that -mno-fancy-math-387 works.  */
 /* { dg-do compile { target "i?86-*-*" } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O -ffast-math -mfpmath=387 -mno-fancy-math-387 -march=i386" } */
 /* { dg-final { scan-assembler "call\t_?atan" } } */
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-387-6.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-387-6.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-387-6.c	2003-06-16 05:53:16.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-387-6.c	2004-09-20 16:59:52.688085000 -0700
@@ -1,5 +1,6 @@
 /* Verify that -march overrides -mno-fancy-math-387.  */
 /* { dg-do compile { target "i?86-*-*" } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O -ffast-math -mfpmath=387 -march=i686 -mno-fancy-math-387" } */
 /* { dg-final { scan-assembler "fpatan" } } */
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-asm-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-asm-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-asm-1.c	2004-02-26 06:31:54.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-asm-1.c	2004-09-20 16:59:52.688767000 -0700
@@ -1,5 +1,6 @@
 /* PR inline-asm/11676 */
 /* { dg-do run { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O2" } */
 
 static int bar(int x) __asm__("bar") __attribute__((regparm(1)));
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-bitfield1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-bitfield1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-bitfield1.c	2002-12-16 10:22:43.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-bitfield1.c	2004-09-20 16:59:52.689148000 -0700
@@ -1,5 +1,6 @@
 // Test for bitfield alignment in structs on IA-32
 // { dg-do run { target i?86-*-* } }
+/* { dg-forbid-option "-m64" } */
 // { dg-options "-O2" }
 // { dg-options "-mno-align-double -mno-ms-bitfields" { target *-*-interix* } }
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-bitfield2.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-bitfield2.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-bitfield2.c	2002-12-22 18:10:18.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-bitfield2.c	2004-09-20 16:59:52.689657000 -0700
@@ -1,5 +1,6 @@
 // Test for bitfield alignment in structs on IA-32
 // { dg-do run { target i?86-*-* } }
+/* { dg-forbid-option "-m64" } */
 // { dg-options "-O2" }
 // { dg-options "-mno-align-double -mno-ms-bitfields" { target *-*-interix* } }
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-loop-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-loop-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-loop-1.c	2003-03-09 07:40:00.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-loop-1.c	2004-09-20 16:59:52.703204000 -0700
@@ -1,5 +1,6 @@
 /* PR optimization/9888 */
 /* { dg-do run { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-mtune=k6 -O3" } */
 
 /* Verify that GCC doesn't emit out of range 'loop' instructions.  */
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-loop-2.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-loop-2.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-loop-2.c	2003-03-12 01:21:47.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-loop-2.c	2004-09-20 16:59:52.703610000 -0700
@@ -1,6 +1,7 @@
 /* PR optimization/9888 */
 /* Originator: Jim Bray <jb@as220.org> */
 /* { dg-do run { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-mtune=k6 -Os" } */
 
 enum reload_type
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-loop-3.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-loop-3.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-loop-3.c	2003-06-01 09:10:09.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-loop-3.c	2004-09-20 16:59:52.704152000 -0700
@@ -2,6 +2,7 @@
 /* Originator: Tim McGrath <misty-@charter.net> */
 /* Testcase contributed by Eric Botcazou <ebotcazou@libertysurf.fr> */
 /* { dg-do run { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-mtune=k6 -O3 -ffast-math -funroll-loops" } */
 
 typedef struct
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-pentium4-not-mull.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-pentium4-not-mull.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-pentium4-not-mull.c	2003-11-11 22:44:46.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-pentium4-not-mull.c	2004-09-20 16:59:52.704508000 -0700
@@ -1,5 +1,6 @@
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
 /* { dg-options "-O2 -march=pentium4" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" {target i?86-*-* } } */
 /* { dg-options "-O2 -march=pentium4 -m32" { target x86_64-*-* } } */
 /* { dg-final { scan-assembler-not "imull" } } */
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-pic-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-pic-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-pic-1.c	2002-12-19 09:06:45.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-pic-1.c	2004-09-20 16:59:52.705026000 -0700
@@ -1,5 +1,6 @@
 /* PR target/8340 */
 /* { dg-do compile { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-fPIC" } */
 
 int foo ()
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-regparm.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-regparm.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-regparm.c	2004-02-24 16:42:39.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-regparm.c	2004-09-20 16:59:52.705381000 -0700
@@ -1,4 +1,5 @@
 /* { dg-do compile { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-W -Wall" } */
 
 /* Verify that GCC correctly detects non-matching regparm attributes.  */
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-signbit-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-signbit-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-signbit-1.c	2003-03-25 02:18:47.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-signbit-1.c	2004-09-20 16:59:52.705862000 -0700
@@ -1,5 +1,6 @@
 /* PR optimization/8746 */
 /* { dg-do run { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O1 -mtune=i586" } */
 
 extern void abort (void);
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-signbit-2.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-signbit-2.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-signbit-2.c	2003-03-25 02:18:47.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-signbit-2.c	2004-09-20 16:59:52.706390000 -0700
@@ -1,5 +1,6 @@
 /* PR optimization/8746 */
 /* { dg-do run { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O1 -mtune=i586" } */
 
 extern void abort (void);
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-signbit-3.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-signbit-3.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-signbit-3.c	2003-03-25 02:18:47.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-signbit-3.c	2004-09-20 16:59:52.706913000 -0700
@@ -1,5 +1,6 @@
 /* PR optimization/8746 */
 /* { dg-do run { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-O1 -mtune=i586" } */
 
 extern void abort (void);
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-sse-2.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-sse-2.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-sse-2.c	2002-01-14 22:17:04.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-sse-2.c	2004-09-20 16:59:52.707430000 -0700
@@ -1,5 +1,6 @@
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
 /* { dg-options "-O0 -msse" } */
+/* { dg-forbid-option "-m64" {target i?86-*-* } } */
 
 /* Test that the intrinsics compile without optimization.  All of them are
    defined as inline functions in mmintrin.h that reference the proper
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-sse-5.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-sse-5.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-sse-5.c	2004-01-06 02:49:58.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-sse-5.c	2004-09-20 16:59:52.709630000 -0700
@@ -1,4 +1,5 @@
 /* { dg-do compile { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-Winline -O2 -march=i386" } */
 typedef int v2df __attribute__ ((mode(V2DF)));
 v2df p;
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-sse-8.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-sse-8.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-sse-8.c	2004-03-06 02:19:01.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-sse-8.c	2004-09-20 16:59:52.710128000 -0700
@@ -2,6 +2,7 @@
 /* Origin: <Pawe Sikora <pluto@ds14.agh.edu.pl> */
 
 /* { dg-do compile } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-march=pentium3" { target i?86-*-* x86_64-*-* } } */
 
 int main() 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-unroll-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-unroll-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/i386-unroll-1.c	2003-02-22 19:10:03.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/i386-unroll-1.c	2004-09-20 16:59:52.717861000 -0700
@@ -1,5 +1,6 @@
 /* PR optimization/8599 */
 /* { dg-do run { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 /* { dg-options "-mtune=k6 -O2 -funroll-loops" } */
 
 extern void exit (int);
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/pragma-align-2.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/pragma-align-2.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/pragma-align-2.c	1969-12-31 16:00:00.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/pragma-align-2.c	2004-09-20 16:59:52.718366000 -0700
@@ -0,0 +1,69 @@
+/* { dg-do run { target *-*-solaris2.* } } */
+
+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)
+
+#define MACRO 128
+#define MACRO2(A) A
+
+#pragma align MACRO(y128)
+#pragma align MACRO2(MACRO) (z128)
+
+#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 x1, x2, x4, x8, y8, z8, x16, y16, x32, x64, x128, y128, z128;
+
+#pragma align 16(y16)
+
+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__ (y16) < 16)
+    abort ();
+
+  if (__alignof__ (x32) < 32)
+    abort ();
+
+  if (__alignof__ (x64) < 64)
+    abort ();
+
+  if (__alignof__ (x128) < 128)
+    abort ();
+
+  if (__alignof__ (y128) < 128)
+    abort ();
+
+  if (__alignof__ (z128) < 128)
+    abort (); 
+
+  return 0;
+}
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/pragma-align.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/pragma-align.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/pragma-align.c	2000-09-11 15:47:05.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/pragma-align.c	2004-09-20 16:59:52.721455000 -0700
@@ -1,13 +1,13 @@
 /* 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* *-*-solaris2.* } } */
 
 struct {
         char one;
         long two;
 } defaultalign;
 
-#pragma pack(4)
+#pragma pack(16)
 struct {
         char one;
         long two;
@@ -39,4 +39,3 @@ main()
         if(sizeof(resetalign) != sizeof(defaultalign)) abort();
 	return 0;
 }
-
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/pragma-init-fini-2.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/pragma-init-fini-2.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/pragma-init-fini-2.c	1969-12-31 16:00:00.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/pragma-init-fini-2.c	2004-09-20 16:59:52.721868000 -0700
@@ -0,0 +1,15 @@
+/* Tests for #pragma init and #pragma fini.  */
+
+/* { dg-do link { target *-*-solaris2.* } } */
+/* { dg-options "-fpic" } */
+
+#include <stdio.h>
+
+#pragma fini (f)
+
+void f() {
+  fprintf (stderr, "f\n");
+}
+
+int main () {
+}
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/pragma-init-fini.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/pragma-init-fini.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/pragma-init-fini.c	1969-12-31 16:00:00.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/pragma-init-fini.c	2004-09-20 16:59:52.723136000 -0700
@@ -0,0 +1,50 @@
+/* Tests for #pragma init and #pragma fini.  */
+
+/* { dg-do run { target *-*-solaris2.* } } */
+
+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;
+}
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/pragma-pack-2.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/pragma-pack-2.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/pragma-pack-2.c	1969-12-31 16:00:00.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/pragma-pack-2.c	2004-09-20 16:59:52.724814000 -0700
@@ -0,0 +1,46 @@
+/* On Solaris, #pragma pack should accept macro expansion.  */
+
+/* { dg-do run { target *-*-solaris2.* } } */
+
+struct {
+        char one;
+        long two;
+} defaultalign;
+
+#define ALIGNHIGH 16
+
+#pragma pack(ALIGNHIGH)
+struct {
+        char one;
+        long two;
+} sixteen;
+
+#define ALIGN1(X) 1
+#pragma pack(ALIGN1(4))
+struct {
+        char one;
+        long two;
+} two;
+
+#define ALIGN2(X) X
+#pragma pack(ALIGN2(2))
+struct {
+        char one;
+        long two;
+} three;
+
+#define EMPTY
+#pragma pack(EMPTY)
+struct {
+        char one;
+        long two;
+} resetalign;
+
+main()
+{
+        if(sizeof(sixteen) < sizeof(defaultalign)) abort();
+        if(sizeof(two) >= sizeof(defaultalign)) abort();
+        if(sizeof(three) <= sizeof(two)) abort();
+        if(sizeof(resetalign) != sizeof(defaultalign)) abort();
+	return 0;
+}
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/pragma-re-3.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/pragma-re-3.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/pragma-re-3.c	1969-12-31 16:00:00.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/pragma-re-3.c	2004-09-21 19:06:14.127880000 -0700
@@ -0,0 +1,18 @@
+/* { dg-do link { target *-*-solaris* } } */
+
+#pragma redefine_extname f1 f
+#pragma redefine_extname g1 g
+
+void f() {
+  extern int f1();
+  f1();
+}
+
+void g() {
+  g1();
+}
+
+int main () {
+  f();
+  g();
+}
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/tls/alias-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/tls/alias-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/tls/alias-1.c	2004-01-19 09:05:46.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/tls/alias-1.c	2004-09-20 16:59:52.725403000 -0700
@@ -1,5 +1,6 @@
 /* { dg-do link } */
-/* { dg-warning "visibility" "unsupported" { target sparc*-sun-solaris2.* } 22 } */
+/* { dg-require-visibility "" } */
+
 /* Test that encode_section_info handles the change from externally
    defined to locally defined (via hidden).   Extracted from glibc.  */
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/tls/opt-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/tls/opt-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/tls/opt-1.c	2003-05-16 12:35:42.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/tls/opt-1.c	2004-09-20 16:59:52.725772000 -0700
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fPIC" } */
 /* { dg-options "-O2 -fPIC -mtune=i686" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 
 extern __thread int thr;
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/tls/opt-2.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/tls/opt-2.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/tls/opt-2.c	2002-08-08 17:01:12.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/tls/opt-2.c	2004-09-20 16:59:52.726127000 -0700
@@ -5,6 +5,7 @@
 /* { dg-do link } */
 /* { dg-options "-O2 -ftls-model=initial-exec" } */
 /* { dg-options "-O2 -ftls-model=initial-exec -march=i686" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 
 __thread int thr;
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/unroll-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/unroll-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.dg/unroll-1.c	2003-05-16 12:35:43.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.dg/unroll-1.c	2004-09-20 16:59:52.726505000 -0700
@@ -2,6 +2,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -funroll-loops" } */
 /* { dg-options "-mtune=k6 -O2 -funroll-loops" { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" {target i?86-*-* } } */
 
 extern void abort (void);
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.misc-tests/i386-pf-3dnow-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.misc-tests/i386-pf-3dnow-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.misc-tests/i386-pf-3dnow-1.c	2002-01-15 09:30:28.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.misc-tests/i386-pf-3dnow-1.c	2004-09-20 16:59:52.739837000 -0700
@@ -2,6 +2,7 @@
    variants that use 3DNow! prefetch instructions.  */
 
 /* { dg-do compile { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 
 char *msg = "howdy there";
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c	2002-01-15 09:30:28.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c	2004-09-20 16:59:52.740351000 -0700
@@ -3,6 +3,7 @@
    locality hints.  */
 
 /* { dg-do compile { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 
 char *msg = "howdy there";
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.misc-tests/i386-pf-none-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.misc-tests/i386-pf-none-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.misc-tests/i386-pf-none-1.c	2002-01-15 09:30:28.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.misc-tests/i386-pf-none-1.c	2004-09-20 16:59:52.740713000 -0700
@@ -2,6 +2,7 @@
    that do not support those instructions.  */
 
 /* { dg-do compile { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 
 char *msg = "howdy there";
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.misc-tests/i386-pf-sse-1.c /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.misc-tests/i386-pf-sse-1.c
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/gcc.misc-tests/i386-pf-sse-1.c	2002-01-15 09:30:28.000000000 -0800
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/gcc.misc-tests/i386-pf-sse-1.c	2004-09-20 16:59:52.741234000 -0700
@@ -2,6 +2,7 @@
    variants that use SSE prefetch instructions.  */
 
 /* { dg-do compile { target i?86-*-* } } */
+/* { dg-forbid-option "-m64" } */
 
 char *msg = "howdy there";
 
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/lib/gcc-dg.exp /export/home/mark/src/gcc-3.4.2/gcc/testsuite/lib/gcc-dg.exp
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/lib/gcc-dg.exp	2004-04-09 15:23:00.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/lib/gcc-dg.exp	2004-09-20 16:59:52.749983000 -0700
@@ -359,6 +359,37 @@ proc dg-require-named-sections { args } 
    }
 }
 
+# ARGS is a list.  The 0th element is the line number at which the
+# dg-forbid-option directive appeared in the source file.  The 1st
+# element is a regular expression.  If the regular expression matches
+# the command-line options implied by the current multilib, then the
+# test will be treated as unsupported.  The 2nd element of the list,
+# if present, is a target selector conditionalizing this directive;
+# if the target selector does not match the current target, this
+# dg-forbid-option directive is ignored.
+
+proc dg-forbid-option { args } {
+    set target_name [target_info name]
+    set pattern [lindex $args 1]
+
+    if {[llength $args] > 2} {
+	set selector [lindex $args 2]
+	if { [dg-process-target $selector] == "N" } {
+	    return
+	}
+    }
+	
+    # Check to see if the option occurs in the multilib options
+    # for this target.
+    if {[board_info $target_name exists multilib_flags]} {
+	set multilib_flags [board_info $target_name multilib_flags]
+	if { [regexp -- ${pattern} $multilib_flags] } {
+	    upvar dg-do-what dg-do-what
+	    set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+	}
+    }
+}
+
 # Prune any messages matching ARGS[1] (a regexp) from test output.
 proc dg-prune-output { args } {
     global additional_prunes
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/lib/target-supports.exp /export/home/mark/src/gcc-3.4.2/gcc/testsuite/lib/target-supports.exp
--- /export/home/mark/src/gcc-3.4.2.orig/gcc/testsuite/lib/target-supports.exp	2004-08-23 11:03:13.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/gcc/testsuite/lib/target-supports.exp	2004-09-20 16:59:52.765504000 -0700
@@ -67,23 +67,26 @@ proc check_weak_available { } {
 ###############################
 
 # The visibility attribute is only support in some object formats
-# This proc returns 1 if it is supported, 0 if not, -1 if unsure.
+# This proc returns 1 if it is supported, 0 if not.
 
 proc check_visibility_available { } {
-    global target_triplet
-    global target_cpu
+    global visibility_available_saved
+    global tool
 
-    # ELF supports it if the system has recent GNU ld and gas.
-    # As a start we return 1 for all ELF systems; we'll let people
-    # add exceptions as necessary.
-
-    set objformat [gcc_target_object_format]
-
-    switch $objformat {
-        elf      { return 1 }
-        unknown  { return -1 }
-        default  { return 0 }
+    if {![info exists visibility_available_saved] } {
+	set f [open "tmp.c" "w"]
+	puts $f {void f() __attribute__((visibility("hidden")));}
+	puts $f "void f() {}"
+	close $f
+	set lines [${tool}_target_compile "tmp.c" "tmp.o" object ""]
+	file delete "tmp.c"
+	if [string match "" $lines] then {
+	    set visibility_available_saved 1
+	} else {
+	    set visibility_available_saved 0
+	}
     }
+    return $visibility_available_saved
 }
 
 ###############################
diff -Nrup /export/home/mark/src/gcc-3.4.2.orig/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc /export/home/mark/src/gcc-3.4.2/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc
--- /export/home/mark/src/gcc-3.4.2.orig/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc	2003-09-23 13:03:07.000000000 -0700
+++ /export/home/mark/src/gcc-3.4.2/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc	2004-09-21 18:52:40.432611000 -0700
@@ -20,10 +20,10 @@
 
 // 27.6.1.2.2 arithmetic extractors
 
-// XXX This test fails on sparc-solaris2 because of a bug in libc
+// XXX This test fails on Solaris 2 because of a bug in libc
 // XXX sscanf for very long input.  See:
 // XXX http://gcc.gnu.org/ml/gcc/2002-12/msg01422.html
-// { dg-do run { xfail sparc*-*-solaris2* } }
+// { dg-do run { xfail *-*-solaris2* } }
 
 #include <istream>
 #include <sstream>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]