Commit ee5332b8 by Richard Henderson Committed by Richard Henderson

cse.c (fold_rtx): Revert 29 Dec change.

        * cse.c (fold_rtx): Revert 29 Dec change.
        (cse_insn): Revert 12 Jan change.
        * expr.c (expand_builtin): Don't emit CONST around CONSTANT_P_RTX.
        * regclass.c (reg_scan_mark_refs): Revert 29 Dec change.
        * rtl.def: Likewise.
        * rtl.h (CONSTANT_P): Likewise.
        * expr.c (emit_move_insn): Never try to flush CONSTANT_P_RTX
        to memory.
        * recog.c (immediate_operand): Accept CONSTANT_P_RTX.
        * alpha.c (input_operand): Likewise.
        * c4x.c (const_operand): Likewise.
        * explow.c (allocate_dynamic_stack_space): Use register_operand
        instead of arith_operand, which does not exist.
        * 1750a.h: Fix comment closure.
        * a29k.c (a29k_set_memflags): Fix typo in 19 Jan change.
        * arc.md (one_cmplsi2_set_cc_insn): Fix set mode mismatch.
        * arm.h (TARGET_SWITCHES): Fix typo.
        * i370.md (anon mult and div patterns): Fix set mode mismatch.
        * i860.c (output_delayed_branch): Fix operands to constrain_operands.
        (output_delay_insn): Likewise.
        * m88k.md (anon rotate insns): Fix set mode mismatch.
        (anon BLKmode moves): Commonize and fix set mode mismatches.
        * ns32k.md (udivmoddi[shq]i4_internal): Fix mode mismatch.
        * romp.md (movdf): Fix typo.

