tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] [ RFC] About packing two infos in a long v2


From: Thomas Preud'homme
Subject: Re: [Tinycc-devel] [ RFC] About packing two infos in a long v2
Date: Tue, 6 Nov 2012 17:27:36 +0100
User-agent: KMail/1.13.7 (Linux/3.2.0-4-amd64; KDE/4.8.4; x86_64; ; )

Le mardi 6 novembre 2012 16:37:21, Thomas Preud'homme a écrit :
> Le mardi 6 novembre 2012 16:22:00, Milutin Jovanović a écrit :

> Sure, I agree I don't like it. It create a risk of forgetting it for the
> future. But accessors or bitfield doesn't change anything. Bitfield needs
> to shift the value to the left for each use and accessors need to be used
> for each case. Someone reading tcc.h will be tempted to use the field
> immediately. At least bitfield makes it more clear to the compiler what's
> going on but it will not catch a mistake such has reading the value
> directly from got_offset.

I went with bit fields in the end. I also modified put_got_offset so that a 
value 
can be set twice. Although it's not needed now, put_got_offset could be used by 
someone in this way later on and that would lead to subtle bugs.

> > Small stylistic issue is that I (personally) don't like '& -2' mask. I
> > think this obfuscates the intent, and the simple '& ~1' is more usual,
> > and it should not be any slower. -2 also assumes two's complement
> > implementations...

Hence gone :)

I'll appreciate another review if you have time. Thanks again.

Thomas

Attachment: 0002-Generate-PLT-thumb-stub-only-when-necessary.patch
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]