This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Fix PR target/18442
- From: Eric Christopher <echristo at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 07 Dec 2004 14:20:59 -0800
- Subject: [committed] Fix PR target/18442
This came up after the scalar mode supported p bits. With the right
combination of command line flags you could come up with an abi that
didn't have a 32-bit type. We have all of the patterns for supporting it
so this allows the combination.
Committed.
-eric
2004-12-07 Eric Christopher <echristo@redhat.com>
PR target/18442
* config/mips/mips.c (mips_vector_mode_supported_p):
New function.
(TARGET_SCALAR_MODE_SUPPORTED_P): Define to above.
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.478
retrieving revision 1.479
diff -u -r1.478 -r1.479
--- gcc/gcc/config/mips/mips.c 2004/11/27 09:46:43 1.478
+++ gcc/gcc/config/mips/mips.c 2004/12/07 22:17:21 1.479
@@ -352,6 +352,7 @@
tree, bool);
static bool mips_callee_copies (CUMULATIVE_ARGS *, enum machine_mode mode,
tree, bool);
+static bool mips_scalar_mode_supported_p (enum machine_mode);
static bool mips_vector_mode_supported_p (enum machine_mode);
static rtx mips_prepare_builtin_arg (enum insn_code, unsigned int, tree *);
static rtx mips_prepare_builtin_target (enum insn_code, unsigned int, rtx);
@@ -800,6 +801,9 @@
#undef TARGET_VECTOR_MODE_SUPPORTED_P
#define TARGET_VECTOR_MODE_SUPPORTED_P mips_vector_mode_supported_p
+#undef TARGET_SCALAR_MODE_SUPPORTED_P
+#define TARGET_SCALAR_MODE_SUPPORTED_P mips_scalar_mode_supported_p
+
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS mips_init_builtins
#undef TARGET_EXPAND_BUILTIN
@@ -7076,6 +7080,28 @@
return (mode == SImode || (TARGET_64BIT && mode == DImode));
}
+/* Define this so that we can deal with a testcase like:
+
+ char foo __attribute__ ((mode (SI)));
+
+ then compiled with -mabi=64 and -mint64. We have no
+ 32-bit type at that point and so the default case
+ always fails. Instead of special casing everything
+ it's easier to accept SImode in this function and
+ then punt to the default which will work for all
+ of the cases where we deal with TARGET_64BIT, etc. */
+static bool
+mips_scalar_mode_supported_p (enum machine_mode mode)
+{
+ /* We can always handle SImode. */
+ if (mode == SImode)
+ return true;
+ else
+ return default_scalar_mode_supported_p (mode);
+
+}
+
+
/* Target hook for vector_mode_supported_p. */
static bool
mips_vector_mode_supported_p (enum machine_mode mode)