aboutsummaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2021-04-21 14:13:04 +0200
committerBernd Edlinger <bernd.edlinger@hotmail.de>2021-04-27 17:47:25 +0200
commitc33db31d9ad96f6414460315c12b4b505fad5dd7 (patch)
treed6eced509e19fdc7efbe871cf8dc418f8485970d /gcc/simplify-rtx.c
parent3bb41228d76b3a3cbd9923d57388f0903f7683de (diff)
downloadgcc-c33db31d9ad96f6414460315c12b4b505fad5dd7.zip
gcc-c33db31d9ad96f6414460315c12b4b505fad5dd7.tar.gz
gcc-c33db31d9ad96f6414460315c12b4b505fad5dd7.tar.bz2
Fix target/100106 ICE in gen_movdi
As the test case shows, the outer mode may have a higher alignment requirement than the inner mode here. 2021-04-27 Bernd Edlinger <bernd.edlinger@hotmail.de> PR target/100106 * simplify-rtx.c (simplify_context::simplify_subreg): Check the memory alignment for the outer mode. * gcc.c-torture/compile/pr100106.c: New testcase.
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index d13c390..ad3b7b2 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -7217,6 +7217,7 @@ simplify_context::simplify_subreg (machine_mode outermode, rtx op,
have instruction to move the whole thing. */
&& (! MEM_VOLATILE_P (op)
|| ! have_insn_for (SET, innermode))
+ && !(STRICT_ALIGNMENT && MEM_ALIGN (op) < GET_MODE_ALIGNMENT (outermode))
&& known_le (outersize, innersize))
return adjust_address_nv (op, outermode, byte);