From-SVN: r24796
parent 898df643
Thu Jan 21 01:59:30 1999 Richard Henderson <rth@cygnus.com>
* cse.c (fold_rtx): Revert 29 Dec change.
(cse_insn): Revert 12 Jan change.
* expr.c (expand_builtin): Don't emit CONST around CONSTANT_P_RTX.
* regclass.c (reg_scan_mark_refs): Revert 29 Dec change.
* rtl.def: Likewise.
* rtl.h (CONSTANT_P): Likewise.
* expr.c (emit_move_insn): Never try to flush CONSTANT_P_RTX
to memory.
* recog.c (immediate_operand): Accept CONSTANT_P_RTX.
* alpha.c (input_operand): Likewise.
* c4x.c (const_operand): Likewise.
* explow.c (allocate_dynamic_stack_space): Use register_operand
instead of arith_operand, which does not exist.
* 1750a.h: Fix comment closure.
* a29k.c (a29k_set_memflags): Fix typo in 19 Jan change.
* arc.md (one_cmplsi2_set_cc_insn): Fix set mode mismatch.
* arm.h (TARGET_SWITCHES): Fix typo.
* i370.md (anon mult and div patterns): Fix set mode mismatch.
* i860.c (output_delayed_branch): Fix operands to constrain_operands.
(output_delay_insn): Likewise.
* m88k.md (anon rotate insns): Fix set mode mismatch.
(anon BLKmode moves): Commonize and fix set mode mismatches.
* ns32k.md (udivmoddi[shq]i4_internal): Fix mode mismatch.
* romp.md (movdf): Fix typo.
Thu Jan 21 00:29:35 1999 Nathan Sidwell <nathan@acm.org> Thu Jan 21 00:29:35 1999 Nathan Sidwell <nathan@acm.org>
* Makefile.in (install-common): Remove extraneous chmod for gcov * Makefile.in (install-common): Remove extraneous chmod for gcov
......
/* Definitions of target machine for GNU compiler. /* Definitions of target machine for GNU compiler.
Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. Copyright (C) 1994, 95-98, 1999 Free Software Foundation, Inc.
Contributed by O.M.Kellogg, DASA (oliver.kellogg@space.otn.dasa.de) Contributed by O.M.Kellogg, DASA (oliver.kellogg@space.otn.dasa.de)
This file is part of GNU CC. This file is part of GNU CC.
...@@ -732,7 +732,7 @@ enum reg_class { NO_REGS, R2, R0_1, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLA ...@@ -732,7 +732,7 @@ enum reg_class { NO_REGS, R2, R0_1, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLA
reg_renumber[REGNO] >= 12 && reg_renumber[REGNO] <= 15) reg_renumber[REGNO] >= 12 && reg_renumber[REGNO] <= 15)
/* Now macros that check whether X is a register and also, /* Now macros that check whether X is a register and also,
strictly, whether it is in a specified class. strictly, whether it is in a specified class. */
/* 1 if X is an address register */ /* 1 if X is an address register */
......
...@@ -530,7 +530,7 @@ a29k_set_memflags (insn, ref) ...@@ -530,7 +530,7 @@ a29k_set_memflags (insn, ref)
/* Note that it is always safe to get these flags, though they won't /* Note that it is always safe to get these flags, though they won't
be what we think if REF is not a MEM. */ be what we think if REF is not a MEM. */
int in_struct_p = MEM_IN_STRUCT_P (ref); int in_struct_p = MEM_IN_STRUCT_P (ref);
int scalar_p = MEM_IN_SCALAR_P (ref); int scalar_p = MEM_SCALAR_P (ref);
int volatile_p = MEM_VOLATILE_P (ref); int volatile_p = MEM_VOLATILE_P (ref);
int unchanging_p = RTX_UNCHANGING_P (ref); int unchanging_p = RTX_UNCHANGING_P (ref);
......
...@@ -613,6 +613,9 @@ input_operand (op, mode) ...@@ -613,6 +613,9 @@ input_operand (op, mode)
case CONST_INT: case CONST_INT:
return mode == QImode || mode == HImode || add_operand (op, mode); return mode == QImode || mode == HImode || add_operand (op, mode);
case CONSTANT_P_RTX:
return 1;
default: default:
break; break;
} }
......
;; Machine description of the Argonaut ARC cpu for GNU C compiler ;; Machine description of the Argonaut ARC cpu for GNU C compiler
;; Copyright (C) 1994, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1994, 1997, 1999 Free Software Foundation, Inc.
;; This file is part of GNU CC. ;; This file is part of GNU CC.
...@@ -1039,7 +1039,7 @@ ...@@ -1039,7 +1039,7 @@
[(set_attr "type" "unary")]) [(set_attr "type" "unary")])
(define_insn "*one_cmplsi2_set_cc_insn" (define_insn "*one_cmplsi2_set_cc_insn"
[(set (reg:CCZN 61) (compare:CC [(set (reg:CCZN 61) (compare:CCZN
(not:SI (match_operand:SI 1 "register_operand" "r")) (not:SI (match_operand:SI 1 "register_operand" "r"))
(const_int 0))) (const_int 0)))
(set (match_operand:SI 0 "register_operand" "=r") (set (match_operand:SI 0 "register_operand" "=r")
......
...@@ -385,7 +385,6 @@ function tries to return. */ ...@@ -385,7 +385,6 @@ function tries to return. */
{"abort-on-noreturn", ARM_FLAG_ABORT_NORETURN, \ {"abort-on-noreturn", ARM_FLAG_ABORT_NORETURN, \
"Generate a call to abort if a noreturn function returns"}, \ "Generate a call to abort if a noreturn function returns"}, \
{"no-abort-on-noreturn", -ARM_FLAG_ABORT_NORETURN, ""}, \ {"no-abort-on-noreturn", -ARM_FLAG_ABORT_NORETURN, ""}, \
SUBTARGET_SWITCHES \ SUBTARGET_SWITCHES \
{"", TARGET_DEFAULT } \ {"", TARGET_DEFAULT } \
} }
......
...@@ -2612,6 +2612,9 @@ const_operand (op, mode) ...@@ -2612,6 +2612,9 @@ const_operand (op, mode)
case Pmode: case Pmode:
#endif #endif
case QImode: case QImode:
if (GET_CODE (op) == CONSTANT_P_RTX)
return 1;
if (GET_CODE (op) != CONST_INT if (GET_CODE (op) != CONST_INT
|| (GET_MODE (op) != VOIDmode && GET_MODE (op) != mode) || (GET_MODE (op) != VOIDmode && GET_MODE (op) != mode)
|| GET_MODE_CLASS (mode) != MODE_INT) || GET_MODE_CLASS (mode) != MODE_INT)
......
;;- Machine description for GNU compiler -- System/370 version. ;;- Machine description for GNU compiler -- System/370 version.
;; Copyright (C) 1989, 93, 94, 95, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1989, 93, 94, 95, 97, 1999 Free Software Foundation, Inc.
;; Contributed by Jan Stein (jan@cd.chalmers.se). ;; Contributed by Jan Stein (jan@cd.chalmers.se).
;; Modified for MVS C/370 by Dave Pitts (dpitts@nyx.cs.du.edu) ;; Modified for MVS C/370 by Dave Pitts (dpitts@nyx.cs.du.edu)
...@@ -2125,7 +2125,7 @@ check_label_emit (); ...@@ -2125,7 +2125,7 @@ check_label_emit ();
(define_insn "" (define_insn ""
[(set (match_operand:DI 0 "register_operand" "=d") [(set (match_operand:DI 0 "register_operand" "=d")
(mult:SI (match_operand:DI 1 "general_operand" "%0") (mult:DI (match_operand:DI 1 "general_operand" "%0")
(match_operand:SI 2 "general_operand" "g")))] (match_operand:SI 2 "general_operand" "g")))]
"" ""
"* "*
...@@ -2281,7 +2281,7 @@ check_label_emit (); ...@@ -2281,7 +2281,7 @@ check_label_emit ();
(define_insn "" (define_insn ""
[(set (match_operand:DI 0 "register_operand" "=d") [(set (match_operand:DI 0 "register_operand" "=d")
(div:SI (match_operand:DI 1 "register_operand" "0") (div:DI (match_operand:DI 1 "register_operand" "0")
(match_operand:SI 2 "general_operand" "")))] (match_operand:SI 2 "general_operand" "")))]
"" ""
"* "*
...@@ -2441,7 +2441,7 @@ check_label_emit (); ...@@ -2441,7 +2441,7 @@ check_label_emit ();
(define_insn "" (define_insn ""
[(set (match_operand:DI 0 "register_operand" "=d") [(set (match_operand:DI 0 "register_operand" "=d")
(mod:SI (match_operand:DI 1 "register_operand" "0") (mod:DI (match_operand:DI 1 "register_operand" "0")
(match_operand:SI 2 "general_operand" "")))] (match_operand:SI 2 "general_operand" "")))]
"" ""
"* "*
......
/* Subroutines for insn-output.c for Intel 860 /* Subroutines for insn-output.c for Intel 860
Copyright (C) 1989, 1991, 1997, 1998 Free Software Foundation, Inc. Copyright (C) 1989, 91, 97, 98, 1999 Free Software Foundation, Inc.
Derived from sparc.c. Derived from sparc.c.
Written by Richard Stallman (rms@ai.mit.edu). Written by Richard Stallman (rms@ai.mit.edu).
...@@ -1447,7 +1447,7 @@ output_delayed_branch (template, operands, insn) ...@@ -1447,7 +1447,7 @@ output_delayed_branch (template, operands, insn)
} }
insn_extract (delay_insn); insn_extract (delay_insn);
if (! constrain_operands (insn_code_number, 1)) if (! constrain_operands (1))
fatal_insn_not_found (delay_insn); fatal_insn_not_found (delay_insn);
template = insn_template[insn_code_number]; template = insn_template[insn_code_number];
...@@ -1490,7 +1490,7 @@ output_delay_insn (delay_insn) ...@@ -1490,7 +1490,7 @@ output_delay_insn (delay_insn)
} }
#ifdef REGISTER_CONSTRAINTS #ifdef REGISTER_CONSTRAINTS
if (! constrain_operands (insn_code_number, 1)) if (! constrain_operands (1))
abort (); abort ();
#endif #endif
......
;;- Machine description for the Motorola 88000 for GNU C compiler ;;- Machine description for the Motorola 88000 for GNU C compiler
;;; Copyright (C) 1988, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. ;;; Copyright (C) 1988, 92-96, 1999 Free Software Foundation, Inc.
;; Contributed by Michael Tiemann (tiemann@mcc.com) ;; Contributed by Michael Tiemann (tiemann@mcc.com)
;; Currently maintained by (gcc@dg-rtp.dg.com) ;; Currently maintained by (gcc@dg-rtp.dg.com)
...@@ -759,7 +759,7 @@ ...@@ -759,7 +759,7 @@
(define_insn "" (define_insn ""
[(set (match_operand:CCEVEN 0 "register_operand" "=r") [(set (match_operand:CCEVEN 0 "register_operand" "=r")
(rotate:CC (match_operand 1 "partial_ccmode_register_operand" "r") (rotate:CCEVEN (match_operand 1 "partial_ccmode_register_operand" "r")
(match_operand:CC 2 "int5_operand" "")))] (match_operand:CC 2 "int5_operand" "")))]
"" ""
"rot %0,%1,%2" "rot %0,%1,%2"
...@@ -782,7 +782,7 @@ ...@@ -782,7 +782,7 @@
(define_insn "" (define_insn ""
[(set (match_operand:CCEVEN 0 "register_operand" "=r") [(set (match_operand:CCEVEN 0 "register_operand" "=r")
(ior:CC (rotate:CC (match_operand 1 "partial_ccmode_register_operand" "r") (ior:CCEVEN (rotate:CC (match_operand 1 "partial_ccmode_register_operand" "r")
(match_operand:CC 2 "int5_operand" "")) (match_operand:CC 2 "int5_operand" ""))
(match_operand 3 "partial_ccmode_register_operand" "r"))) (match_operand 3 "partial_ccmode_register_operand" "r")))
(clobber (match_scratch:CCEVEN 4 "=r"))] (clobber (match_scratch:CCEVEN 4 "=r"))]
...@@ -2129,60 +2129,49 @@ ...@@ -2129,60 +2129,49 @@
DONE; DONE;
}") }")
;; ??? We shouldn't be allowing such mode mismatches
(define_insn "" (define_insn ""
[(set (match_operand:QI 0 "register_operand" "=r") [(set (match_operand 0 "register_operand" "=r")
(match_operand:BLK 1 "memory_operand" "m"))]
""
"%V1ld.bu\\t %0,%1"
[(set_attr "type" "load")])
(define_insn ""
[(set (match_operand:HI 0 "register_operand" "=r")
(match_operand:BLK 1 "memory_operand" "m"))] (match_operand:BLK 1 "memory_operand" "m"))]
"" ""
"%V1ld.hu\\t %0,%1" "*
[(set_attr "type" "load")]) {
switch (GET_MODE (operands[0]))
(define_insn "" {
[(set (match_operand:SI 0 "register_operand" "=r") case QImode:
(match_operand:BLK 1 "memory_operand" "m"))] return \"%V1ld.bu\\t %0,%1\";
"" case HImode:
"%V1ld\\t %0,%1" return \"%V1ld.hu\\t %0,%1\";
case SImode:
return \"%V1ld\\t %0,%1\";
case DImode:
return \"%V1ld.d\\t %0,%1\";
default:
abort ();
}
}"
[(set_attr "type" "load")]) [(set_attr "type" "load")])
(define_insn "" (define_insn ""
[(set (match_operand:DI 0 "register_operand" "=r")
(match_operand:BLK 1 "memory_operand" "m"))]
""
"%V1ld.d\\t %0,%1"
[(set_attr "type" "loadd")])
(define_insn ""
[(set (match_operand:BLK 0 "memory_operand" "=m")
(match_operand:QI 1 "register_operand" "r"))]
""
"%v0st.b\\t %1,%0"
[(set_attr "type" "store")])
(define_insn ""
[(set (match_operand:BLK 0 "memory_operand" "=m") [(set (match_operand:BLK 0 "memory_operand" "=m")
(match_operand:HI 1 "register_operand" "r"))] (match_operand 1 "register_operand" "r"))]
"" ""
"%v0st.h\\t %1,%0" "*
[(set_attr "type" "store")]) {
switch (GET_MODE (operands[1]))
(define_insn "" {
[(set (match_operand:BLK 0 "memory_operand" "=m") case QImode:
(match_operand:SI 1 "register_operand" "r"))] return \"%v0st.b\\t %1,%0\";
"" case HImode:
"%v0st\\t %1,%0" return \"%v0st.h\\t %1,%0\";
[(set_attr "type" "store")]) case SImode:
return \"%v0st\\t %1,%0\";
(define_insn "" case DImode:
[(set (match_operand:BLK 0 "memory_operand" "=m") return \"%v0st.d\\t %1,%0\";
(match_operand:DI 1 "register_operand" "r"))] default:
"" abort ();
"%v0st.d\\t %1,%0" }
}"
[(set_attr "type" "store")]) [(set_attr "type" "store")])
;; Call a non-looping block move library function (e.g. __movstrSI96x64). ;; Call a non-looping block move library function (e.g. __movstrSI96x64).
......
;;- Machine description for GNU compiler, ns32000 Version ;;- Machine description for GNU compiler, ns32000 Version
;; Copyright (C) 1988, 1994, 1996 Free Software Foundation, Inc. ;; Copyright (C) 1988, 1994, 1996, 1999 Free Software Foundation, Inc.
;; Contributed by Michael Tiemann (tiemann@cygnus.com) ;; Contributed by Michael Tiemann (tiemann@cygnus.com)
;; This file is part of GNU CC. ;; This file is part of GNU CC.
...@@ -1276,7 +1276,7 @@ ...@@ -1276,7 +1276,7 @@
;; ever used when explicitly emitted by a define_expand. ;; ever used when explicitly emitted by a define_expand.
(define_insn "udivmoddisi4_internal" (define_insn "udivmoddisi4_internal"
[(set (match_operand:DI 0 "reg_or_mem_operand" "=rm") [(set (match_operand:DI 0 "reg_or_mem_operand" "=rm")
(unspec:SI [(match_operand:DI 1 "reg_or_mem_operand" "0") (unspec:DI [(match_operand:DI 1 "reg_or_mem_operand" "0")
(match_operand:SI 2 "general_operand" "g")] 0))] (match_operand:SI 2 "general_operand" "g")] 0))]
"" ""
"deid %2,%0") "deid %2,%0")
...@@ -1341,7 +1341,7 @@ ...@@ -1341,7 +1341,7 @@
;; way to do this, so just restrict operand 0 and 1 to be in registers. ;; way to do this, so just restrict operand 0 and 1 to be in registers.
(define_insn "udivmoddihi4_internal" (define_insn "udivmoddihi4_internal"
[(set (match_operand:DI 0 "register_operand" "=r") [(set (match_operand:DI 0 "register_operand" "=r")
(unspec:HI [(match_operand:DI 1 "register_operand" "0") (unspec:DI [(match_operand:DI 1 "register_operand" "0")
(match_operand:HI 2 "general_operand" "g")] 0))] (match_operand:HI 2 "general_operand" "g")] 0))]
"" ""
"deiw %2,%0") "deiw %2,%0")
...@@ -1398,7 +1398,7 @@ ...@@ -1398,7 +1398,7 @@
;; way to do this, so just restrict operand 0 and 1 to be in registers. ;; way to do this, so just restrict operand 0 and 1 to be in registers.
(define_insn "udivmoddiqi4_internal" (define_insn "udivmoddiqi4_internal"
[(set (match_operand:DI 0 "register_operand" "=r") [(set (match_operand:DI 0 "register_operand" "=r")
(unspec:QI [(match_operand:DI 1 "reg_or_mem_operand" "0") (unspec:DI [(match_operand:DI 1 "reg_or_mem_operand" "0")
(match_operand:QI 2 "general_operand" "g")] 0))] (match_operand:QI 2 "general_operand" "g")] 0))]
"" ""
"deib %2,%0") "deib %2,%0")
......
;;- Machine description for ROMP chip for GNU C compiler ;;- Machine description for ROMP chip for GNU C compiler
;; Copyright (C) 1988, 1991, 1993, 1994, 1995 Free Software Foundation, Inc. ;; Copyright (C) 1988, 91, 93, 94, 95, 1999 Free Software Foundation, Inc.
;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) ;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
;; This file is part of GNU CC. ;; This file is part of GNU CC.
...@@ -651,7 +651,7 @@ ...@@ -651,7 +651,7 @@
start_sequence (); start_sequence ();
if (GET_CODE (operands[0]) != REG if (GET_CODE (operands[0]) != REG
|| ! refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1, || ! refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
operands[1]), 0) operands[1], 0))
{ {
emit_move_insn (operand_subword (op0, 0, 1, DFmode), emit_move_insn (operand_subword (op0, 0, 1, DFmode),
operand_subword_force (op1, 0, DFmode)); operand_subword_force (op1, 0, DFmode));
......
...@@ -4931,21 +4931,6 @@ fold_rtx (x, insn) ...@@ -4931,21 +4931,6 @@ fold_rtx (x, insn)
switch (code) switch (code)
{ {
case CONST: case CONST:
/* If the operand is a CONSTANT_P_RTX, see if what's inside it
is known to be constant and replace the whole thing with a
CONST_INT of either zero or one. Note that this code assumes
that an insn that recognizes a CONST will also recognize a
CONST_INT, but that seems to be a safe assumption. */
if (GET_CODE (XEXP (x, 0)) == CONSTANT_P_RTX)
{
x = equiv_constant (fold_rtx (XEXP (XEXP (x, 0), 0), 0));
return (x != 0 && (GET_CODE (x) == CONST_INT
|| GET_CODE (x) == CONST_DOUBLE)
? const1_rtx : const0_rtx);
}
/* ... fall through ... */
case CONST_INT: case CONST_INT:
case CONST_DOUBLE: case CONST_DOUBLE:
case SYMBOL_REF: case SYMBOL_REF:
...@@ -5865,6 +5850,12 @@ fold_rtx (x, insn) ...@@ -5865,6 +5850,12 @@ fold_rtx (x, insn)
const_arg1 ? const_arg1 : folded_arg1, const_arg1 ? const_arg1 : folded_arg1,
const_arg2 ? const_arg2 : XEXP (x, 2)); const_arg2 ? const_arg2 : XEXP (x, 2));
break; break;
case 'x':
/* Always eliminate CONSTANT_P_RTX at this stage. */
if (code == CONSTANT_P_RTX)
return (const_arg0 ? const1_rtx : const0_rtx);
break;
} }
return new ? new : x; return new ? new : x;
...@@ -6864,12 +6855,6 @@ cse_insn (insn, libcall_insn) ...@@ -6864,12 +6855,6 @@ cse_insn (insn, libcall_insn)
if (src == src_folded) if (src == src_folded)
src_folded = 0; src_folded = 0;
/* Folds of constant_p_rtx are to be preferred, since we do
not wish any to live past CSE. */
if (src && GET_CODE (src) == CONST
&& GET_CODE (XEXP (src, 0)) == CONSTANT_P_RTX)
src = 0;
/* At this point, ELT, if non-zero, points to a class of expressions /* At this point, ELT, if non-zero, points to a class of expressions
equivalent to the source of this SET and SRC, SRC_EQV, SRC_FOLDED, equivalent to the source of this SET and SRC, SRC_EQV, SRC_FOLDED,
and SRC_RELATED, if non-zero, each contain additional equivalent and SRC_RELATED, if non-zero, each contain additional equivalent
......
...@@ -1204,7 +1204,7 @@ allocate_dynamic_stack_space (size, target, known_align) ...@@ -1204,7 +1204,7 @@ allocate_dynamic_stack_space (size, target, known_align)
/* Our optimization works based upon being able to perform a simple /* Our optimization works based upon being able to perform a simple
transformation of this RTL into a (set REG REG) so make sure things transformation of this RTL into a (set REG REG) so make sure things
did in fact end up in a REG. */ did in fact end up in a REG. */
if (!arith_operand (setjmpless_size, Pmode)) if (!register_operand (setjmpless_size, Pmode))
setjmpless_size = force_reg (Pmode, setjmpless_size); setjmpless_size = force_reg (Pmode, setjmpless_size);
} }
......
...@@ -2497,7 +2497,10 @@ emit_move_insn (x, y) ...@@ -2497,7 +2497,10 @@ emit_move_insn (x, y)
if (mode == BLKmode || (GET_MODE (y) != mode && GET_MODE (y) != VOIDmode)) if (mode == BLKmode || (GET_MODE (y) != mode && GET_MODE (y) != VOIDmode))
abort (); abort ();
if (CONSTANT_P (y) && ! LEGITIMATE_CONSTANT_P (y)) /* Never force constant_p_rtx to memory. */
if (GET_CODE (y) == CONSTANT_P_RTX)
;
else if (CONSTANT_P (y) && ! LEGITIMATE_CONSTANT_P (y))
y = force_const_mem (mode, y); y = force_const_mem (mode, y);
/* If X or Y are memory references, verify that their addresses are valid /* If X or Y are memory references, verify that their addresses are valid
...@@ -8993,16 +8996,11 @@ expand_builtin (exp, target, subtarget, mode, ignore) ...@@ -8993,16 +8996,11 @@ expand_builtin (exp, target, subtarget, mode, ignore)
|| POINTER_TYPE_P (TREE_TYPE (arg))) || POINTER_TYPE_P (TREE_TYPE (arg)))
return const0_rtx; return const0_rtx;
/* Otherwise, emit (const (constant_p_rtx (ARG))) and let CSE /* Otherwise, emit (constant_p_rtx (ARG)) and let CSE get a
get a chance to see if it can deduce whether ARG is constant. */ chance to see if it can deduce whether ARG is constant. */
/* ??? We always generate the CONST in ptr_mode since that's
certain to be valid on this machine, then convert it to
whatever we need. */
tmp = expand_expr (arg, NULL_RTX, VOIDmode, 0); tmp = expand_expr (arg, NULL_RTX, VOIDmode, 0);
tmp = gen_rtx_CONSTANT_P_RTX (ptr_mode, tmp); tmp = gen_rtx_CONSTANT_P_RTX (value_mode, tmp);
tmp = gen_rtx_CONST (ptr_mode, tmp);
tmp = convert_to_mode (value_mode, tmp, 0);
return tmp; return tmp;
} }
......
...@@ -1088,6 +1088,12 @@ immediate_operand (op, mode) ...@@ -1088,6 +1088,12 @@ immediate_operand (op, mode)
&& GET_MODE_CLASS (mode) != MODE_PARTIAL_INT) && GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
return 0; return 0;
/* Accept CONSTANT_P_RTX, since it will be gone by CSE1 and
result in 0/1. It seems a safe assumption that this is
in range for everyone. */
if (GET_CODE (op) == CONSTANT_P_RTX)
return 1;
return (CONSTANT_P (op) return (CONSTANT_P (op)
&& (GET_MODE (op) == mode || mode == VOIDmode && (GET_MODE (op) == mode || mode == VOIDmode
|| GET_MODE (op) == VOIDmode) || GET_MODE (op) == VOIDmode)
......
...@@ -2020,10 +2020,6 @@ reg_scan_mark_refs (x, insn, note_flag, min_regno) ...@@ -2020,10 +2020,6 @@ reg_scan_mark_refs (x, insn, note_flag, min_regno)
switch (code) switch (code)
{ {
case CONST: case CONST:
if (GET_CODE (XEXP (x, 0)) == CONSTANT_P_RTX)
reg_scan_mark_refs (XEXP (XEXP (x, 0), 0), insn, note_flag, min_regno);
return;
case CONST_INT: case CONST_INT:
case CONST_DOUBLE: case CONST_DOUBLE:
case CC0: case CC0:
......
/* This file contains the definitions and documentation for the /* This file contains the definitions and documentation for the
Register Transfer Expressions (rtx's) that make up the Register Transfer Expressions (rtx's) that make up the
Register Transfer Language (rtl) used in the Back End of the GNU compiler. Register Transfer Language (rtl) used in the Back End of the GNU compiler.
Copyright (C) 1987, 88, 92, 94, 95, 97, 1998 Free Software Foundation, Inc. Copyright (C) 1987, 88, 92, 94, 95, 97, 98, 1999 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -850,10 +850,9 @@ DEF_RTL_EXPR(RANGE_VAR, "range_var", "eti", 'x') ...@@ -850,10 +850,9 @@ DEF_RTL_EXPR(RANGE_VAR, "range_var", "eti", 'x')
0 is the live bitmap. Operand 1 is the original block number. */ 0 is the live bitmap. Operand 1 is the original block number. */
DEF_RTL_EXPR(RANGE_LIVE, "range_live", "bi", 'x') DEF_RTL_EXPR(RANGE_LIVE, "range_live", "bi", 'x')
/* A unary `__builtin_constant_p' expression. This RTL code may only be used /* A unary `__builtin_constant_p' expression. These are only emitted
as an operand of a CONST. This pattern is only emitted during RTL during RTL generation, and then only if optimize > 0. They are
generation and then only if optimize > 0. It is converted by the first eliminated by the first CSE pass. */
CSE pass into the appropriate CONST_INT. */
DEF_RTL_EXPR(CONSTANT_P_RTX, "constant_p_rtx", "e", 'x') DEF_RTL_EXPR(CONSTANT_P_RTX, "constant_p_rtx", "e", 'x')
/* /*
......
...@@ -219,7 +219,8 @@ typedef struct rtvec_def{ ...@@ -219,7 +219,8 @@ typedef struct rtvec_def{
#define CONSTANT_P(X) \ #define CONSTANT_P(X) \
(GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \ (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
|| GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST_DOUBLE \ || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST_DOUBLE \
|| GET_CODE (X) == CONST || GET_CODE (X) == HIGH) || GET_CODE (X) == CONST || GET_CODE (X) == HIGH \
|| GET_CODE (X) == CONSTANT_P_RTX)
/* General accessor macros for accessing the fields of an rtx. */ /* General accessor macros for accessing the fields of an rtx. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment