Commit 4c685825 by Richard Guenther Committed by Richard Biener

alias.c (ao_ref_from_mem): Correct for negative MEM_OFFSET produced for…

alias.c (ao_ref_from_mem): Correct for negative MEM_OFFSET produced for bigendian targets with promoted...

2009-09-23  Richard Guenther  <rguenther@suse.de>

	* alias.c (ao_ref_from_mem): Correct for negative MEM_OFFSET
	produced for bigendian targets with promoted subregs.

From-SVN: r152083
parent 659ad88e
2009-09-23 Richard Guenther <rguenther@suse.de> 2009-09-23 Richard Guenther <rguenther@suse.de>
* alias.c (ao_ref_from_mem): Correct for negative MEM_OFFSET
produced for bigendian targets with promoted subregs.
2009-09-23 Richard Guenther <rguenther@suse.de>
* value-prof.c (gimple_ic): Purge old EH edges only after building * value-prof.c (gimple_ic): Purge old EH edges only after building
the new ones. the new ones.
......
...@@ -309,6 +309,18 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem) ...@@ -309,6 +309,18 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem)
ref->offset = 0; ref->offset = 0;
ref->max_size = -1; ref->max_size = -1;
} }
else if (INTVAL (MEM_OFFSET (mem)) < 0
&& MEM_EXPR (mem) != get_spill_slot_decl (false))
{
/* Negative MEM_OFFSET happens for promoted subregs on bigendian
targets. We need to compensate both the size and the offset here,
which get_ref_base_and_extent will have done based on the MEM_EXPR
already. */
gcc_assert (((INTVAL (MEM_SIZE (mem)) + INTVAL (MEM_OFFSET (mem)))
* BITS_PER_UNIT)
== ref->size);
return true;
}
else else
{ {
ref->offset += INTVAL (MEM_OFFSET (mem)) * BITS_PER_UNIT; ref->offset += INTVAL (MEM_OFFSET (mem)) * BITS_PER_UNIT;
......
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