Open Quuxplusone opened 6 years ago
Bugzilla Link | PR36322 |
Status | NEW |
Importance | P enhancement |
Reported by | Paul Robinson (paul_robinson@playstation.sony.com) |
Reported on | 2018-02-09 10:38:14 -0800 |
Last modified on | 2018-10-25 20:11:56 -0700 |
Version | unspecified |
Hardware | PC Windows NT |
CC | aprantl@apple.com, dblaikie@gmail.com, hfinkel@anl.gov, international.phantom@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk, sander.desmalen@arm.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
Currently (after r323952) we emit an artificial variable that holds the
count of array elements. As a variant of Carlos' suggestion, we could
emit the appropriate DWARF expression as the count, instead of conjuring
up an actual DW_TAG_variable.
This is a small size optimization, whose effect depends on the number of
VLAs used in a particular bit of source.
I'm mildly curious what happens if a function with a VLA gets inlined
into another function; the bounds expression is part of the type, but
the location would presumably be different for each inlined instance.
> I'm mildly curious what happens if a function with a VLA gets inlined
> into another function; the bounds expression is part of the type, but
> the location would presumably be different for each inlined instance.
If anyone wants to play with this, we have a testcase for that very situation in
llvm/test/DebugInfo/X86/vla-dependencies.ll
And I would be really surprised if any debugger interpreted this correctly.
(In reply to Adrian Prantl from comment #2)
> > I'm mildly curious what happens if a function with a VLA gets inlined
> > into another function; the bounds expression is part of the type, but
> > the location would presumably be different for each inlined instance.
>
> If anyone wants to play with this, we have a testcase for that very
> situation in
>
> llvm/test/DebugInfo/X86/vla-dependencies.ll
>
> And I would be really surprised if any debugger interpreted this correctly.
Let me spin off "other issues with the VLA implementation" as its
own bug, we can keep this one specifically for the suggestion to
avoid emitting a separate DIE entirely.