aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorJ"orn Rennecke <amylaar@cygnus.co.uk>1999-01-27 11:35:30 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>1999-01-27 11:35:30 +0000
commitd91dfff4d1a480cd924e7273d5c79d02bd4ec768 (patch)
tree933b0d05eb053d65f6b7b33bc67abec736876c46 /gcc/function.c
parenta1660badb60537faafc659b24e2bc95a4b5fccba (diff)
downloadgcc-d91dfff4d1a480cd924e7273d5c79d02bd4ec768.zip
gcc-d91dfff4d1a480cd924e7273d5c79d02bd4ec768.tar.gz
gcc-d91dfff4d1a480cd924e7273d5c79d02bd4ec768.tar.bz2
function.c (purge_addressof_1): Handle case when a register has been used in a wider mode.
* function.c (purge_addressof_1): Handle case when a register has been used in a wider mode. From-SVN: r24887
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 90540d7..e2c836d 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -2939,7 +2939,20 @@ purge_addressof_1 (loc, insn, force, store)
< GET_MODE_SIZE (GET_MODE (y)))
abort ();
- z = gen_lowpart (GET_MODE (x), z);
+ if (GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD
+ && (GET_MODE_SIZE (GET_MODE (x))
+ > GET_MODE_SIZE (GET_MODE (z))))
+ {
+ /* This can occur as a result in invalid
+ pointer casts, e.g. float f; ...
+ *(long long int *)&f.
+ ??? We could emit a warning here, but
+ without a line number that wouldn't be
+ very helpful. */
+ z = gen_rtx_SUBREG (GET_MODE (x), z, 0);
+ }
+ else
+ z = gen_lowpart (GET_MODE (x), z);
}
*loc = z;