]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
explow: Avoid unnecessary alignment operations
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 6 Nov 2023 10:49:59 +0000 (10:49 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Mon, 6 Nov 2023 10:49:59 +0000 (10:49 +0000)
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.

gcc/explow.cc

index aa64d5e906cf4484a84015765c5cc1513792103d..0be6d2629c9d748b1958bbe2817978684d2ff1e1 100644 (file)
@@ -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.  */