Subject: GCC code generation...?
To: VAX porting list <>
From: Johnny Billquist <>
List: port-vax
Date: 08/06/2007 12:58:31
We've been told that gcc today is so much better than of old, which is why we 
should accept that it takes much longer to compile things today.

However, while trying to find why -current crashes, I found this code snippet:

netbsd:update_pcbs:     halt
netbsd:update_pcbs+0x1: halt
netbsd:update_pcbs+0x2: subl2   $4, sp
netbsd:update_pcbs+0x5: movl    4(ap), r2
netbsd:update_pcbs+0x9: movl    8(r2), r1
netbsd:update_pcbs+0xd: *beql   update_pcbs+0x50
netbsd:update_pcbs+0xf: movl    4(r1), r0
netbsd:update_pcbs+0x13:        movl    12(r2), 80(r0)
netbsd:update_pcbs+0x18:        movl    4(r1), r0
netbsd:update_pcbs+0x1c:        bisl3   $0x4000000, 16(r2), 84(r0)
netbsd:update_pcbs+0x26:        movl    4(r1), r0
netbsd:update_pcbs+0x2a:        movl    20(r2), 88(r0)
netbsd:update_pcbs+0x2f:        movl    4(r1), r0
netbsd:update_pcbs+0x33:        movl    24(r2), 92(r0)
netbsd:update_pcbs+0x38:        movl    (r1), r1
netbsd:update_pcbs+0x3b:        *bneq   update_pcbs+0xf

Notice how it reloads r0 with the same value several times. At +0xf, +0x18, 
+0x26 and +0x2f. What is going on here???

This is the while-loop in update_pcbs() in pmap.c. And ignore that beql at +0xd, 
that's been modified by me to hunt a bug.


Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email:             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol