This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Committed, CRIS: .opt files.
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 23 Apr 2005 16:05:23 +0200
- Subject: Committed, CRIS: .opt files.
A nit: I would have preferred to keep the TARGET_MASK_ prefix;
the MASK_ prefix seems prone to cause option names to collide
with some other internal use.
A future change in this area would be to move semantics checking
into cris_handle_option, so the option could be rejected as
wrong instead of an error emitted later. And dropping some
needless allocations of target_flag bits where separate
variables would do, of course. No test-cases added for this; I
just tested each option manually. No regressions with
cris-axis-elf and cris-axis-linux-gnu cross-testing.
* config.gcc <cris-*>: Specify .opt files.
* config/cris/cris.opt, config/cris/elf.opt, config/cris/aout.opt,
config/cris/linux.opt: New files.
* config/cris/aout.h (CRIS_SUBTARGET_SWITCHES)
(CRIS_SUBTARGET_LONG_OPTIONS): Don't define.
(TARGET_ELF): Override to 0.
(CRIS_SUBTARGET_HANDLE_OPTION): Override to handle -melinux and
-melinux-stacksize=N.
* config/cris/cris.c: (cris_handle_option): New function.
(TARGET_DEFAULT_TARGET_FLAGS): Override.
(TARGET_HANDLE_OPTION): Override to cris_handle_option.
(cris_override_options): Use MASK_*, not TARGET_MASK_*.
* config/cris/cris.h (TARGET_MASK_SVINTO, TARGET_SVINTO,
(TARGET_MASK_CCINIT, TARGET_CCINIT, TARGET_MASK_PDEBUG)
(TARGET_PDEBUG, TARGET_MASK_SIDE_EFFECT_PREFIXES)
(TARGET_SIDE_EFFECT_PREFIXES, TARGET_MASK_EXPAND_MUL)
(TARGET_EXPAND_MUL, TARGET_MASK_STACK_ALIGN, TARGET_STACK_ALIGN)
(TARGET_MASK_CONST_ALIGN, TARGET_CONST_ALIGN)
(TARGET_MASK_DATA_ALIGN, TARGET_DATA_ALIGN)
(TARGET_MASK_PROLOGUE_EPILOGUE, TARGET_PROLOGUE_EPILOGUE)
(TARGET_MASK_ETRAX4_ADD, TARGET_ETRAX4_ADD)
(TARGET_MASK_ALIGN_BY_32, TARGET_ALIGN_BY_32, TARGET_MASK_ELF)
(TARGET_ELF, TARGET_MASK_LINUX, TARGET_LINUX)
(TARGET_MASK_AVOID_GOTPLT, TARGET_AVOID_GOTPLT)
(TARGET_MASK_MUL_BUG, TARGET_MUL_BUG, TARGET_SWITCHES)
(CRIS_SUBTARGET_SWITCHES, TARGET_OPTIONS)
(CRIS_SUBTARGET_LONG_OPTIONS): Don't define.
(TARGET_LINUX): Define 0.
(TARGET_DEFAULT): Use MASK_*, not TARGET_MASK_*.
(CRIS_SUBTARGET_DEFAULT): Define to 0, not TARGET_MASK_ELF.
(CRIS_SUBTARGET_DEFAULT): New empty default macro.
* config/cris/linux.h (CRIS_SUBTARGET_SWITCHES): Don't define.
(TARGET_LINUX): Override to 1.
(CRIS_SUBTARGET_DEFAULT): Use MASK_*, not TARGET_MASK_*.
Index: config/cris/aout.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/aout.h,v
retrieving revision 1.16
diff -u -p -r1.16 aout.h
--- config/cris/aout.h 27 Jan 2005 18:22:28 -0000 1.16
+++ config/cris/aout.h 23 Apr 2005 04:12:01 -0000
@@ -74,22 +74,35 @@ Boston, MA 02111-1307, USA. */
%{static:-Bstatic}}\
%{melinux-stacksize=*:-defsym __Stacksize=%*}"
-#undef CRIS_SUBTARGET_SWITCHES
-#define CRIS_SUBTARGET_SWITCHES \
- {"elinux", (TARGET_MASK_SVINTO \
- + TARGET_MASK_STACK_ALIGN \
- + TARGET_MASK_CONST_ALIGN \
- + TARGET_MASK_DATA_ALIGN \
- + TARGET_MASK_ETRAX4_ADD \
- + TARGET_MASK_ALIGN_BY_32), \
- N_("Compile for the MMU-less Etrax 100-based elinux system")}, \
- /* Legacy option. */ \
- {"aout", 0, ""},
-
-#undef CRIS_SUBTARGET_LONG_OPTIONS
-#define CRIS_SUBTARGET_LONG_OPTIONS \
- {"elinux-stacksize=", &cris_elinux_stacksize_str, \
- N_("For elinux, request a specified stack-size for this program"), 0}, \
+/* Previously controlled by target_flags. */
+#undef TARGET_ELF
+#define TARGET_ELF 0
+
+#undef CRIS_SUBTARGET_HANDLE_OPTION
+#define CRIS_SUBTARGET_HANDLE_OPTION(CODE, ARG, VALUE) \
+ do \
+ { \
+ switch (CODE) \
+ { \
+ case OPT_melinux: \
+ target_flags \
+ |= (MASK_SVINTO \
+ + MASK_STACK_ALIGN \
+ + MASK_CONST_ALIGN \
+ + MASK_DATA_ALIGN \
+ + MASK_ETRAX4_ADD \
+ + MASK_ALIGN_BY_32); \
+ break; \
+ \
+ case OPT_melinux_stacksize_: \
+ cris_elinux_stacksize_str = (ARG); \
+ break; \
+ \
+ default: \
+ break; \
+ } \
+ } \
+ while (0)
#undef CRIS_SUBTARGET_VERSION
#define CRIS_SUBTARGET_VERSION " - a.out"
Index: config/cris/cris.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/cris.c,v
retrieving revision 1.72
diff -u -p -r1.72 cris.c
--- config/cris/cris.c 20 Apr 2005 22:31:29 -0000 1.72
+++ config/cris/cris.c 23 Apr 2005 04:12:01 -0000
@@ -134,6 +134,8 @@ static int cris_arg_partial_bytes (CUMUL
tree, bool);
static tree cris_md_asm_clobbers (tree, tree, tree);
+static bool cris_handle_option (size_t, const char *, int);
+
/* This is the argument from the "-max-stack-stackframe=" option. */
const char *cris_max_stackframe_str;
@@ -200,6 +202,10 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_
#define TARGET_ARG_PARTIAL_BYTES cris_arg_partial_bytes
#undef TARGET_MD_ASM_CLOBBERS
#define TARGET_MD_ASM_CLOBBERS cris_md_asm_clobbers
+#undef TARGET_DEFAULT_TARGET_FLAGS
+#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | CRIS_SUBTARGET_DEFAULT)
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION cris_handle_option
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -2032,6 +2038,77 @@ cris_got_symbol (rtx x)
return 1;
}
+/* TARGET_HANDLE_OPTION worker. We just store the values into local
+ variables here. Checks for correct semantics are in
+ cris_override_options. */
+
+static bool
+cris_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
+{
+ switch (code)
+ {
+ case OPT_metrax100:
+ target_flags
+ |= (MASK_SVINTO
+ + MASK_ETRAX4_ADD
+ + MASK_ALIGN_BY_32);
+ break;
+
+ case OPT_mno_etrax100:
+ target_flags
+ &= ~(MASK_SVINTO
+ + MASK_ETRAX4_ADD
+ + MASK_ALIGN_BY_32);
+ break;
+
+ case OPT_m32_bit:
+ case OPT_m32bit:
+ target_flags
+ |= (MASK_STACK_ALIGN
+ + MASK_CONST_ALIGN
+ + MASK_DATA_ALIGN
+ + MASK_ALIGN_BY_32);
+ break;
+
+ case OPT_m16_bit:
+ case OPT_m16bit:
+ target_flags
+ |= (MASK_STACK_ALIGN
+ + MASK_CONST_ALIGN
+ + MASK_DATA_ALIGN);
+ break;
+
+ case OPT_m8_bit:
+ case OPT_m8bit:
+ target_flags
+ &= ~(MASK_STACK_ALIGN
+ + MASK_CONST_ALIGN
+ + MASK_DATA_ALIGN);
+ break;
+
+ case OPT_max_stackframe_:
+ case OPT_mmax_stackframe_:
+ cris_max_stackframe_str = arg;
+ break;
+
+ case OPT_march_:
+ case OPT_mcpu_:
+ cris_cpu_str = arg;
+ break;
+
+ case OPT_mtune_:
+ cris_tune_str = arg;
+ break;
+
+ default:
+ break;
+ }
+
+ CRIS_SUBTARGET_HANDLE_OPTION(code, arg, value);
+
+ return true;
+}
+
/* The OVERRIDE_OPTIONS worker.
As is the norm, this also parses -mfoo=bar type parameters. */
@@ -2077,14 +2154,14 @@ cris_override_options (void)
/* Set the target flags. */
if (cris_cpu_version >= CRIS_CPU_ETRAX4)
- target_flags |= TARGET_MASK_ETRAX4_ADD;
+ target_flags |= MASK_ETRAX4_ADD;
/* If this is Svinto or higher, align for 32 bit accesses. */
if (cris_cpu_version >= CRIS_CPU_SVINTO)
target_flags
- |= (TARGET_MASK_SVINTO | TARGET_MASK_ALIGN_BY_32
- | TARGET_MASK_STACK_ALIGN | TARGET_MASK_CONST_ALIGN
- | TARGET_MASK_DATA_ALIGN);
+ |= (MASK_SVINTO | MASK_ALIGN_BY_32
+ | MASK_STACK_ALIGN | MASK_CONST_ALIGN
+ | MASK_DATA_ALIGN);
/* Note that we do not add new flags when it can be completely
described with a macro that uses -mcpu=X. So
@@ -2115,8 +2192,8 @@ cris_override_options (void)
/* We have currently nothing more to tune than alignment for
memory accesses. */
target_flags
- |= (TARGET_MASK_STACK_ALIGN | TARGET_MASK_CONST_ALIGN
- | TARGET_MASK_DATA_ALIGN | TARGET_MASK_ALIGN_BY_32);
+ |= (MASK_STACK_ALIGN | MASK_CONST_ALIGN
+ | MASK_DATA_ALIGN | MASK_ALIGN_BY_32);
}
if (flag_pic)
Index: config/cris/cris.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/cris.h,v
retrieving revision 1.90
diff -u -p -r1.90 cris.h
--- config/cris/cris.h 20 Apr 2005 22:31:29 -0000 1.90
+++ config/cris/cris.h 23 Apr 2005 04:12:01 -0000
@@ -257,182 +257,23 @@ extern const char *cris_elinux_stacksize
/* This needs to be at least 32 bits. */
extern int target_flags;
-/* Currently this just affects alignment. FIXME: Redundant with
- TARGET_ALIGN_BY_32, or put machine stuff here? */
-#define TARGET_MASK_SVINTO 1
-#define TARGET_SVINTO (target_flags & TARGET_MASK_SVINTO)
-
-/* If to use condition-codes generated by insns other than the
- immediately preceding compare/test insn.
- Used to check for errors in notice_update_cc. */
-#define TARGET_MASK_CCINIT 2
-#define TARGET_CCINIT (target_flags & TARGET_MASK_CCINIT)
-
-/* Debug option. */
-#define TARGET_MASK_PDEBUG 4
-#define TARGET_PDEBUG (target_flags & TARGET_MASK_PDEBUG)
-
-/* If to use side-effect patterns. Used to debug the [rx=ry+i] type
- patterns. */
-#define TARGET_MASK_SIDE_EFFECT_PREFIXES 8
-#define TARGET_SIDE_EFFECT_PREFIXES \
- (target_flags & TARGET_MASK_SIDE_EFFECT_PREFIXES)
-
-/* If to expand mul into mstep. Only used when making libc.a. */
-#define TARGET_MASK_EXPAND_MUL 16
-#define TARGET_EXPAND_MUL (target_flags & TARGET_MASK_EXPAND_MUL)
-
-/* If to *keep* (not force) alignment of stack at 16 bits. */
-#define TARGET_MASK_STACK_ALIGN 32
-#define TARGET_STACK_ALIGN (target_flags & TARGET_MASK_STACK_ALIGN)
-
-/* If to do alignment on individual non-modifiable objects. */
-#define TARGET_MASK_CONST_ALIGN 64
-#define TARGET_CONST_ALIGN (target_flags & TARGET_MASK_CONST_ALIGN)
-
-/* If to do alignment on individual modifiable objects. */
-#define TARGET_MASK_DATA_ALIGN 128
-#define TARGET_DATA_ALIGN (target_flags & TARGET_MASK_DATA_ALIGN)
-
-/* If not to omit function prologue and epilogue. */
-#define TARGET_MASK_PROLOGUE_EPILOGUE 256
-#define TARGET_PROLOGUE_EPILOGUE (target_flags & TARGET_MASK_PROLOGUE_EPILOGUE)
-
-/* Instructions additions from Etrax 4 and up.
- (Just "lz", which we don't really generate from GCC -- yet). */
-#define TARGET_MASK_ETRAX4_ADD 512
-#define TARGET_ETRAX4_ADD (target_flags & TARGET_MASK_ETRAX4_ADD)
-
-/* Say that all alignment specifications say to prefer 32 rather
- than 16 bits. */
-#define TARGET_MASK_ALIGN_BY_32 1024
-#define TARGET_ALIGN_BY_32 (target_flags & TARGET_MASK_ALIGN_BY_32)
-
-/* This condition is of limited use, as gcc is riddled with #ifdef:s
- controlling this, rather than if (...):s. */
-#define TARGET_MASK_ELF 2048
-#define TARGET_ELF (target_flags & TARGET_MASK_ELF)
-
-/* Currently just used to error-check other options. Note that this is
- *not* set for -melinux. */
-#define TARGET_MASK_LINUX 4096
-#define TARGET_LINUX (target_flags & TARGET_MASK_LINUX)
-
-/* There's a small setup cost with using GOTPLT references, but should
- in total be a win both in code-size and execution-time. */
-#define TARGET_MASK_AVOID_GOTPLT 8192
-#define TARGET_AVOID_GOTPLT (target_flags & TARGET_MASK_AVOID_GOTPLT)
-
-/* Whether or not to work around multiplication instruction hardware bug
- when generating code for models where it may be present. From the
- trouble report for Etrax 100 LX: "A multiply operation may cause
- incorrect cache behaviour under some specific circumstances. The
- problem can occur if the instruction following the multiply instruction
- causes a cache miss, and multiply operand 1 (source operand) bits
- [31:27] matches the logical mapping of the mode register address
- (0xb0....), and bits [9:2] of operand 1 matches the TLB register
- address (0x258-0x25f). There is such a mapping in kernel mode or when
- the MMU is off. Normally there is no such mapping in user mode, and
- the problem will therefore probably not occur in Linux user mode
- programs."
-
- We have no sure-fire way to know from within GCC that we're compiling a
- user program. For example, -fpic/PIC is used in libgcc which is linked
- into the kernel. However, the workaround option -mno-mul-bug can be
- safely used per-package when compiling programs. The same goes for
- general user-only libraries such as glibc, since there's no user-space
- driver-like program that gets a mapping of I/O registers (all on the
- same page, including the TLB registers). */
-#define TARGET_MASK_MUL_BUG 16384
-#define TARGET_MUL_BUG (target_flags & TARGET_MASK_MUL_BUG)
-
-#define TARGET_SWITCHES \
- { \
- {"mul-bug-workaround", TARGET_MASK_MUL_BUG, \
- N_("Work around bug in multiplication instruction")}, \
- {"no-mul-bug-workaround", -TARGET_MASK_MUL_BUG, ""}, \
- /* No "no-etrax" as it does not really imply any model. \
- On the other hand, "etrax" implies the common (and large) \
- subset matching all models. */ \
- {"etrax4", TARGET_MASK_ETRAX4_ADD, \
- N_("Compile for ETRAX 4 (CRIS v3)")}, \
- {"no-etrax4", -TARGET_MASK_ETRAX4_ADD, ""}, \
- {"etrax100", (TARGET_MASK_SVINTO \
- + TARGET_MASK_ETRAX4_ADD \
- + TARGET_MASK_ALIGN_BY_32), \
- N_("Compile for ETRAX 100 (CRIS v8)")}, \
- {"no-etrax100", -(TARGET_MASK_SVINTO \
- + TARGET_MASK_ETRAX4_ADD), ""}, \
- {"pdebug", TARGET_MASK_PDEBUG, \
- N_("Emit verbose debug information in assembly code")}, \
- {"no-pdebug", -TARGET_MASK_PDEBUG, ""}, \
- {"cc-init", TARGET_MASK_CCINIT, \
- N_("Do not use condition codes from normal instructions")}, \
- {"no-cc-init", -TARGET_MASK_CCINIT, ""}, \
- {"side-effects", TARGET_MASK_SIDE_EFFECT_PREFIXES, ""}, \
- {"no-side-effects", -TARGET_MASK_SIDE_EFFECT_PREFIXES, \
- N_("Do not emit addressing modes with side-effect assignment")}, \
- {"stack-align", TARGET_MASK_STACK_ALIGN, ""}, \
- {"no-stack-align", -TARGET_MASK_STACK_ALIGN, \
- N_("Do not tune stack alignment")}, \
- {"data-align", TARGET_MASK_DATA_ALIGN, ""}, \
- {"no-data-align", -TARGET_MASK_DATA_ALIGN, \
- N_("Do not tune writable data alignment")}, \
- {"const-align", TARGET_MASK_CONST_ALIGN, ""}, \
- {"no-const-align", -TARGET_MASK_CONST_ALIGN, \
- N_("Do not tune code and read-only data alignment")}, \
- {"32-bit", (TARGET_MASK_STACK_ALIGN \
- + TARGET_MASK_CONST_ALIGN \
- + TARGET_MASK_DATA_ALIGN \
- + TARGET_MASK_ALIGN_BY_32), ""}, \
- {"32bit", (TARGET_MASK_STACK_ALIGN \
- + TARGET_MASK_CONST_ALIGN \
- + TARGET_MASK_DATA_ALIGN \
- + TARGET_MASK_ALIGN_BY_32), \
- N_("Align code and data to 32 bits")}, \
- {"16-bit", (TARGET_MASK_STACK_ALIGN \
- + TARGET_MASK_CONST_ALIGN \
- + TARGET_MASK_DATA_ALIGN), ""}, \
- {"16bit", (TARGET_MASK_STACK_ALIGN \
- + TARGET_MASK_CONST_ALIGN \
- + TARGET_MASK_DATA_ALIGN), ""}, \
- {"8-bit", -(TARGET_MASK_STACK_ALIGN \
- + TARGET_MASK_CONST_ALIGN \
- + TARGET_MASK_DATA_ALIGN), ""}, \
- {"8bit", -(TARGET_MASK_STACK_ALIGN \
- + TARGET_MASK_CONST_ALIGN \
- + TARGET_MASK_DATA_ALIGN), \
- N_("Don't align items in code or data")}, \
- {"prologue-epilogue", TARGET_MASK_PROLOGUE_EPILOGUE, ""}, \
- {"no-prologue-epilogue", -TARGET_MASK_PROLOGUE_EPILOGUE, \
- N_("Do not emit function prologue or epilogue")}, \
- /* We have to handle this m-option here since we can't wash it off in \
- both CC1_SPEC and CC1PLUS_SPEC. */ \
- {"best-lib-options", 0, \
- N_("Use the most feature-enabling options allowed by other options")}, \
- \
- /* We must call it "override-" since calling it "no-" will cause \
- gcc.c to forget it, if there's a "later" -mbest-lib-options. \
- Kludgy, but needed for some multilibbed files. */ \
- {"override-best-lib-options", 0, \
- N_("Override -mbest-lib-options")}, \
- CRIS_SUBTARGET_SWITCHES \
- {"", TARGET_DEFAULT | CRIS_SUBTARGET_DEFAULT, ""}} \
+/* Previously controlled by target_flags. */
+#define TARGET_ELF 1
-/* For the cris-*-elf subtarget. */
-#define CRIS_SUBTARGET_SWITCHES \
- {"elf", 0, ""},
+/* Previously controlled by target_flags. Note that this is *not* set
+ for -melinux. */
+#define TARGET_LINUX 0
/* Default target_flags if no switches specified. */
#ifndef TARGET_DEFAULT
# define TARGET_DEFAULT \
- (TARGET_MASK_SIDE_EFFECT_PREFIXES + TARGET_MASK_STACK_ALIGN \
- + TARGET_MASK_CONST_ALIGN + TARGET_MASK_DATA_ALIGN \
- + TARGET_MASK_PROLOGUE_EPILOGUE + TARGET_MASK_MUL_BUG)
+ (MASK_SIDE_EFFECT_PREFIXES + MASK_STACK_ALIGN \
+ + MASK_CONST_ALIGN + MASK_DATA_ALIGN \
+ + MASK_PROLOGUE_EPILOGUE + MASK_MUL_BUG)
#endif
/* For the cris-*-elf subtarget. */
-#define CRIS_SUBTARGET_DEFAULT TARGET_MASK_ELF
+#define CRIS_SUBTARGET_DEFAULT 0
#define CRIS_CPU_BASE 0
#define CRIS_CPU_ETRAX4 3 /* Just lz added. */
@@ -444,18 +285,7 @@ extern int target_flags;
#define TARGET_HAS_MUL_INSNS (cris_cpu_version >= CRIS_CPU_NG)
-#define TARGET_OPTIONS \
- {{"cpu=", &cris_cpu_str, "", 0}, \
- {"arch=", &cris_cpu_str, \
- N_("Generate code for the specified chip or CPU version"), 0}, \
- {"tune=", &cris_tune_str, \
- N_("Tune alignment for the specified chip or CPU version"), 0}, \
- {"max-stackframe=", &cris_max_stackframe_str, \
- N_("Warn when a stackframe is larger than the specified size"), 0}, \
- CRIS_SUBTARGET_LONG_OPTIONS \
- {"ax-stackframe=", &cris_max_stackframe_str, "", 0} }
-
-#define CRIS_SUBTARGET_LONG_OPTIONS
+#define CRIS_SUBTARGET_HANDLE_OPTION(x, y, z)
/* Print subsidiary information on the compiler version in use.
Do not use VD.D syntax (D=digit), since this will cause confusion
Index: config/cris/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/linux.h,v
retrieving revision 1.10
diff -u -p -r1.10 linux.h
--- config/cris/linux.h 29 Nov 2003 03:08:09 -0000 1.10
+++ config/cris/linux.h 23 Apr 2005 04:42:51 -0000
@@ -1,5 +1,5 @@
/* Definitions for GCC. Part of the machine description for CRIS.
- Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
Contributed by Axis Communications. Written by Hans-Peter Nilsson.
This file is part of GCC.
@@ -60,21 +60,15 @@ Boston, MA 02111-1307, USA. */
%{!fleading-underscore:--no-underscore}\
%{fPIC|fpic|fPIE|fpie: --pic}"
-/* Provide a legacy -mlinux option. */
-#undef CRIS_SUBTARGET_SWITCHES
-#define CRIS_SUBTARGET_SWITCHES \
- {"linux", 0, ""}, \
- {"gotplt", -TARGET_MASK_AVOID_GOTPLT, ""}, \
- {"no-gotplt", TARGET_MASK_AVOID_GOTPLT, \
- N_("Together with -fpic and -fPIC, do not use GOTPLT references")},
+/* Previously controlled by target_flags. */
+#undef TARGET_LINUX
+#define TARGET_LINUX 1
#undef CRIS_SUBTARGET_DEFAULT
#define CRIS_SUBTARGET_DEFAULT \
- (TARGET_MASK_SVINTO \
- + TARGET_MASK_ETRAX4_ADD \
- + TARGET_MASK_ALIGN_BY_32 \
- + TARGET_MASK_ELF \
- + TARGET_MASK_LINUX)
+ (MASK_SVINTO \
+ + MASK_ETRAX4_ADD \
+ + MASK_ALIGN_BY_32)
#undef CRIS_DEFAULT_CPU_VERSION
#define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
--- /dev/null Tue Oct 29 15:57:07 2002
+++ config/cris/aout.opt Sat Apr 23 04:08:17 2005
@@ -0,0 +1,32 @@
+; a.out-specific options for the CRIS port of the compiler.
+
+; Copyright (C) 2005 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.
+
+; Legacy option.
+maout
+Target Report RejectNegative Undocumented
+
+melinux
+Target Report RejectNegative
+Compile for the MMU-less Etrax 100-based elinux system
+
+melinux-stacksize=
+Target Report RejectNegative Joined
+-melinux-stacksize=SIZE For elinux, request a specified stack-size for this program
--- /dev/null Tue Oct 29 15:57:07 2002
+++ config/cris/cris.opt Sat Apr 23 06:03:50 2005
@@ -0,0 +1,191 @@
+; Options for the CRIS port of the compiler.
+
+; Copyright (C) 2005 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.
+
+; TARGET_MUL_BUG: Whether or not to work around multiplication
+; instruction hardware bug when generating code for models where
+; it may be present. From the trouble report for Etrax 100 LX:
+; "A multiply operation may cause incorrect cache behaviour
+; under some specific circumstances. The problem can occur if
+; the instruction following the multiply instruction causes a
+; cache miss, and multiply operand 1 (source operand) bits
+; [31:27] matches the logical mapping of the mode register
+; address (0xb0....), and bits [9:2] of operand 1 matches the
+; TLB register address (0x258-0x25f). There is such a mapping
+; in kernel mode or when the MMU is off. Normally there is no
+; such mapping in user mode, and the problem will therefore
+; probably not occur in Linux user mode programs."
+;
+; We have no sure-fire way to know from within GCC that we're
+; compiling a user program. For example, -fpic/PIC is used in
+; libgcc which is linked into the kernel. However, the
+; workaround option -mno-mul-bug can be safely used per-package
+; when compiling programs. The same goes for general user-only
+; libraries such as glibc, since there's no user-space
+; driver-like program that gets a mapping of I/O registers (all
+; on the same page, including the TLB registers).
+mmul-bug-workaround
+Target Report Mask(MUL_BUG)
+Work around bug in multiplication instruction
+
+; TARGET_ETRAX4_ADD: Instruction-set additions from Etrax 4 and up.
+; (Just "lz", which we don't really generate from GCC -- yet).
+metrax4
+Target Report Mask(ETRAX4_ADD)
+Compile for ETRAX 4 (CRIS v3)
+
+; See cris_handle_option.
+metrax100
+Target Report RejectNegative
+Compile for ETRAX 100 (CRIS v8)
+
+; See cris_handle_option.
+mno-etrax100
+Target Report RejectNegative Undocumented
+
+mpdebug
+Target Report Mask(PDEBUG)
+Emit verbose debug information in assembly code
+
+; TARGET_CCINIT: Whether to use condition-codes generated by
+; insns other than the immediately preceding compare/test insn.
+; Used to check for errors in notice_update_cc.
+mcc-init
+Target Report Mask(CCINIT)
+Do not use condition codes from normal instructions
+
+; TARGET_SIDE_EFFECT_PREFIXES: Whether to use side-effect
+; patterns. Used to debug the [rx=ry+i] type patterns.
+mside-effects
+Target Report RejectNegative Mask(SIDE_EFFECT_PREFIXES) Undocumented
+
+mno-side-effects
+Target Report RejectNegative InverseMask(SIDE_EFFECT_PREFIXES)
+Do not emit addressing modes with side-effect assignment
+
+; TARGET_STACK_ALIGN: Whether to *keep* (not force) alignment of
+; stack at 16 (or 32, depending on TARGET_ALIGN_BY_32) bits.
+mstack-align
+Target Report RejectNegative Mask(STACK_ALIGN) Undocumented
+
+mno-stack-align
+Target Report RejectNegative InverseMask(STACK_ALIGN)
+Do not tune stack alignment
+
+; TARGET_DATA_ALIGN: Whether to do alignment on individual
+; modifiable objects.
+mdata-align
+Target Report RejectNegative Mask(DATA_ALIGN) Undocumented
+
+mno-data-align
+Target Report RejectNegative InverseMask(DATA_ALIGN)
+Do not tune writable data alignment
+
+; TARGET_CONST_ALIGN: Whether to do alignment on individual
+; non-modifiable objects.
+mconst-align
+Target Report RejectNegative Mask(CONST_ALIGN) Undocumented
+
+mno-const-align
+Target Report RejectNegative InverseMask(CONST_ALIGN)
+Do not tune code and read-only data alignment
+
+; See cris_handle_option.
+m32-bit
+Target Report RejectNegative Undocumented
+
+; See cris_handle_option.
+m32bit
+Target Report RejectNegative
+Align code and data to 32 bits
+
+; See cris_handle_option.
+m16-bit
+Target Report RejectNegative Undocumented
+
+; See cris_handle_option.
+m16bit
+Target Report RejectNegative Undocumented
+
+; See cris_handle_option.
+m8-bit
+Target Report RejectNegative Undocumented
+
+; See cris_handle_option.
+m8bit
+Target Report RejectNegative
+Don't align items in code or data
+
+; TARGET_PROLOGUE_EPILOGUE: Whether or not to omit function
+; prologue and epilogue.
+mprologue-epilogue
+Target Report RejectNegative Mask(PROLOGUE_EPILOGUE) Undocumented
+
+mno-prologue-epilogue
+Target Report RejectNegative InverseMask(PROLOGUE_EPILOGUE)
+Do not emit function prologue or epilogue
+
+; We have to handle this m-option here since we can't wash it
+; off in both CC1_SPEC and CC1PLUS_SPEC.
+
+mbest-lib-options
+Target Report RejectNegative
+Use the most feature-enabling options allowed by other options
+
+; FIXME: The following comment relates to gcc before cris.opt.
+; Check it it's still valid:
+; We must call it "override-" since calling it "no-" will cause
+; gcc.c to forget it, if there's a "later" -mbest-lib-options.
+; Kludgy, but needed for some multilibbed files.
+moverride-best-lib-options
+Target Report RejectNegative
+Override -mbest-lib-options
+
+mcpu=
+Target Report RejectNegative Joined Undocumented
+
+march=
+Target Report RejectNegative Joined
+-march=ARCH Generate code for the specified chip or CPU version
+
+mtune=
+Target Report RejectNegative Joined
+-mtune=ARCH Tune alignment for the specified chip or CPU version
+
+mmax-stackframe=
+Target Report RejectNegative Joined
+-mmax-stackframe=SIZE Warn when a stackframe is larger than the specified size
+
+max-stackframe=
+Target Report RejectNegative Joined Undocumented
+
+; TARGET_SVINTO: Currently this just affects alignment. FIXME:
+; Redundant with TARGET_ALIGN_BY_32, or put machine stuff here?
+; This and the others below could just as well be variables and
+; TARGET_* defines in cris.h.
+Mask(SVINTO)
+
+; TARGET_ALIGN_BY_32: Say that all alignment specifications say
+; to prefer 32 rather than 16 bits.
+Mask(ALIGN_BY_32)
+
+; TARGET_AVOID_GOTPLT is referred to in the .c and the .md so we
+; need to allocate the flag and macros here.
+Mask(AVOID_GOTPLT)
--- /dev/null Tue Oct 29 15:57:07 2002
+++ config/cris/elf.opt Sat Apr 23 04:08:17 2005
@@ -0,0 +1,23 @@
+; ELF-specific options for the CRIS port of the compiler.
+
+; Copyright (C) 2005 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.
+
+melf
+Target Report RejectNegative Undocumented
--- /dev/null Tue Oct 29 15:57:07 2002
+++ config/cris/linux.opt Sat Apr 23 04:08:16 2005
@@ -0,0 +1,34 @@
+; GNU/Linux-specific options for the CRIS port of the compiler.
+
+; Copyright (C) 2005 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.
+
+; Provide a legacy -mlinux option.
+mlinux
+Target Report RejectNegative Undocumented
+
+mno-gotplt
+Target Report RejectNegative Mask(AVOID_GOTPLT) MaskExists
+Together with -fpic and -fPIC, do not use GOTPLT references
+
+; There's a small added setup cost with using GOTPLT references
+; for the first (resolving) call, but should in total be a win
+; both in code-size and execution-time.
+mgotplt
+Target Report RejectNegative InverseMask(AVOID_GOTPLT) Undocumented
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.534
diff -u -p -r1.534 config.gcc
--- config.gcc 18 Apr 2005 10:59:35 -0000 1.534
+++ config.gcc 23 Apr 2005 04:15:46 -0000
@@ -756,16 +756,19 @@ cris-*-aout)
tm_file="dbxelf.h ${tm_file} cris/aout.h"
gas=yes
tmake_file="cris/t-cris cris/t-aout"
+ extra_options="${extra_options} cris/aout.opt"
;;
cris-*-elf | cris-*-none)
tm_file="dbxelf.h elfos.h ${tm_file}"
tmake_file="cris/t-cris cris/t-elfmulti"
gas=yes
+ extra_options="${extra_options} cris/elf.opt"
;;
cris-*-linux*)
tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
# We need to avoid using t-linux, so override default tmake_file
tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux"
+ extra_options="${extra_options} cris/linux.opt"
;;
fr30-*-elf)
tm_file="dbxelf.h elfos.h svr4.h ${tm_file}"
brgds, H-P