tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Partial revert of nocode_wanted patch


From: Thomas Preud'homme
Subject: Re: [Tinycc-devel] Partial revert of nocode_wanted patch
Date: Sat, 11 Apr 2015 21:57:26 +0800
User-agent: KMail/4.14.1 (Linux/3.16.0-4-amd64; KDE/4.14.2; x86_64; ; )

Le samedi 11 avril 2015, 15:54:45 Sergey Korshunoff a écrit :
> Hi!
> 
> > I don't mind people reverting my patch but this seems
> 
> like the wrong solution here
> 
> Sorry :-) I think I can introduce an option like -flinux-kernel-2426
> and then use this option to exclude/change code which breaks
> compilation of this code w/o affecting other usage cases.

It's not what I meant. I'm happy to see a fix to compile an old linux kernel. 
It's just that I think this is not the right place for a fix. nocode_wanted is 
there to indicate that we are out of a function and so generating code doesn't 
have any meaning. This suggest that nocode_wanted was set when it shouldn't 
have.

> 
> It is possible to reduce a test like a linux 2.4.26 kernel? I can
> replace -c by -E and then compile a big preprocessed source. But I
> don't know how to use creduce with this file.

The size of the file doesn't matter. creduce works by iteratively trying some 
valid transformation on the source and then running the script you specified it 
and see if it fails or not. Here the script would just look at the warning 
generated by tcc and return an exit code accordingly. If the file after 
reduction is still too big, try a few transformation yourself and try to 
reduce the result again. I've used it a few times and it works quite well.

> 
> PS: this version of the kernel is not a good one. 2.4.37 is better.
> But currently 2.4.26 is the only one which can be compiled by tcc.

What do you mean by "is not a good one"? Is the code totally invalid C? It all 
boils down to whether we want tcc to be able to compile such code. If yes, 
then it doesn't matter if the code is ugly or what.

Best regards,

Thomas

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


reply via email to

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