public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/42403]  New: Incorrect CFI: doesn't readjust CFA after pop
@ 2009-12-17 13:55 tschwinge at gcc dot gnu dot org
  2009-12-17 14:12 ` [Bug debug/42403] " tschwinge at gcc dot gnu dot org
  2010-01-04 11:32 ` ramana at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: tschwinge at gcc dot gnu dot org @ 2009-12-17 13:55 UTC (permalink / raw)
  To: gcc-bugs

$ install/bin/arm-none-linux-gnueabi-gcc --version
    arm-none-linux-gnueabi-gcc (GCC) 4.5.0 20091214 (experimental)
    [...]

GCC fails to re-adjust the CFA after pop:

    $ cat d.c
    void foo(void)
    {
      register int r7 asm("r7");

      asm volatile ("" : : "r" (r7) : "memory");
    }
    $ install/bin/arm-none-linux-gnueabi-gcc -g -O -c -o d.o d.c
    $ install/bin/arm-none-linux-gnueabi-objdump -dr d.o

    d.o:     file format elf32-littlearm


    Disassembly of section .text:

    00000000 <foo>:
       0:   e52d7004        push    {r7}            ; (str r7, [sp, #-4]!)
       4:   e8bd0080        pop     {r7}
       8:   e12fff1e        bx      lr
    $ install/bin/arm-none-linux-gnueabi-readelf -wf d.o
    Contents of the .debug_frame section:

    00000000 0000000c ffffffff CIE
      Version:               1
      Augmentation:          ""
      Code alignment factor: 1
      Data alignment factor: -4
      Return address column: 14

      DW_CFA_def_cfa: r13 ofs 0

    00000010 00000014 00000000 FDE cie=00000000 pc=00000000..0000000c
      DW_CFA_advance_loc: 4 to 00000004
      DW_CFA_def_cfa_offset: 4
      DW_CFA_offset: r7 at cfa-4
      DW_CFA_nop
      DW_CFA_nop
      DW_CFA_nop

For correctness, GCC should emit .cfi_adjust_cfa_offset 0 and
.cfi_restore r7 at pos. 8.


-- 
           Summary: Incorrect CFI: doesn't readjust CFA after pop
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tschwinge at gcc dot gnu dot org
GCC target triplet: arm-none-linux-gnueabi


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


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

* [Bug debug/42403] Incorrect CFI: doesn't readjust CFA after pop
  2009-12-17 13:55 [Bug debug/42403] New: Incorrect CFI: doesn't readjust CFA after pop tschwinge at gcc dot gnu dot org
@ 2009-12-17 14:12 ` tschwinge at gcc dot gnu dot org
  2010-01-04 11:32 ` ramana at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: tschwinge at gcc dot gnu dot org @ 2009-12-17 14:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tschwinge at gcc dot gnu dot org  2009-12-17 14:12 -------
Last paragraph: .cfi_adjust_cfa_offset *-4*, of course.


-- 


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


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

* [Bug debug/42403] Incorrect CFI: doesn't readjust CFA after pop
  2009-12-17 13:55 [Bug debug/42403] New: Incorrect CFI: doesn't readjust CFA after pop tschwinge at gcc dot gnu dot org
  2009-12-17 14:12 ` [Bug debug/42403] " tschwinge at gcc dot gnu dot org
@ 2010-01-04 11:32 ` ramana at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: ramana at gcc dot gnu dot org @ 2010-01-04 11:32 UTC (permalink / raw)
  To: gcc-bugs



-- 

ramana at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-01-04 11:31:57
               date|                            |


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


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

end of thread, other threads:[~2010-01-04 11:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-17 13:55 [Bug debug/42403] New: Incorrect CFI: doesn't readjust CFA after pop tschwinge at gcc dot gnu dot org
2009-12-17 14:12 ` [Bug debug/42403] " tschwinge at gcc dot gnu dot org
2010-01-04 11:32 ` ramana at gcc dot gnu dot 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).