This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug debug/42801] C VLAs should use DW_AT_allocated



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]