From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
clang-built-linux <clang-built-linux@googlegroups.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: warning: objtool: fn1 uses BP as a scratch register
Date: Fri, 19 Jul 2019 13:31:25 -0500 [thread overview]
Message-ID: <20190719183125.2tuhcch2rtanxvyn@treble> (raw)
In-Reply-To: <CAKwvOdmoD1wVFLdWRXTA=c-p4oc6HDxsfhXq5wQpD-8oFUfNNQ@mail.gmail.com>
On Fri, Jul 19, 2019 at 11:23:16AM -0700, Nick Desaulniers wrote:
> On Fri, Jul 19, 2019 at 11:10 AM Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > A lot of objtool fixes showed up in linux-next, so I looked at some
> > remaining ones.
> > This one comes a lot up in some configurations
> >
> > https://godbolt.org/z/ZZLVD-
> >
> > struct ov7670_win_size {
> > int width;
> > int height;
> > };
> > struct ov7670_devtype {
> > struct ov7670_win_size *win_sizes;
> > unsigned n_win_sizes;
> > };
> > struct ov7670_info {
> > int min_width;
> > int min_height;
> > struct ov7670_devtype devtype;
> > } a;
> > int b;
> > int fn1() {
> > struct ov7670_info c = a;
> > int i = 0;
> > for (; i < c.devtype.n_win_sizes; i++) {
> > struct ov7670_win_size d = c.devtype.win_sizes[i];
> > if (c.min_width && d.width < d.height < c.min_height)
> > if (b)
> > return 0;
> > }
> > return 2;
> > }
> >
> > $ clang-8 -O2 -fno-omit-frame-pointer -fno-strict-overflow -c ov7670.i
> > $ objtool check --no-unreachable --uaccess ov7670.o
> > ov7670.o: warning: objtool: fn1 uses BP as a scratch register
>
> Thanks for the report and reduced test case. From the godbolt link, I
> don't see %rbp, %ebp, %bp, or %bpl being referenced (other that %rbp
> in the typical epilogue). Am I missing something? Is objtool maybe
> not reporting the precise function at fault?
I haven't looked, but it could very well be an objtool bug (surprise).
--
Josh
next prev parent reply other threads:[~2019-07-19 18:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-19 18:09 warning: objtool: fn1 uses BP as a scratch register Arnd Bergmann
2019-07-19 18:23 ` Nick Desaulniers
2019-07-19 18:31 ` Josh Poimboeuf [this message]
2019-07-19 18:44 ` Arnd Bergmann
2019-07-19 18:48 ` Nick Desaulniers
2019-07-19 18:50 ` Nick Desaulniers
2019-07-19 19:43 ` Arnd Bergmann
2019-07-22 19:46 ` Topper, Craig
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=20190719183125.2tuhcch2rtanxvyn@treble \
--to=jpoimboe@redhat.com \
--cc=arnd@arndb.de \
--cc=clang-built-linux@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.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).