From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32287 invoked by alias); 12 Dec 2011 21:56:01 -0000 Received: (qmail 32278 invoked by uid 22791); 12 Dec 2011 21:56:00 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Dec 2011 21:55:39 +0000 From: "nikolay at totalviewtech dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/51517] New: [4.4 regression ] Wrong debug information for pointers with negative strides. Date: Mon, 12 Dec 2011 21:58:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: nikolay at totalviewtech dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-12/txt/msg01301.txt.bz2 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>: 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.