This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 1/4] NetWare: basic adjustments, following changes elsewhere in the compiler
- From: "Jan Beulich" <JBeulich at novell dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 23 Jul 2009 15:14:11 +0100
- Subject: [PATCH 1/4] NetWare: basic adjustments, following changes elsewhere in the compiler
2009-07-23 Jan Beulich <jbeulich@novell.com>
* config/i386/netware.c: Include langhooks.h.
(i386_nlm_encode_section_info): Simplify.
(netware_override_options): Delete.
* config/i386/netware.h (netware_override_options): Delete
declaration.
(OVERRIDE_OPTIONS): Delete definition.
(SUBTARGET_OVERRIDE_OPTIONS): Define.
(ASM_COMMENT_START): Define.
* config/i386/nwld.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Define.
--- trunk/gcc/config/i386/netware.c
+++ trunk/gcc/config/i386/netware.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3.
#include "flags.h"
#include "tm_p.h"
#include "toplev.h"
+#include "langhooks.h"
#include "ggc.h"
/* Return string which is the function name, identified by ID, modified
@@ -179,16 +180,15 @@ i386_nlm_encode_section_info (tree decl,
{
default_encode_section_info (decl, rtl, first);
- if (first
- && TREE_CODE (decl) == FUNCTION_DECL
+ if (TREE_CODE (decl) == FUNCTION_DECL
/* Do not change the identifier if a verbatim asmspec
or if stdcall suffix already added. */
&& *IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)) != '*'
- && !strchr (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)), '@'))
+ && !strchr (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)), '@')
+ /* FIXME: Imported stdcall names are not modified by the Ada frontend.
+ Check and decorate the RTL name now. */
+ && strcmp (lang_hooks.name, "GNU Ada") == 0)
{
- /* FIXME: In Ada, and perhaps other language frontends,
- imported stdcall names may not yet have been modified.
- Check and do it know. */
rtx symbol = XEXP (rtl, 0);
tree new_id;
tree old_id = DECL_ASSEMBLER_NAME (decl);
@@ -196,14 +196,7 @@ i386_nlm_encode_section_info (tree decl,
gcc_assert (GET_CODE (symbol) == SYMBOL_REF);
if ((new_id = i386_nlm_maybe_mangle_decl_assembler_name (decl, old_id)))
- {
- /* These attributes must be present on first declaration,
- change_decl_assembler_name will warn if they are added
- later and the decl has been referenced, but duplicate_decls
- should catch the mismatch first. */
- change_decl_assembler_name (decl, new_id);
- XSTR (symbol, 0) = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
- }
+ XSTR (symbol, 0) = IDENTIFIER_POINTER (new_id);
}
}
@@ -233,24 +226,3 @@ i386_nlm_strip_name_encoding (const char
}
return name;
}
-
-/* Sometimes certain combinations of command options do not make
- sense on a particular target machine. You can define a macro
- `OVERRIDE_OPTIONS' to take account of this. This macro, if
- defined, is executed once just after all the command options have
- been parsed.
-
- Don't use this macro to turn on various extra optimizations for
- `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
-
-void
-netware_override_options (void)
-{
- override_options ();
-
- if (flag_pic)
- {
- error ("-fPIC and -fpic are not supported for this target");
- flag_pic = 0;
- }
-}
--- trunk/gcc/config/i386/netware.h
+++ trunk/gcc/config/i386/netware.h
@@ -72,17 +72,16 @@ along with GCC; see the file COPYING3.
#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | \
MASK_FLOAT_RETURNS | MASK_ALIGN_DOUBLE | MASK_MS_BITFIELD_LAYOUT)
-/* Sometimes certain combinations of command options do not make
- sense on a particular target machine. You can define a macro
- `OVERRIDE_OPTIONS' to take account of this. This macro, if
- defined, is executed once just after all the command options have
- been parsed.
-
- Don't use this macro to turn on various extra optimizations for
- `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
-#undef OVERRIDE_OPTIONS
-extern void netware_override_options (void);
-#define OVERRIDE_OPTIONS netware_override_options ()
+/* Don't allow flag_pic to propagate since invalid relocations will
+ result otherwise. */
+#define SUBTARGET_OVERRIDE_OPTIONS \
+do { \
+ if (flag_pic) \
+ { \
+ error ("-fPIC and -fpic are not supported for this target"); \
+ flag_pic = 0; \
+ } \
+} while (0)
#undef MATH_LIBRARY
#define MATH_LIBRARY ""
@@ -99,6 +98,9 @@ extern void netware_override_options (vo
#undef KEEP_AGGREGATE_RETURN_POINTER
#define KEEP_AGGREGATE_RETURN_POINTER 1
+#undef ASM_COMMENT_START
+#define ASM_COMMENT_START "#"
+
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) (svr4_dbx_register_map[n])
--- trunk/gcc/config/i386/nwld.h
+++ trunk/gcc/config/i386/nwld.h
@@ -55,6 +55,13 @@ void nwld_named_section_asm_out_destruct
#define TARGET_ASM_CONSTRUCTOR nwld_named_section_asm_out_constructor
#define TARGET_ASM_DESTRUCTOR nwld_named_section_asm_out_destructor
+#define SUBSUBTARGET_OVERRIDE_OPTIONS \
+do { \
+ /* XXX This can be enabled once gas output meets nwld's needs. */ \
+ /* if (!flag_unwind_tables && !flag_exceptions) */ \
+ flag_dwarf2_cfi_asm = 0; \
+} while (0)
+
#undef EH_FRAME_SECTION_NAME
#define EH_FRAME_SECTION_NAME ".eh_frame"TARGET_SUB_SECTION_SEPARATOR