From: Alan Modra Date: Tue, 10 Jun 2025 01:41:44 +0000 (+0930) Subject: Re: Further rs_code_align support refinement X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c84d8b8aef997daae4daf5e1e05c5947a6c6957;p=thirdparty%2Fbinutils-gdb.git Re: Further rs_code_align support refinement Don't write the repeating nop pattern if it won't be used for alpha handle_align too. --- diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c index 9adfe1deacb..f9ca351cb45 100644 --- a/gas/config/tc-alpha.c +++ b/gas/config/tc-alpha.c @@ -5365,7 +5365,7 @@ alpha_handle_align (fragS *fragp) 0x00, 0x00, 0xfe, 0x2f }; - int bytes, fix; + size_t bytes, fix; char *p; if (fragp->fr_type != rs_align_code) @@ -5373,16 +5373,14 @@ alpha_handle_align (fragS *fragp) bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix; p = fragp->fr_literal + fragp->fr_fix; - fix = 0; - if (bytes & 3) + fix = bytes & 3; + if (fix) { - fix = bytes & 3; memset (p, 0, fix); p += fix; bytes -= fix; } - if (bytes & 4) { memcpy (p, unop, 4); @@ -5390,11 +5388,13 @@ alpha_handle_align (fragS *fragp) bytes -= 4; fix += 4; } - - memcpy (p, nopunop, 8); - fragp->fr_fix += fix; - fragp->fr_var = 8; + + if (bytes) + { + memcpy (p, nopunop, 8); + fragp->fr_var = 8; + } } /* Public interface functions. */