Re: patch for 2.1.55 pre-1 minix/sysv/affs

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Wed, 10 Sep 1997 10:34:07 +0200 (MET DST)


Bill Hawes wrote:
> + if (minix_set_bit(j,bh->b_data))
> + goto complain_and_out;
[...]
> +complain_and_out:
> + printk("new_inode: bit already set");
> +iput_and_out:
> + iput(inode);
> +out:
> + return NULL;

I hate this type of code, but for better cache-use, it is the faster way
to write the code.....

Would someone be interested in implementing

#pragma rarely_used

which would go inside an "if" statement, and cause gcc to do exactly
what Bill is doing up there by hand....

The new code would be:

if (minix_set_bit(j,bh->b_data)) {
#pragma rarely_used
printk("new_inode: bit already set");
iput(inode);
return NULL;
}

gcc currently generates

if not condition goto behind_if
[code for the if clause]
behind_if:

which in case of the pragma should become

if condition goto behind_everything_else
[rest of function]
ret
behind_everything_else:
[code for the if clause]

I'd hope that this isn't too hard to implement.... :-)

Roger.

-- 
** R.E.Wolff@BitWizard.nl ** +31-15-2137555 ** http://www.BitWizard.nl/ **
Florida -- A 39 year old construction worker woke up this morning when a
109-car freigt train drove over him. According to the police the man was 
drunk. The man himself claims he slipped while walking the dog. 080897