This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, alpha]: Fix PR42774: ICE with unaligned HImode mem


Hello!

Attached patch fixes ICE on unaligned HImode memory operand that
crosses two SImode locations. The full operand is unreachable with
current implemented approach, since gcc will only load HImode operand
in part with one aligned SImode load. The ICE was triggered by an
assert that was introduced in [1] exactly for cases like this - to
prevent silent generation of wrong code.

Attached patch fixes this by fixing {,un}aligned_memory_operand
predicate to consider operands with unaligned immediate offsets as
unaligned.

2010-01-18  Uros Bizjak  <ubizjak@gmail.com>

	PR target/42774
	* config/alpha/predicates.md (aligned_memory_operand): Return 0 for
	memory references with unaligned offsets.
	(unaligned_memory_operand): Return 1 for memory references with
	unaligned offsets.

testsuite/ChangeLog:

2010-01-18  Uros Bizjak  <ubizjak@gmail.com>

	PR target/42774
	* gcc.target/alpha/pr42774.c: New test.

Patch was bootstrapped and regression tested on 4.4 and 4.5 branch
with --build = --host = -target = alpha-linux-gnu.

If it is OK with RM, I also think that this patch should be committed
to 4.4 branch before releasing 4.4.3.

Uros.

[1] http://gcc.gnu.org/ml/gcc-patches/2009-12/msg01067.html

Attachment: p.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]