On Tue, Jan 7, 2020 at 3:13 PM John McCall <rjmcc...@gmail.com> wrote:
>
> On Tue, Jan 7, 2020 at 3:02 PM Aaron Ballman <aa...@aaronballman.com> wrote:
> > On Tue, Jan 7, 2020 at 2:57 PM John McCall via cfe-commits
> > <cfe-comm...@lists.llvm.org> wrote:
> > > On Tue, Jan 7, 2020 at 1:44 PM Aaron Ballman via Phabricator
> > > <revi...@reviews.llvm.org> wrote:
> > > > Sorry to dredge up an old review, but I recently ran into a bug in this 
> > > > area and am not certain of how to fix it. What should happen if the asm 
> > > > label is a literal which is empty?
> > >
> > > The problems here are unique to empty labels, right?
> >
> > To the best of my knowledge, yes.
> >
> > > Can we just
> > > diagnose this as an error?
> >
> > I don't think so -- GCC's function attribute documentation seems to
> > suggest you should do this with noinline functions (see the docs for
> > noinline here 
> > https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes)
>
> That's an assembly statement, not a label.

Oh! Good catch!

It seems like GCC doesn't do good things when trying to link two
functions with empty asm labels but Clang does seem to do something
reasonable. I can't quite tell whether this is a case for a diagnostic
or not. Note the generated assembly in: https://godbolt.org/z/HFfPs6

> > > Is this bug occurring with real code, or
> > > is LLDB constructing something bizarre?
> >
> > It was a c-reduced test case that we found when doing AST dumping to
> > JSON, so I think the code was probably real at one point.
>
> Unless your reducer is smart enough to try to minimize string
> literals, which it might be.

Also possible. Regardless, a failed assertion isn't a good outcome. If
we think it's fine to diagnose empty labels, I'm fine with the change.
I don't know enough about how asm labels are used to have a feeling
for the correct way to resolve the issue.

~Aaron

>
> John.
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to