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/45299] Dwarf information is wrong with optimised code.



------- Comment #1 from hariharans at picochip dot com  2010-08-16 16:17 -------
Sorry for the incomplete description. The actual description:

I saw this problem initially on 4.5.0 compiler, but the same problem happens on
mainline too. In function arraysum in the attached example, the parameter
array, which is a pointer to array of int actually gets reflected in dwarf
wrong. The dwarf reader that we have says this

      <0x457> (15) Inlined subroutine: "arraySum"
        Called from:
          File: /home/gccuser/Tools/Verification/Debugger/symbolic/symbolic.vhd
          Line: 603
          Column: 0
        Address Ranges: [0x40, 0x63) 
        <0x463> (16) Parameter:
          Name: size
          Type: <0x35a>
          Location: DW_OP_reg1 
        <0x46a> (17) Parameter:
          Name: array
          Type: <0x3f3>
          Location: 
        [47, 51) : DW_OP_reg0 

In the range [47,51) array parameter resides in reg0, according to dwarf. This
is valid only at instruction at 47.  The instruction does this.

ldw (r0)0, r0

So, r0 now contains the first value in the array instead of the address and
hence the dwarf is wrong for the rest of this address range.

Disabling VTA means most of the variables in this testcase become "Not
Present".

I will add the source file, assembly and address encoded assembly so you can
see what is going on. Please let me know if you need any other information.


-- 


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


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