public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/8867: [sh] wrong code: double use of register
@ 2003-05-10 19:46 Dara Hazeghi
  0 siblings, 0 replies; 4+ messages in thread
From: Dara Hazeghi @ 2003-05-10 19:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR optimization/8867; it has been noted by GNATS.

From: Dara Hazeghi <dhazeghi@yahoo.com>
To: Marcus Comstedt <marcus@mc.pp.se>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: optimization/8867: [sh] wrong code: double use of register
Date: Sat, 10 May 2003 12:40:55 -0700 (PDT)

 --- Marcus Comstedt <marcus@mc.pp.se> wrote:
 > 
 > Dara Hazeghi <dhazeghi@yahoo.com> writes:
 > 
 > > So should we close this bug report, or does
 > further
 > > work need to be done on this issue? Thanks,
 > 
 > I think it should be ok to close it.
 > If future releases produce bad code, I can always
 > open new
 > tickets (like optimization/10392 :).
 
 Thanks,
 
 Dara
 
 __________________________________
 Do you Yahoo!?
 The New Yahoo! Search - Faster. Easier. Bingo.
 http://search.yahoo.com


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

* Re: optimization/8867: [sh] wrong code: double use of register
@ 2003-05-12 11:28 giovannibajo
  0 siblings, 0 replies; 4+ messages in thread
From: giovannibajo @ 2003-05-12 11:28 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, marcus, nobody

Synopsis: [sh] wrong code: double use of register

State-Changed-From-To: open->closed
State-Changed-By: bajo
State-Changed-When: Mon May 12 11:26:04 2003
State-Changed-Why:
    Reported as fixed by the submitter. Thanks!

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8867


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

* Re: optimization/8867: [sh] wrong code: double use of register
@ 2003-05-10 16:36 Marcus Comstedt
  0 siblings, 0 replies; 4+ messages in thread
From: Marcus Comstedt @ 2003-05-10 16:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR optimization/8867; it has been noted by GNATS.

From: Marcus Comstedt <marcus@mc.pp.se>
To: Dara Hazeghi <dhazeghi@yahoo.com>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: optimization/8867: [sh] wrong code: double use of register
Date: 10 May 2003 18:29:43 +0200

 Dara Hazeghi <dhazeghi@yahoo.com> writes:
 
 > code generated by 3.3:
 [...]
 > .L5:
 >          mov     #64,r1
 >          add     r14,r1
 >          mov.l   @(0,r1),r2
 >          mov.l   @(12,r1),r1  !
 >          add     r1,r2
 >          mov     #64,r1       *
 >          add     r14,r1       *
 >          mov.l   r2,@(0,r1)
 [...]
 
 This looks ok.  The offset in r1 is recomputed by the instructions I
 marked with * to compensate for the fact that the instruction marked !
 overwrites r1.
 
 
 > Code generated by 3.4:
 [...]
 > .L4:
 >          add     r10,r11
 [...]
 
 Here, gcc has made a completely different (probably much better)
 register allocation, so both x and l7 are allocated to registers.
 Since the stack accesses are gone, there is no way to tell whether the
 actual bug is still there or not, but the generated code looks ok at
 any rate.
 
 
   // Marcus
 
 


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

* Re: optimization/8867: [sh] wrong code: double use of register
@ 2003-05-10  9:16 Dara Hazeghi
  0 siblings, 0 replies; 4+ messages in thread
From: Dara Hazeghi @ 2003-05-10  9:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR optimization/8867; it has been noted by GNATS.

