Commit ca312387 by Kito Cheng Committed by Kito Cheng

PR target/99702: Check RTL type before get value

gcc/ChangeLog:

	PR target/99702
	* config/riscv/riscv.c (riscv_expand_block_move): Get RTL value
	after type checking.

gcc/testsuite/ChangeLog:

	PR target/99702
	* gcc.target/riscv/pr99702.c: New.

(cherry picked from commit 540dace2ed3949571f2ce6cb007354e69bda0cb2)
parent 7a4a52c2
......@@ -3234,9 +3234,9 @@ riscv_block_move_loop (rtx dest, rtx src, unsigned HOST_WIDE_INT length,
bool
riscv_expand_block_move (rtx dest, rtx src, rtx length)
{
unsigned HOST_WIDE_INT hwi_length = UINTVAL (length);
if (CONST_INT_P (length))
{
unsigned HOST_WIDE_INT hwi_length = UINTVAL (length);
unsigned HOST_WIDE_INT factor, align;
align = MIN (MIN (MEM_ALIGN (src), MEM_ALIGN (dest)), BITS_PER_WORD);
......
/* { dg-do compile } */
/* { dg-options "-O" } */
char n;
void *i, *j;
void foo(void) {
__builtin_memcpy(i, j, n);
}
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