public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Frager, Neal" <neal.frager@amd.com>
To: Michael Eager <eager@eagercon.com>,
	"binutils@sourceware.org" <binutils@sourceware.org>
Cc: "Erkiaga Elorza, Ibai" <ibai.erkiaga-elorza@amd.com>,
	"Mekala, Nagaraju" <nagaraju.mekala@amd.com>,
	"Hatle, Mark" <mark.hatle@amd.com>,
	"Mutyala, Sadanand" <sadanand.mutyala@amd.com>,
	"Nali, Appa Rao" <appa.rao.nali@amd.com>,
	"Hunsigida, Vidhumouli" <vidhumouli.hunsigida@amd.com>,
	"luca.ceresoli@bootlin.com" <luca.ceresoli@bootlin.com>,
	"nickc@redhat.com" <nickc@redhat.com>,
	"mark@klomp.org" <mark@klomp.org>,
	"macro@orcam.me.uk" <macro@orcam.me.uk>
Subject: RE: [PATCH v6 1/2] opcodes: microblaze: Add new bit-field instructions
Date: Sun, 15 Oct 2023 16:48:29 +0000	[thread overview]
Message-ID: <CH2PR12MB5004500C317ACD89874A03EEF0D0A@CH2PR12MB5004.namprd12.prod.outlook.com> (raw)
In-Reply-To: <db0d4d50-7803-f678-7987-c2f5269b917f@eagercon.com>

Hi Michael,

> When I run the test suite I see many segfaults.

> Take a look at
> gas/config/tc-microblaze.c +418:
> md_begin() ...
>   /* Insert unique names into hash table.  */
>   for (opcode = microblaze_opcodes; opcode->name; opcode ++)
>     str_hash_insert (opcode_hash_control, opcode->name, opcode, 0);

> compare the end of the microblaze_opcodes table:
> binutils/opcodes/microblaze-opc.h +427
> microblaze_opcodes[] ...
>   {"", 0, 0, 0, 0, 0, 0, 0, 0},

> It looks like there is a mismatch on termination condition.

> I changed this to
>   {NULL, 0, 0, 0, 0, 0, 0, 0, 0},

> I'm at a loss to explain why this did not fail earlier.

I believe I know why this did not fail earlier.

In the past, the array size was larger than needed with a value of MAX_OPCODES that was larger than the number of elements in the array.

As part of this patch, I reduced the MAX_OPCODES to the exact number of elements in the array.

-#define MAX_OPCODES 300
+#define MAX_OPCODES 291

So in the past, there were extra NULL elements beyond the end of the array.

In any case, thank you for your review, fixing this issue and committing the patch!

Best regards,
Neal Frager
AMD



  reply	other threads:[~2023-10-15 16:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-13  7:28 Neal Frager
2023-10-13  7:28 ` [PATCH v6 2/2] gas: testsuite: microblaze: Add new bit-field tests Neal Frager
2023-10-17 22:58   ` Michael Eager
2023-10-15 16:30 ` [PATCH v6 1/2] opcodes: microblaze: Add new bit-field instructions Michael Eager
2023-10-15 16:48   ` Frager, Neal [this message]
2023-10-19  3:40     ` Alan Modra
2023-10-19  3:53       ` Alan Modra
2023-10-19  6:40         ` Frager, Neal
2023-10-19 10:23           ` Alan Modra
2023-10-19 13:20         ` Frager, Neal
2023-10-19 21:30           ` Alan Modra
2023-10-20  6:28             ` Frager, Neal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CH2PR12MB5004500C317ACD89874A03EEF0D0A@CH2PR12MB5004.namprd12.prod.outlook.com \
    --to=neal.frager@amd.com \
    --cc=appa.rao.nali@amd.com \
    --cc=binutils@sourceware.org \
    --cc=eager@eagercon.com \
    --cc=ibai.erkiaga-elorza@amd.com \
    --cc=luca.ceresoli@bootlin.com \
    --cc=macro@orcam.me.uk \
    --cc=mark.hatle@amd.com \
    --cc=mark@klomp.org \
    --cc=nagaraju.mekala@amd.com \
    --cc=nickc@redhat.com \
    --cc=sadanand.mutyala@amd.com \
    --cc=vidhumouli.hunsigida@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).