diff options
author | Russ Cox <rsc@swtch.com> | 2008-07-31 15:41:54 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2008-07-31 15:41:54 -0400 |
commit | dce4cbabd1bbfa3a8acc05ae0b2c3a9df17f93d2 (patch) | |
tree | b92c4484313b16b37cd9943030262c78afa6103e /src/cmd/venti | |
parent | 17b19538a48c036dbdc8817d233c0086f327485c (diff) | |
download | plan9port-dce4cbabd1bbfa3a8acc05ae0b2c3a9df17f93d2.tar.gz plan9port-dce4cbabd1bbfa3a8acc05ae0b2c3a9df17f93d2.tar.bz2 plan9port-dce4cbabd1bbfa3a8acc05ae0b2c3a9df17f93d2.zip |
venti: work around gcc 4.3 bug (reported by Lucho Ionkov)
Diffstat (limited to 'src/cmd/venti')
-rw-r--r-- | src/cmd/venti/srv/icache.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/cmd/venti/srv/icache.c b/src/cmd/venti/srv/icache.c index bf61612c..7a528b68 100644 --- a/src/cmd/venti/srv/icache.c +++ b/src/cmd/venti/srv/icache.c @@ -15,7 +15,19 @@ struct ICache IHash *hash; IEntry *entries; int nentries; - IEntry free; + + /* + * gcc 4.3 inlines the pushfirst loop in initicache, + * but the inliner incorrectly deduces that + * icache.free.next has a constant value + * throughout the loop. (In fact, pushfirst + * assigns to it as ie->prev->next.) + * Marking it volatile should avoid this bug. + * The speed of linked list operations is dwarfed + * by the disk i/o anyway. + */ + volatile IEntry free; + IEntry clean; IEntry dirty; u32int maxdirty; |