public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Eager <eager@eagercon.com>
To: "Frager, Neal" <neal.frager@amd.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	"eager@eagerm.com" <eager@eagerm.com>,
	"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>
Subject: Re: [PATCH v1 1/1] gcc: config: microblaze: fix cpu version check
Date: Tue, 24 Oct 2023 07:57:48 -0700	[thread overview]
Message-ID: <ffb221a2-6ce2-47aa-ad0c-c4e6adfa6b2e@eagercon.com> (raw)
In-Reply-To: <CH2PR12MB500404B5AEE9D23407E98977F0DFA@CH2PR12MB5004.namprd12.prod.outlook.com>

On 10/24/23 00:01, Frager, Neal wrote:
>>>> There is a microblaze cpu version 10.0 included in versal. If the
>>>> minor version is only a single digit, then the version comparison
>>>> will fail as version 10.0 will appear as 100 compared to version
>>>> 6.00 or 8.30 which will calculate to values 600 and 830.
>>>> The issue can be seen when using the '-mcpu=10.0' option.
>>>> With this fix, versions with a single digit minor number such as
>>>> 10.0 will be calculated as greater than versions with a smaller
>>>> major version number, but with two minor version digits.
>>>> By applying this fix, several incorrect warning messages will no
>>>> longer be printed when building the versal plm application, such as
>>>> the warning message below:
>>>> warning: '-mxl-multiply-high' can be used only with '-mcpu=v6.00.a'
>>>> or greater
>>>> Signed-off-by: Neal Frager <neal.frager@amd.com>
>>>> ---
>>>>    gcc/config/microblaze/microblaze.cc | 164 +++++++++++++---------------
>>>>    1 file changed, 76 insertions(+), 88 deletions(-)
>>>
>>> Please add a test case.
>>>
>>> --
>>> Michael Eager
>>
>> Hi Michael,
>>
>> Would you mind helping me understand how to make a gcc test case for this patch?
>>
>> This patch does not change the resulting binaries of a microblaze gcc build.  The output will be the same with our without the patch, so I do not having anything in the binary itself to verify.
>>
>> All that happens is false warning messages will not be printed when building with ‘-mcpu=10.0’.  Is there a way to test for warning messages?
>>
>> In any case, please do not commit v1 of this patch.  I am going to work on making a v2 based on Mark’s feedback.
> 
>> You can create a test case which passes the -mcpu=10.0 and other options to GCC and verify that the message is not generated after the patch is applied.
> 
>> You can make all GCC warnings into errors with the "-Werror" option.
>> This means that the compile will fail if the warning is issued.
> 
>> Take a look at gcc/testsuite/gcc.target/aarch64/bti-1.c for an example of using { dg-options "<opt>" } to specify command line options.
> 
>> There is a test suite option (dg-warning) which checks that a particular source line generates a warning message, but it isn't clear whether is is possible to check that a warning is not issued.
> 
> Hi Michael,
> 
> Thanks to Mark Hatle's feedback, we have a much simpler solution to the problem.
> 
> The following change is actually all that is necessary.  Since we are just moving from
> strcasecmp to strverscmp, does v2 of the patch need to have a test case to go with it?
> 
> -#define MICROBLAZE_VERSION_COMPARE(VA,VB) strcasecmp (VA, VB)
> +#define MICROBLAZE_VERSION_COMPARE(VA,VB) strverscmp (VA, VB)
> 
> I assume there are already test cases that verify that strverscmp works correctly?

Still need a test case to verify this fix.

-- 
Michael Eager

  reply	other threads:[~2023-10-24 14:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23  5:48 Neal Frager
2023-10-23 14:07 ` Mark Hatle
2023-10-23 14:52   ` Frager, Neal
2023-10-23 16:40 ` Michael Eager
2023-10-23 18:37   ` Frager, Neal
2023-10-23 19:27     ` Michael Eager
2023-10-24  7:01       ` Frager, Neal
2023-10-24 14:57         ` Michael Eager [this message]
2023-10-25  8:04           ` 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=ffb221a2-6ce2-47aa-ad0c-c4e6adfa6b2e@eagercon.com \
    --to=eager@eagercon.com \
    --cc=appa.rao.nali@amd.com \
    --cc=eager@eagerm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ibai.erkiaga-elorza@amd.com \
    --cc=luca.ceresoli@bootlin.com \
    --cc=mark.hatle@amd.com \
    --cc=nagaraju.mekala@amd.com \
    --cc=neal.frager@amd.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).