aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJames E Wilson <wilson@tuliptree.org>2003-07-06 20:42:23 -0700
committerJim Wilson <wilson@gcc.gnu.org>2003-07-06 20:42:23 -0700
commit8338d44d83af2fa4bc4c2fec823ca00503c09681 (patch)
treef00c94a9d5dc89370d9bd0cf002efe6d90201aaf /gcc
parent9ca9944176b8c468042248ad3905cf452142c43e (diff)
downloadgcc-8338d44d83af2fa4bc4c2fec823ca00503c09681.zip
gcc-8338d44d83af2fa4bc4c2fec823ca00503c09681.tar.gz
gcc-8338d44d83af2fa4bc4c2fec823ca00503c09681.tar.bz2
re PR rtl-optimization/9812 ([m68k] ICE in extract_insn, at recog.c:2148)
PR optimization/9812 * rtl.h (mem_for_const_double): Delete prototype. * varasm.c (mem_for_const_double): Delete function. * config/m68k/hp320.h, config/m68k/linux.h, config/m68k/m68kelf.h, config/m68k/m68kv4.h, config/m68k/netbsd-elf.h (LEGITIMATE_PIC_OPERAND_P): Delete duplicate definitions. * config/m68k/m68k.h (LEGITIMATE_CONSTANT_P): Disallow XFmode. (LEGITIMATE_PIC_OPERAND_P): Delete CONST_DOUBLE tests. * config/m68k/m68k.md (movxf): Add reload_in_progress guard. Add comment about confused support for XFmode constants. From-SVN: r69027
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/config/m68k/hp320.h12
-rw-r--r--gcc/config/m68k/linux.h12
-rw-r--r--gcc/config/m68k/m68k.h10
-rw-r--r--gcc/config/m68k/m68k.md36
-rw-r--r--gcc/config/m68k/m68kelf.h10
-rw-r--r--gcc/config/m68k/m68kv4.h12
-rw-r--r--gcc/config/m68k/netbsd-elf.h14
-rw-r--r--gcc/rtl.h1
-rw-r--r--gcc/varasm.c17
10 files changed, 38 insertions, 99 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3bf8197..51b9ffe 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+2003-07-06 James E Wilson <wilson@tuliptree.org>
+
+ PR optimization/9812
+ * rtl.h (mem_for_const_double): Delete prototype.
+ * varasm.c (mem_for_const_double): Delete function.
+ * config/m68k/hp320.h, config/m68k/linux.h, config/m68k/m68kelf.h,
+ config/m68k/m68kv4.h, config/m68k/netbsd-elf.h
+ (LEGITIMATE_PIC_OPERAND_P): Delete duplicate definitions.
+ * config/m68k/m68k.h (LEGITIMATE_CONSTANT_P): Disallow XFmode.
+ (LEGITIMATE_PIC_OPERAND_P): Delete CONST_DOUBLE tests.
+ * config/m68k/m68k.md (movxf): Add reload_in_progress guard. Add
+ comment about confused support for XFmode constants.
+
Mon Jul 7 02:03:56 CEST 2003 Jan Hubicka <jh@suse.cz>
* cfglayout.c (fixup_reorder_chain): Call delete_dead_jumptables.
diff --git a/gcc/config/m68k/hp320.h b/gcc/config/m68k/hp320.h
index a755aca..17ce350 100644
--- a/gcc/config/m68k/hp320.h
+++ b/gcc/config/m68k/hp320.h
@@ -555,18 +555,6 @@ do { size_t i, limit = (SIZE); \
#endif /* not HPUX_ASM */
-/* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is an
- operand of a function call. */
-#undef LEGITIMATE_PIC_OPERAND_P
-#define LEGITIMATE_PIC_OPERAND_P(X) \
- ((! symbolic_operand (X, VOIDmode) \
- && ! (GET_CODE (X) == CONST_DOUBLE && mem_for_const_double (X) != 0 \
- && GET_CODE (mem_for_const_double (X)) == MEM \
- && symbolic_operand (XEXP (mem_for_const_double (X), 0), \
- VOIDmode))) \
- || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
- || PCREL_GENERAL_OPERAND_OK)
-
/* hpux8 and later have C++ compatible include files, so do not
pretend they are `extern "C"'. */
#define NO_IMPLICIT_EXTERN_C
diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h
index 073eed7..efedd4f 100644
--- a/gcc/config/m68k/linux.h
+++ b/gcc/config/m68k/linux.h
@@ -283,18 +283,6 @@ do { \
? gen_rtx_REG ((MODE), 16) \
: gen_rtx_REG ((MODE), 0))
-/* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is
- an operand of a function call. */
-#undef LEGITIMATE_PIC_OPERAND_P
-#define LEGITIMATE_PIC_OPERAND_P(X) \
- ((! symbolic_operand (X, VOIDmode) \
- && ! (GET_CODE (X) == CONST_DOUBLE && mem_for_const_double (X) != 0 \
- && GET_CODE (mem_for_const_double (X)) == MEM \
- && symbolic_operand (XEXP (mem_for_const_double (X), 0), \
- VOIDmode))) \
- || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
- || PCREL_GENERAL_OPERAND_OK)
-
/* For m68k SVR4, structures are returned using the reentrant
technique. */
#undef PCC_STATIC_STRUCT_RETURN
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index cb6c190..8ee78ba 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -998,7 +998,7 @@ __transfer_from_trampoline () \
/* Nonzero if the constant value X is a legitimate general operand.
It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
-#define LEGITIMATE_CONSTANT_P(X) 1
+#define LEGITIMATE_CONSTANT_P(X) (GET_MODE (X) != XFmode)
/* Nonzero if the constant value X is a legitimate general operand
when generating PIC code. It is given that flag_pic is on and
@@ -1015,12 +1015,8 @@ __transfer_from_trampoline () \
#endif
#define LEGITIMATE_PIC_OPERAND_P(X) \
- ((! symbolic_operand (X, VOIDmode) \
- && ! (GET_CODE (X) == CONST_DOUBLE && mem_for_const_double (X) != 0 \
- && GET_CODE (mem_for_const_double (X)) == MEM \
- && symbolic_operand (XEXP (mem_for_const_double (X), 0), \
- VOIDmode))) \
- || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
+ (! symbolic_operand (X, VOIDmode) \
+ || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
|| PCREL_GENERAL_OPERAND_OK)
/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index 7d29741..4542d73 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -999,27 +999,35 @@
"TARGET_5200"
"* return output_move_double (operands);")
+;; ??? The XFmode patterns are schizophrenic about whether constants are
+;; allowed. Most but not all have predicates and constraint that disallow
+;; constants. Most but not all have output templates that handle constants.
+;; See also LEGITIMATE_CONSTANT_P.
+
(define_expand "movxf"
[(set (match_operand:XF 0 "nonimmediate_operand" "")
(match_operand:XF 1 "general_operand" ""))]
""
"
{
- if (CONSTANT_P (operands[1]))
- {
- operands[1] = force_const_mem (XFmode, operands[1]);
- if (! memory_address_p (XFmode, XEXP (operands[1], 0))
- && ! reload_in_progress)
- operands[1] = adjust_address (operands[1], XFmode, 0);
- }
- if (flag_pic && TARGET_PCREL && ! reload_in_progress)
+ /* We can't rewrite operands during reload. */
+ if (! reload_in_progress)
{
- /* Don't allow writes to memory except via a register;
- the m68k doesn't consider PC-relative addresses to be writable. */
- if (GET_CODE (operands[0]) == MEM
- && symbolic_operand (XEXP (operands[0], 0), SImode))
- operands[0] = gen_rtx (MEM, XFmode,
- force_reg (SImode, XEXP (operands[0], 0)));
+ if (CONSTANT_P (operands[1]))
+ {
+ operands[1] = force_const_mem (XFmode, operands[1]);
+ if (! memory_address_p (XFmode, XEXP (operands[1], 0)))
+ operands[1] = adjust_address (operands[1], XFmode, 0);
+ }
+ if (flag_pic && TARGET_PCREL)
+ {
+ /* Don't allow writes to memory except via a register; the
+ m68k doesn't consider PC-relative addresses to be writable. */
+ if (GET_CODE (operands[0]) == MEM
+ && symbolic_operand (XEXP (operands[0], 0), SImode))
+ operands[0] = gen_rtx (MEM, XFmode,
+ force_reg (SImode, XEXP (operands[0], 0)));
+ }
}
}")
diff --git a/gcc/config/m68k/m68kelf.h b/gcc/config/m68k/m68kelf.h
index 68fe5aa..f481871 100644
--- a/gcc/config/m68k/m68kelf.h
+++ b/gcc/config/m68k/m68kelf.h
@@ -246,16 +246,6 @@ extern int switch_table_difference_label_flag;
#undef ASM_OUTPUT_BEFORE_CASE_LABEL
#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
fprintf ((FILE), "%s&%d\n", SWBEG_ASM_OP, XVECLEN (PATTERN (TABLE), 1));
-
-/* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is an
- operand of a function call. */
-#undef LEGITIMATE_PIC_OPERAND_P
-
-#define LEGITIMATE_PIC_OPERAND_P(X) \
- (! symbolic_operand (X, VOIDmode) \
- || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
- || PCREL_GENERAL_OPERAND_OK)
-
/* end of stuff from m68kv4.h */
#undef SGS_CMP_ORDER
diff --git a/gcc/config/m68k/m68kv4.h b/gcc/config/m68k/m68kv4.h
index 66de391..f826f0f 100644
--- a/gcc/config/m68k/m68kv4.h
+++ b/gcc/config/m68k/m68kv4.h
@@ -277,18 +277,6 @@ int switch_table_difference_label_flag;
#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
fprintf ((FILE), "%s&%d\n", SWBEG_ASM_OP, XVECLEN (PATTERN (TABLE), 1));
-/* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is an
- operand of a function call. */
-#undef LEGITIMATE_PIC_OPERAND_P
-#define LEGITIMATE_PIC_OPERAND_P(X) \
- ((! symbolic_operand (X, VOIDmode) \
- && ! (GET_CODE (X) == CONST_DOUBLE && mem_for_const_double (X) != 0 \
- && GET_CODE (mem_for_const_double (X)) == MEM \
- && symbolic_operand (XEXP (mem_for_const_double (X), 0), \
- VOIDmode))) \
- || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
- || PCREL_GENERAL_OPERAND_OK)
-
/* Output assembler code for a block containing the constant parts
of a trampoline, leaving space for the variable parts. */
diff --git a/gcc/config/m68k/netbsd-elf.h b/gcc/config/m68k/netbsd-elf.h
index 0787c6a..14fcf1a 100644
--- a/gcc/config/m68k/netbsd-elf.h
+++ b/gcc/config/m68k/netbsd-elf.h
@@ -385,20 +385,6 @@ while (0)
#define BIGGEST_ALIGNMENT 64
-/* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is
- an operand of a function call. */
-
-#undef LEGITIMATE_PIC_OPERAND_P
-#define LEGITIMATE_PIC_OPERAND_P(X) \
- ((! symbolic_operand (X, VOIDmode) \
- && ! (GET_CODE (X) == CONST_DOUBLE && mem_for_const_double (X) \
- && GET_CODE (mem_for_const_double (X)) == MEM \
- && symbolic_operand (XEXP (mem_for_const_double (X), 0), \
- VOIDmode))) \
- || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
- || PCREL_GENERAL_OPERAND_OK)
-
-
/* For m68k SVR4, structures are returned using the reentrant
technique. */
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 10b4d5b..975a752 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1477,7 +1477,6 @@ extern void end_full_sequence (rtx*, rtx*);
/* In varasm.c */
extern rtx immed_double_const (HOST_WIDE_INT, HOST_WIDE_INT,
enum machine_mode);
-extern rtx mem_for_const_double (rtx);
extern rtx force_const_mem (enum machine_mode, rtx);
/* In varasm.c */
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 5769dc8..aa1c355 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -2931,23 +2931,6 @@ record_constant_rtx (enum machine_mode mode, rtx x)
return ptr;
}
-/* Given a constant rtx X, return a MEM for the location in memory at which
- this constant has been placed. Return 0 if it not has been placed yet. */
-
-rtx
-mem_for_const_double (rtx x)
-{
- enum machine_mode mode = GET_MODE (x);
- struct constant_descriptor_rtx *desc;
-
- for (desc = const_rtx_hash_table[const_hash_rtx (mode, x)]; desc;
- desc = desc->next)
- if (compare_constant_rtx (mode, x, desc))
- return desc->rtl;
-
- return 0;
-}
-
/* Given a constant rtx X, make (or find) a memory constant for its value
and return a MEM rtx to refer to it in memory. */