public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/51517] New: [4.4 regression ] Wrong debug information for pointers with negative strides.
@ 2011-12-12 21:58 nikolay at totalviewtech dot com
  2011-12-13 11:21 ` [Bug debug/51517] [4.5/4.6/4.7 Regression] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: nikolay at totalviewtech dot com @ 2011-12-12 21:58 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51517

             Bug #: 51517
           Summary: [4.4 regression ] Wrong debug information for pointers
                    with negative strides.
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: debug
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: nikolay@totalviewtech.com


Created attachment 26062
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26062
Example to demostrate

Consider attached examples, pointer ip: 
integer, dimension (:), pointer :: ip

If you associate it twice for two variables, 
.....
ip   => it  (10:1:-2)
.... 
ip    => unpleasant%small_pad

than stride calculated as zero
 <2><b2>: Abbrev Number: 7 (DW_TAG_variable)
     DW_AT_name        : ip    
     DW_AT_decl_file   : 1    
     DW_AT_decl_line   : 8    
     DW_AT_type        : <165>    
     DW_AT_location    : 3 byte block: 91 b0 7e     (DW_OP_fbreg: -208)
 <1><165>: Abbrev Number: 15 (DW_TAG_array_type)
     DW_AT_data_location: 2 byte block: 97 6     (DW_OP_push_object_address;
DW_OP_deref)
     DW_AT_associated  : 4 byte block: 97 6 30 2e    
(DW_OP_push_object_address; DW_OP_deref; DW_OP_lit0; DW_OP_ne)
     DW_AT_type        : <60>    
     DW_AT_sibling     : <189>
 <2><176>: Abbrev Number: 14 (DW_TAG_subrange_type)
     DW_AT_lower_bound : 4 byte block: 97 23 20 6    
(DW_OP_push_object_address; DW_OP_plus_uconst: 32; DW_OP_deref)
     DW_AT_upper_bound : 4 byte block: 97 23 28 6    
(DW_OP_push_object_address; DW_OP_plus_uconst: 40; DW_OP_deref)
     DW_AT_stride      : 6 byte block: 97 23 18 6 30 1e    
(DW_OP_push_object_address; DW_OP_plus_uconst: 24; DW_OP_deref; DW_OP_lit0;
DW_OP_mul)

I think error is in: DW_OP_lit0. Should be something like DW_OP_lit2

This is regression from 4.4 and is broken in 4.5 and 4.6

I have attached an example that you can compile and verify.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-07-02 10:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-12 21:58 [Bug debug/51517] New: [4.4 regression ] Wrong debug information for pointers with negative strides nikolay at totalviewtech dot com
2011-12-13 11:21 ` [Bug debug/51517] [4.5/4.6/4.7 Regression] " rguenth at gcc dot gnu.org
2011-12-14 14:37 ` jakub at gcc dot gnu.org
2011-12-14 15:20 ` jakub at gcc dot gnu.org
2011-12-15 11:09 ` jakub at gcc dot gnu.org
2011-12-15 11:11 ` [Bug debug/51517] [4.5/4.6 " jakub at gcc dot gnu.org
2012-02-09 17:14 ` jakub at gcc dot gnu.org
2012-06-20 13:12 ` [Bug debug/51517] [4.5 " rguenth at gcc dot gnu.org
2012-07-02 10:20 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).