[PR100518] store by mult pieces: keep addr in Pmode

The conversion of a MEM address to ptr_mode in
try_store_by_multiple_pieces was misguided: copy_addr_to_reg expects
Pmode for addresses.


for  gcc/ChangeLog

	PR target/100518
	* builtins.c (try_store_by_multiple_pieces): Drop address
	conversion to ptr_mode.

for  gcc/testsuite/ChangeLog

	PR target/100518
	* gcc.target/aarch64/pr100518.c: New.
This commit is contained in:
Alexandre Oliva 2021-12-15 02:22:34 -03:00 committed by Alexandre Oliva
parent c95a9f1ee7
commit 71cc9b8c39
2 changed files with 10 additions and 1 deletions

View file

@ -4003,7 +4003,7 @@ try_store_by_multiple_pieces (rtx to, rtx len, unsigned int ctz_len,
constfundata = &valc;
}
rtx ptr = copy_addr_to_reg (convert_to_mode (ptr_mode, XEXP (to, 0), 0));
rtx ptr = copy_addr_to_reg (XEXP (to, 0));
rtx rem = copy_to_mode_reg (ptr_mode, convert_to_mode (ptr_mode, len, 0));
to = replace_equiv_address (to, ptr);
set_mem_align (to, align);

View file

@ -0,0 +1,9 @@
/* { dg-do compile } */
/* { dg-options "-mabi=ilp32 -mstrict-align -O2" } */
int unsigned_range_min, unsigned_range_max, a11___trans_tmp_1;
void a11() {
a11___trans_tmp_1 = unsigned_range_max < unsigned_range_min;
__builtin_memset((char *)1, 0, a11___trans_tmp_1);
}