Skip to content
Snippets Groups Projects
Commit 9ba2de71 authored by Richard Biener's avatar Richard Biener Committed by Richard Biener
Browse files

middle-end/118695 - missed misalign handling in MEM_REF expansion

When MEM_REF expansion of a non-MEM falls back to a stack temporary
we fail to handle the case where the offset adjusted reference to
the temporary is not aligned according to the requirement of the
mode.  We have to go through bitfield extraction or movmisalign
in this case.  Fortunately there's a helper for this.

This fixes an ICE observed on arm which has sanity checks in its
move patterns for this.

	PR middle-end/118695
	* expr.cc (expand_expr_real_1): When expanding a MEM_REF
	to a non-MEM by committing it to a stack temporary make
	sure to handle misaligned accesses correctly.

	* gcc.dg/pr118695.c: New testcase.
parent 34d8c842
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment