xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Tim Deegan <tim@xen.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	"Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>
Subject: Re: [PATCH 6/7] x86/shadow: Make _shadow_prealloc() compile at -Og
Date: Thu, 22 Apr 2021 08:52:10 +0100	[thread overview]
Message-ID: <YIErKtfduIUqTEaJ@deinos.phlegethon.org> (raw)
In-Reply-To: <20210419140132.16909-7-andrew.cooper3@citrix.com>

At 15:01 +0100 on 19 Apr (1618844491), Andrew Cooper wrote:
> When compiling at -Og:
> 
>   In file included from
>   /builds/xen-project/people/andyhhp/xen/xen/include/asm/domain.h:4:0,
>                    from /builds/xen-project/people/andyhhp/xen/xen/include/xen/domain.h:8,
>                    from /builds/xen-project/people/andyhhp/xen/xen/include/xen/sched.h:11,
>                    from /builds/xen-project/people/andyhhp/xen/xen/include/xen/ioreq.h:22,
>                    from common.c:23:
>   common.c: In function '_shadow_prealloc':
>   /builds/xen-project/people/andyhhp/xen/xen/include/xen/mm.h:252:55: error: 't' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>        return page != head->next ? pdx_to_page(page->list.prev) : NULL;
>                                                          ^
>   common.c:933:28: note: 't' was declared here
>        struct page_info *sp, *t;
>                               ^
> 
> I'm not certain the analysis is correct.  't' is a temporary variable, and is
> clearly initialised before use in foreach_pinned_shadow().  Either way,
> initialising it to NULL placates the compiler.

Yeah, this analysis seems wrong to me too - if nothing else, why does
it not complain about the identical code in shadow_blow_tables() below?

That said, since the non-debug build doesn't complain here, presumably it
will be able to elide this dead store.

Acked-by: Tim Deegan <tim@xen.org>


  reply	other threads:[~2021-04-22  7:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19 14:01 [PATCH 0/7] xen: Switch to using -Og for debug builds Andrew Cooper
2021-04-19 14:01 ` [PATCH 1/7] xen/arm: Make make_cpus_node() compile at -Og Andrew Cooper
2021-04-22 18:20   ` Julien Grall
2021-04-19 14:01 ` [PATCH 2/7] x86/shim: Fix compilation " Andrew Cooper
2021-04-19 14:01 ` [PATCH 3/7] x86/sysctl: Make arch_do_sysctl() compile " Andrew Cooper
2021-04-19 14:01 ` [PATCH 4/7] x86/irq: Make create_irq() " Andrew Cooper
2021-04-19 14:01 ` [PATCH 5/7] xen/efi: Make efi_start() " Andrew Cooper
2021-04-19 14:01 ` [PATCH 6/7] x86/shadow: Make _shadow_prealloc() " Andrew Cooper
2021-04-22  7:52   ` Tim Deegan [this message]
2021-04-19 14:01 ` [PATCH 7/7] xen: Use -Og for debug builds when available Andrew Cooper
2021-04-19 15:45 ` [PATCH 0/7] xen: Switch to using -Og for debug builds Jan Beulich
2021-04-21  9:31   ` Andrew Cooper
2021-04-21  9:51     ` Jan Beulich

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=YIErKtfduIUqTEaJ@deinos.phlegethon.org \
    --to=tim@xen.org \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 NNTP newsgroup(s).