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
This commit is contained in:
J"orn Rennecke 1999-01-27 11:35:30 +00:00 committed by Joern Rennecke
parent a1660badb6
commit d91dfff4d1
2 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Wed Jan 27 19:31:36 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* function.c (purge_addressof_1): Handle case when a register
has been used in a wider mode.
Wed Jan 27 11:58:18 1999 Dave Brolley <brolley@cygnus.com>
* cpplib.h (cpp_notice): Add prototype.

View File

@ -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;