From: Richard Sandiford Date: Mon, 6 Nov 2023 10:49:59 +0000 (+0000) Subject: explow: Avoid unnecessary alignment operations X-Git-Tag: basepoints/gcc-15~4989 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=89abbaa5fb3823601710394683cf2e2101aba66a;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/explow.cc b/gcc/explow.cc index aa64d5e906cf..0be6d2629c9d 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. */