aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2023-11-06 10:49:59 +0000
committerRichard Sandiford <richard.sandiford@arm.com>2023-11-06 10:49:59 +0000
commit89abbaa5fb3823601710394683cf2e2101aba66a (patch)
treec6206080698829cfc752d8e1b01417036c6bfb97
parenta7a45364dddef399bfb550235166df51108a3142 (diff)
downloadgcc-89abbaa5fb3823601710394683cf2e2101aba66a.zip
gcc-89abbaa5fb3823601710394683cf2e2101aba66a.tar.gz
gcc-89abbaa5fb3823601710394683cf2e2101aba66a.tar.bz2
explow: Avoid unnecessary alignment operations
align_dynamic_address would output alignment operations even for a required alignment of 1 byte. gcc/ * explow.cc (align_dynamic_address): Do nothing if the required alignment is a byte.
-rw-r--r--gcc/explow.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/explow.cc b/gcc/explow.cc
index aa64d5e..0be6d26 100644
--- a/gcc/explow.cc
+++ b/gcc/explow.cc
@@ -1201,6 +1201,9 @@ record_new_stack_level (void)
rtx
align_dynamic_address (rtx target, unsigned required_align)
{
+ if (required_align == BITS_PER_UNIT)
+ return target;
+
/* CEIL_DIV_EXPR needs to worry about the addition overflowing,
but we know it can't. So add ourselves and then do
TRUNC_DIV_EXPR. */