diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 2003-04-18 22:39:23 +0000 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2003-04-18 18:39:23 -0400 |
commit | 34d21fe3054dc40c9aca6a0073d233e766944c52 (patch) | |
tree | b8a2291cd0a9b39efe82cabad278ef627235fda0 /gcc/function.c | |
parent | dd4ff203fa1c9f63d013a3770789cb568e3b8253 (diff) | |
download | gcc-34d21fe3054dc40c9aca6a0073d233e766944c52.zip gcc-34d21fe3054dc40c9aca6a0073d233e766944c52.tar.gz gcc-34d21fe3054dc40c9aca6a0073d233e766944c52.tar.bz2 |
function.c (purge_addressof_1): For ADDRESSOF...
* function.c (purge_addressof_1): For ADDRESSOF, see if SUB is a
hard or virtual register and copy into pseudo if replacement fails.
From-SVN: r65798
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/function.c b/gcc/function.c index 699fd21..b75a07e 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -3052,7 +3052,15 @@ purge_addressof_1 (loc, insn, force, store, may_postpone, ht) return true; start_sequence (); - sub = force_operand (sub, NULL_RTX); + + /* If SUB is a or virtual register, try it as a pseudo-register. + Otherwise, perhaps SUB is an expression, so generate code to compute + it. */ + if (GET_CODE (sub) == REG && REGNO (sub) <= LAST_VIRTUAL_REGISTER) + sub = copy_to_reg (sub); + else + sub = force_operand (sub, NULL_RTX); + if (! validate_change (insn, loc, sub, 0) && ! validate_replace_rtx (x, sub, insn)) abort (); |