On Tue, Jan 7, 2020 at 3:40 PM John McCall <rjmcc...@gmail.com> wrote: > > On Tue, Jan 7, 2020 at 3:18 PM Aaron Ballman <aa...@aaronballman.com> wrote: > > 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 > > Interesting. I'm glad we do something reasonable, but it's probably best not > to call this supported behavior. > > > > > > 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. > > Yeah, agreed. In general, allowing empty symbol names seems like it's > just unnecessarily courting all sorts of weird corner cases like this. > > > 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. > > If GCC isn't doing anything reasonable on empty labels, let's just call them > ill-formed and wash our hands of it.
Okay, that works for me. Thank you for the guidance (several others agreed on IRC as well)! I'll put together a patch for this shortly. ~Aaron > > John. _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits