public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/13585] New: Incorrect optimisation of call to sfunc
@ 2004-01-06 15:33 stuart dot menefy at st dot com
  2004-01-06 15:34 ` [Bug c/13585] " stuart dot menefy at st dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: stuart dot menefy at st dot com @ 2004-01-06 15:33 UTC (permalink / raw)
  To: gcc-bugs

The problem occurs when building the attached code. The command line
is:
   % sh4-linux-gcc -O2 -c pcm_params.i -fPIC -o pcm_params.lo       

The generated code for line 8252:
         tmp = *params;
which is a struct assignment, is:

gcc version 3.2 20020529 (experimental) / 3.2.1 20021022 (prerelease)
and 3.3.4:
        mov.l   .L22,r0
        mov     r14,r4
        mov.w   .L32,r7
        mov     r10,r5
        mov.l   @(r0,r12),r0
        mov     #74,r6
        add     r14,r7
        mov.l   r0,@(36,r7)
        jsr     @r7
        mov     r0,r7

The problem is that the compiler has migrated the "mov r0,r7" which sets
up the address to jump to, into the delay slot.

This problem is seen in SuperH's 3.2/3.2.1 compiler, and a 3.3.2
compiler, but not in a 3.4 snapshot, however this may just be a side
effect of slightly different optimisations.

-- 
           Summary: Incorrect optimisation of call to sfunc
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: stuart dot menefy at st dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: sh4-linux


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


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

end of thread, other threads:[~2004-01-27 13:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-06 15:33 [Bug c/13585] New: Incorrect optimisation of call to sfunc stuart dot menefy at st dot com
2004-01-06 15:34 ` [Bug c/13585] " stuart dot menefy at st dot com
2004-01-06 18:08 ` [Bug optimization/13585] " pinskia at gcc dot gnu dot org
2004-01-09 18:17 ` amylaar at gcc dot gnu dot org
2004-01-09 18:17 ` amylaar at gcc dot gnu dot org
2004-01-12 12:59 ` [Bug target/13585] " cvs-commit at gcc dot gnu dot org
2004-01-12 17:03 ` cvs-commit at gcc dot gnu dot org
2004-01-12 17:19 ` amylaar at gcc dot gnu dot org
2004-01-27 13:11 ` cvs-commit 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).