From: Dara Hazeghi <dhazeghi@yahoo.com>
To: gcc-gnats@gcc.gnu.org, marcus@mc.pp.se
Cc:  
Subject: Re: optimization/8867: [sh] wrong code: double use of register
Date: Sat, 10 May 2003 02:06:17 -0700

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit- 
 trail&database=gcc&pr=8867
 
 Hello,
 
 could the submitter please determine whether more current versions of  
 gcc (ie 3.3 prerelease) generate valid code? I checked with 3.2.3, but  
 the code it generated seems pretty much identical to the (wrong) code  
 generated by 3.2.1. With 3.3, I get something a bit different, and  
 mainline cvs gives something even more different. So if the submitter  
 could determine if those are correct, it would be greatly appreciated.  
 Thanks,
 
 Dara
 
 code generated by 3.3:
          .file   "junk.c"
          .text
          .text
          .align 1
          .global _foo
          .type   _foo, @function
 _foo:
          mov.l   r8,@-r15
          mov.l   r9,@-r15
          mov.l   r10,@-r15
          mov.l   r11,@-r15
          mov.l   r12,@-r15
          mov.l   r13,@-r15
          mov.l   r14,@-r15
          sts.l   pr,@-r15
          add     #-84,r15
          mov     r15,r14
          mov     #64,r0
          mov.l   r4,@(r0,r14)
          mov     r5,r13
          mov     r6,r12
          mov.l   @r12+,r0
          tst     r0,r0
          bt      .L3
 .L7:
          shll2   r0
          mov.l   .L9,r1
          mov.l   @(r0,r1),r1
          mov     #64,r2
          add     r14,r2
          mov.l   r1,@(4,r2)
          mov.l   .L10,r1
          mov.l   @(r0,r1),r8
          mov.l   .L11,r1
          mov.l   @(r0,r1),r10
          mov.l   .L12,r1
          mov.l   @(r0,r1),r11
          mov.l   .L13,r1
          mov.l   @(r0,r1),r1
          mov.l   r1,@(8,r2)
          mov.l   .L14,r1
          mov.l   @(r0,r1),r1
          mov.l   r1,@(12,r2)
          mov.l   @(4,r2),r1
          tst     r1,r1
          bt      .L5
          mov.l   @(0,r2),r4
          add     r11,r4
          mov     r13,r1
          add     r8,r1
          mov.l   r1,@(16,r2)
          mov.l   .L20,r2
          jsr     @r2
          mov     r1,r5
          mov     #64,r0
          mov.l   @(r0,r14),r9
          add     r8,r9
          mov.l   @(r0,r14),r8
          add     r10,r8
          mov     r9,r4
          mov.l   .L20,r2
          jsr     @r2
          mov     r8,r5
          mov     r9,r10
          add     r11,r10
          mov     r10,r4
          mov.l   .L20,r1
          jsr     @r1
          mov     r8,r5
          mov     #72,r0
          mov.l   @(r0,r14),r2
          add     r2,r8
          mov     r9,r4
          mov.l   .L20,r1
          jsr     @r1
          mov     r8,r5
          mov     r10,r4
          mov.l   .L20,r2
          jsr     @r2
          mov     r8,r5
          mov     #64,r1
          add     r14,r1
          mov.l   @(4,r1),r5
          add     r11,r5
          mov.l   .L20,r2
          jsr     @r2
          mov.l   @(16,r1),r4
 .L5:
          mov     #64,r1
          add     r14,r1
          mov.l   @(0,r1),r2
          mov.l   @(12,r1),r1
          add     r1,r2
          mov     #64,r1
          add     r14,r1
          mov.l   r2,@(0,r1)
          mov.l   @(12,r1),r2
          sub     r2,r13
          cmp/pl  r13
          bf      .L3
          mov.l   @r12+,r0
          tst     r0,r0
          bf      .L7
 .L3:
          add     #84,r14
          mov     r14,r15
          lds.l   @r15+,pr
          mov.l   @r15+,r14
          mov.l   @r15+,r13
          mov.l   @r15+,r12
          mov.l   @r15+,r11
          mov.l   @r15+,r10
          mov.l   @r15+,r9
          rts
          mov.l   @r15+,r8
 .L21:
          .align 2
 .L9:
          .long   _g1
 .L10:
          .long   _g3
 .L11:
          .long   _g4
 .L12:
          .long   _g5
 .L13:
          .long   _g6
 .L14:
          .long   _g7
 .L20:
          .long   _bar
          .size   _foo, .-_foo
          .ident  "GCC: (GNU) 3.3 20030509 (prerelease)"
 
 Code generated by 3.4:
          .file   "junk.c"
          .text
          .text
          .align 1
          .global _foo
          .type   _foo, @function
 _foo:
          mov.l   r8,@-r15
          mov.l   r9,@-r15
          mov.l   r10,@-r15
          mov.l   r11,@-r15
          mov.l   r12,@-r15
          mov.l   r13,@-r15
          mov.l   r14,@-r15
          sts.l   pr,@-r15
          add     #-88,r15
          mov     r15,r14
          mov     r4,r11
          mov     r5,r12
          mov     #64,r0
          mov     r6,r2
          add     #4,r2
          mov.l   r2,@(r0,r14)
          add     #-4,r2
          mov.l   @r2+,r0
 .L8:
          tst     r0,r0
          bt      .L3
          shll2   r0
          mov.l   .L9,r1
          mov.l   @(r0,r1),r1
          mov     #64,r2
          add     r14,r2
          mov.l   r1,@(4,r2)
          mov.l   .L10,r1
          mov.l   @(r0,r1),r8
          mov.l   .L11,r1
          mov.l   @(r0,r1),r1
          mov.l   r1,@(8,r2)
          mov.l   .L12,r1
          mov.l   @(r0,r1),r13
          mov.l   .L13,r1
          mov.l   @(r0,r1),r1
          mov.l   r1,@(12,r2)
          mov.l   .L14,r1
          mov.l   @(r0,r1),r10
          mov.l   @(4,r2),r1
          tst     r1,r1
          bt      .L4
          mov     r12,r1
          add     r8,r1
          mov.l   r1,@(16,r2)
          mov     r11,r4
          add     r13,r4
          mov.l   .L20,r2
          jsr     @r2
          mov     r1,r5
          mov     r11,r9
          add     r8,r9
          mov     #72,r0
          mov.l   @(r0,r14),r8
          add     r11,r8
          mov     r9,r4
          mov.l   .L20,r2
          jsr     @r2
          mov     r8,r5
          mov     r9,r2
          add     r13,r2
          mov     #84,r0
          mov.l   r2,@(r0,r14)
          mov     r2,r4
          mov.l   .L20,r1
          jsr     @r1
          mov     r8,r5
          mov     #76,r0
          mov.l   @(r0,r14),r2
          add     r2,r8
          mov     r9,r4
          mov.l   .L20,r1
          jsr     @r1
          mov     r8,r5
          mov     #84,r0
          mov.l   @(r0,r14),r4
          mov.l   .L20,r1
          jsr     @r1
          mov     r8,r5
          mov     #64,r2
          add     r14,r2
          mov.l   @(16,r2),r4
          mov.l   @(4,r2),r5
          mov.l   .L20,r1
          jsr     @r1
          add     r13,r5
 .L4:
          add     r10,r11
          sub     r10,r12
          cmp/pl  r12
          bf      .L3
          mov     #64,r0
          mov.l   @(r0,r14),r1
          add     #4,r1
          mov.l   r1,@(r0,r14)
          add     #-4,r1
          bra     .L8
          mov.l   @r1+,r0
          .align 1
 .L3:
          add     #88,r14
          mov     r14,r15
          lds.l   @r15+,pr
          mov.l   @r15+,r14
          mov.l   @r15+,r13
          mov.l   @r15+,r12
          mov.l   @r15+,r11
          mov.l   @r15+,r10
          mov.l   @r15+,r9
          rts
          mov.l   @r15+,r8
 .L21:
          .align 2
 .L9:
          .long   _g1
 .L10:
          .long   _g3
 .L11:
          .long   _g4
 .L12:
          .long   _g5
 .L13:
          .long   _g6
 .L14:
          .long   _g7
 .L20:
          .long   _bar
          .size   _foo, .-_foo
          .ident  "GCC: (GNU) 3.4 20030509 (experimental)"
 


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

end of thread, other threads:[~2003-05-12 11:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-10 19:46 optimization/8867: [sh] wrong code: double use of register Dara Hazeghi
  -- strict thread matches above, loose matches on Subject: below --
2003-05-12 11:28 giovannibajo
2003-05-10 16:36 Marcus Comstedt
2003-05-10  9:16 Dara Hazeghi

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).