public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Florian Weimer <fw@deneb.enyo.de>
Cc: Joseph Myers <joseph@codesourcery.com>,
	Mayshao-oc <Mayshao-oc@zhaoxin.com>,
	"Qiyuan Wang(BJ-RD)" <QiyuanWang@zhaoxin.com>,
	"Cooper Yan(BJ-RD)" <CooperYan@zhaoxin.com>,
	 "Herry Yang(BJ-RD)" <HerryYang@zhaoxin.com>,
	GNU C Library <libc-alpha@sourceware.org>,
	 "Ricky Li(BJ-RD)" <RickyLi@zhaoxin.com>
Subject: Re: [PATCH v3 2/3] x86: Add cache information support for Zhaoxin processors
Date: Thu, 30 Apr 2020 12:21:17 -0700	[thread overview]
Message-ID: <CAMe9rOrgB4FxGCQQjVbHc-WDptcu8bhAr1CJ85ubH2+C6FTE3g@mail.gmail.com> (raw)
In-Reply-To: <87lfmc7pip.fsf@mid.deneb.enyo.de>

On Thu, Apr 30, 2020 at 12:16 PM Florian Weimer <fw@deneb.enyo.de> wrote:
>
> * Joseph Myers:
>
> > This has broken the build for 32-bit x86.
> >
> > In file included from ../sysdeps/i386/cacheinfo.c:3:
> > ../sysdeps/x86/cacheinfo.c: In function 'init_cacheinfo':
> > ../sysdeps/x86/cacheinfo.c:762:16: error: unused variable 'eax' [-Werror=unused-variable]
> >   762 |   unsigned int eax;
> >       |                ^~~
> > cc1: all warnings being treated as errors
> >
> > The variable eax in that function is only used inside #ifndef
> > DISABLE_PREFETCHW, and 32-bit defines DISABLE_PREFETCHW in
> > sysdeps/i386/cacheinfo.c.

Why didn't I see the problem with GCC 10?

> This seems to fix it.  Okay?
>
> 8<------------------------------------------------------------------8<
> Subject: i386: Remove unused variable in sysdeps/x86/cacheinfo.c
>
> Commit a98dc92dd1e278df4c501deb07985018bc2b06de ("x86: Add cache
> information support for Zhaoxin processors") introduced an unused
> variable warning in the default i686-linux-gnu build:
>
> In file included from ../sysdeps/i386/cacheinfo.c:3:
> ../sysdeps/x86/cacheinfo.c: In function 'init_cacheinfo':
> ../sysdeps/x86/cacheinfo.c:762:16: error: unused variable 'eax' [-Werror=unused-variable]
>   762 |   unsigned int eax;
>       |                ^~~
>
> -----
>  sysdeps/x86/cacheinfo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdeps/x86/cacheinfo.c b/sysdeps/x86/cacheinfo.c
> index 17d7e41aed..311502dee3 100644
> --- a/sysdeps/x86/cacheinfo.c
> +++ b/sysdeps/x86/cacheinfo.c
> @@ -759,7 +759,6 @@ __attribute__((constructor))
>  init_cacheinfo (void)
>  {
>    /* Find out what brand of processor.  */
> -  unsigned int eax;
>    unsigned int ebx;
>    unsigned int ecx;
>    unsigned int edx;
> @@ -830,6 +829,7 @@ init_cacheinfo (void)
>  #ifndef DISABLE_PREFETCHW
>        if (max_cpuid_ex >= 0x80000001)
>         {
> +         unsigned int eax;
>           __cpuid (0x80000001, eax, ebx, ecx, edx);
>           /*  PREFETCHW     || 3DNow!  */
>           if ((ecx & 0x100) || (edx & 0x80000000))

OK if it fixes the build problem.

Thanks.

-- 
H.J.

  reply	other threads:[~2020-04-30 19:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 12:29 [PATCH v3 0/3] x86: Add " mayshao-oc
2020-04-24 12:29 ` [PATCH v3 1/3] x86: Add CPU Vendor ID detection " mayshao-oc
2020-04-24 12:53   ` H.J. Lu
2020-04-24 12:29 ` [PATCH v3 2/3] x86: Add cache information " mayshao-oc
2020-04-24 12:53   ` H.J. Lu
2020-04-26  5:54     ` Mayshao-oc
2020-04-26 12:07       ` H.J. Lu
2020-04-30  5:09         ` Mayshao-oc
2020-04-30  5:15           ` H.J. Lu
2020-04-30  6:04             ` Mayshao-oc
2020-04-30 12:52               ` H.J. Lu
2020-04-30 13:22                 ` Mayshao-oc
2020-04-30 13:55                   ` H.J. Lu
2020-04-30 14:39                     ` Mayshao-oc
2020-04-30 19:10               ` Joseph Myers
2020-04-30 19:16                 ` Florian Weimer
2020-04-30 19:21                   ` H.J. Lu [this message]
2020-04-30 20:04                     ` Florian Weimer
2020-04-24 12:29 ` [PATCH v3 3/3] x86: Add the test case of __get_cpu_features " mayshao-oc
2020-04-24 12:54   ` H.J. Lu

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=CAMe9rOrgB4FxGCQQjVbHc-WDptcu8bhAr1CJ85ubH2+C6FTE3g@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=CooperYan@zhaoxin.com \
    --cc=HerryYang@zhaoxin.com \
    --cc=Mayshao-oc@zhaoxin.com \
    --cc=QiyuanWang@zhaoxin.com \
    --cc=RickyLi@zhaoxin.com \
    --cc=fw@deneb.enyo.de \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    /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).