[PATCH] aarch64: increase alias candidate limit in aarch64-gen

Alice Carlotti alice.carlotti@arm.com
Fri Aug 21 14:14:52 GMT 2026


On Fri, Aug 21, 2026 at 11:55:35AM +0100, Richard Earnshaw (foss) wrote:
> On 21/08/2026 11:45, Muhammad Kamran wrote:
> > 
> > 
> > On 21/08/2026 11:36, Richard Earnshaw (foss) wrote:
> >> On 19/08/2026 09:23, Muhammad Kamran wrote:
> >>> Increase max_num_aliases from 32 to 64 so that aarch64-gen can
> >>> accommodate the additional HINT-space alias added for FEAT_PAuth_LR.
> >>>
> >>
> >> What were the symptoms of the overflow? A build time failure, a run-time assert, or crash, or just garbled output?
> >>
> > 
> > The overflow shows up as a build-time failure while regenerating the
> > generated AArch64 opcode files.� The FEAT_PAuth_LR HINT-space alias
> > (yet to be posted) increases the number of aliases matching the same
> > encoding group, and find_alias_opcode trips:
> > 
> > � assert (i < max_num_aliases)
> > 
> > For instance,
> > $ aarch64-gen --gen-dis > $(binutils)/opcodes/aarch64-dis-2.c
> > aarch64-gen: /work/src/binutils/opcodes/aarch64-gen.c:813: find_alias_opcode: Assertion `i < max_num_aliases' failed.
> > Aborted
> > 
> 
> OK, thanks. Patch pushed.
> 
> R.

For context, max_num_aliases exists purely to bound the time taken to do a
linear scan of all the aliases of an aliased instruction.  I have some ideas to
improve this search in future, but increasing the current cap is absolutely
fine.

Alice

> 
> >>
> >>> The generated disassembler alias preference list can otherwise exceed
> >>> the old fixed limit.
> >>> ---
> >>> � opcodes/aarch64-gen.c | 4 ++--
> >>> � 1 file changed, 2 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/opcodes/aarch64-gen.c b/opcodes/aarch64-gen.c
> >>> index a387cd4a1e0..abe4147f2c4 100644
> >>> --- a/opcodes/aarch64-gen.c
> >>> +++ b/opcodes/aarch64-gen.c
> >>> @@ -789,8 +789,8 @@ opcode_node *
> >>> � find_alias_opcode (const aarch64_opcode *opcode)
> >>> � {
> >>> ��� int i;
> >>> -� /* Assume maximum of 32 disassemble preference candidates.� */
> >>> -� const int max_num_aliases = 32;
> >>> +� /* Assume maximum of 64 disassemble preference candidates.� */
> >>> +� const int max_num_aliases = 64;
> >>> ��� const aarch64_opcode *ent;
> >>> ��� const aarch64_opcode *preferred[max_num_aliases + 1];
> >>> ��� opcode_node head, **next;
> >>
> > 
> 


More information about the Binutils mailing list