This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/42801] C VLAs should use DW_AT_allocated
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 May 2010 08:52:41 -0000
- Subject: [Bug debug/42801] C VLAs should use DW_AT_allocated
- References: <bug-42801-12292@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from jakub at gcc dot gnu dot org 2010-05-24 08:52 -------
I think DW_AT_allocated would be wrong for C VLAs, they don't have allocated
property like Fortran arrays.
The problems I see are:
1) for -O0 we don't do any var-tracking, while we should be tracking
i) variables that don't live in memory (vars with register keyword mostly)
ii) everything during prologues until the stack slots of those variables
are actually set
iii) for VLAs even outside of prologues we need to track the lengths before
they are actually set
Of course this is going to slow down the compiler at -O0 somewhat, so needs
to be done with extreme care
2) for -O2 there seems to be some issues with VLAs in inlines and cloned
functions - the type is used from the abstract origin and thus can't have
correct bounds. I wonder whether it is ok to have DW_AT_abstract_origin
and in addition to that DW_AT_type which overrides the original abstract
origin's type (and, whether gdb will handle it right)
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |aoliva at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42801