public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/34174]  New: gcc produces erroneous asm for movdi
@ 2007-11-21 12:34 markus dot heigl at fme dot fujitsu dot com
  2007-11-21 12:37 ` [Bug c/34174] " markus dot heigl at fme dot fujitsu dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: markus dot heigl at fme dot fujitsu dot com @ 2007-11-21 12:34 UTC (permalink / raw)
  To: gcc-bugs

Compiling the testcase for BUG #27386 with the fr30-elf crosscompiler
shows that while reloading memory operands to registers the source adress of
the memory operand is changed.

testcase:

typedef unsigned long long uint64_t;

uint64_t a, b, c;

int
foo(uint64_t x, uint64_t y, uint64_t z, int i)
{
        a = x;
        b = y;
        c = z;
        return 2 * i;
}

int main( void )
{
        return foo(1234512345123ull,
                   3456734567345ull,
                   7897897897897ull,
                   42);


}

Looking at the assembler output which should store argument x in a

        ldi:32  a, r3   
        ldi:8   #248, r1
        extsb   r1      
        addn    fp, r1  
        ld      @r1, r1 
        mov     r1, r2    <-- *
        addn    4, r2   
        ld      @r2, r2 
        st      r1, @r3 
        st      r1, @-r15       
        mov     r3, r1  
        addn    4, r1   
        st      r2, @r1 

At the position marked with * the compiler probably wants the adress of a which
was stored in r1 but r1 was changed by the previous ld instruction.


-- 
           Summary: gcc produces erroneous asm for movdi
           Product: gcc
           Version: 4.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: markus dot heigl at fme dot fujitsu dot com
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: fr30-unknown-elf


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


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

end of thread, other threads:[~2007-11-28  1:56 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-21 12:34 [Bug c/34174] New: gcc produces erroneous asm for movdi markus dot heigl at fme dot fujitsu dot com
2007-11-21 12:37 ` [Bug c/34174] " markus dot heigl at fme dot fujitsu dot com
2007-11-21 12:37 ` markus dot heigl at fme dot fujitsu dot com
2007-11-21 15:41 ` [Bug target/34174] " rask at gcc dot gnu dot org
2007-11-21 21:46 ` markus dot heigl at fme dot fujitsu dot com
2007-11-22  9:39 ` markus dot heigl at fme dot fujitsu dot com
2007-11-22 12:32 ` rask at gcc dot gnu dot org
2007-11-22 12:51 ` markus dot heigl at fme dot fujitsu dot com
2007-11-22 13:54 ` rask at gcc dot gnu dot org
2007-11-22 15:59 ` markus dot heigl at fme dot fujitsu dot com
2007-11-23  1:33 ` rask at gcc dot gnu dot org
2007-11-23 13:46 ` rask at gcc dot gnu dot org
2007-11-23 17:10 ` patchapp at dberlin dot org
2007-11-26 13:20 ` rask at gcc dot gnu dot org
2007-11-28  1:44 ` rask at gcc dot gnu dot org
2007-11-28  1:56 ` rask 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).