From: David Mosberger-Tang <davidm@AZStarNet.com>
Subject: Re: new elf gcc patches
Date: Tue, 6 Aug 1996 00:20:38 -0700 [thread overview]
Message-ID: <199608060720.AAA02210@panda.azstarnet.com> (raw)
I think the snapshot gcc (I used 960707 or thereabouts) has some
serious trouble with subwords. E.g., for glibc
stdio-common/printf_fp.c:703, the snapshot gcc generates:
if (tolower (info->spec) == 'e')
0000000000001620 <__printf_fp..ng+1450> a43d0000 ldq t0,0(gp)
0000000000001624 <__printf_fp..ng+1454> a50f00b8 ldq t7,184(fp)
0000000000001628 <__printf_fp..ng+1458> a4210000 ldq t0,0(t0)
000000000000162c <__printf_fp..ng+145c> a0480008 ldl t1,8(t7)
0000000000001630 <__printf_fp..ng+1460> 40410441 s4addq t1,t0,t0
0000000000001634 <__printf_fp..ng+1464> a0210000 ldl t0,0(t0)
0000000000001638 <__printf_fp..ng+1468> a0e80004 ldl t6,4(t7)
000000000000163c <__printf_fp..ng+146c> 47ff040c clr s3
0000000000001640 <__printf_fp..ng+1470> b7ef0108 stq zero,264(fp
)
0000000000001644 <__printf_fp..ng+1474> 402cb521 subq t0,0x65,t0
0000000000001648 <__printf_fp..ng+1478> b4ef0100 stq t6,256(fp)
000000000000164c <__printf_fp..ng+147c> f4200010 bne t0,00000000
00001690 <__printf_fp..ng+14c0>
whereas gcc-2.7.2 generates:
if (tolower (info->spec) == 'e')
0000000000001640 <__printf_fp..ng+1470> a50f00b0 ldq t7,176(fp)
0000000000001644 <__printf_fp..ng+1474> 41011402 addq t7,0x8,t1
0000000000001648 <__printf_fp..ng+1478> 4440d101 andnot t1,0x6,t0
000000000000164c <__printf_fp..ng+147c> a47d0000 ldq t2,0(gp)
0000000000001650 <__printf_fp..ng+1480> a4810000 ldq t3,0(t0)
0000000000001654 <__printf_fp..ng+1484> 44403102 andnot t1,0x1,t1
0000000000001658 <__printf_fp..ng+1488> a4230000 ldq t0,0(t2)
000000000000165c <__printf_fp..ng+148c> 488202c4 extwl t3,t1,t3
0000000000001660 <__printf_fp..ng+1490> 40810441 s4addq t3,t0,t0
0000000000001664 <__printf_fp..ng+1494> a0210000 ldl t0,0(t0)
0000000000001668 <__printf_fp..ng+1498> a0e80004 ldl t6,4(t7)
000000000000166c <__printf_fp..ng+149c> 47ff040e clr s5
0000000000001670 <__printf_fp..ng+14a0> b7ef0108 stq zero,264(fp
)
0000000000001674 <__printf_fp..ng+14a4> 402cb521 subq t0,0x65,t0
0000000000001678 <__printf_fp..ng+14a8> b4ef0100 stq t6,256(fp)
000000000000167c <__printf_fp..ng+14ac> f4200010 bne t0,00000000
000016c0 <__printf_fp..ng+14f0>
Note that the former code loads info->spec (8(t7)) as an integer
_without_ masking out the highword! The gcc-2.7.2 code is quite a bit
longer, but also quite a bit more correct. I'm surprised we haven't
seen serious problems because of this (I do know that gs had tons of
unaligned accesses; maybe the same is also causing unaligned accesses
in ELF gdb).
--david
--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
next reply other threads:[~1996-08-06 7:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-08-06 7:20 David Mosberger-Tang [this message]
-- strict thread matches above, loose matches on Subject: below --
1996-08-05 7:50 new elf gcc patches Richard Henderson
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox