tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] nocode_wanted does not work


From: Edmund Grimley Evans
Subject: Re: [Tinycc-devel] nocode_wanted does not work
Date: Mon, 4 Apr 2016 08:06:54 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

> Is it possible to implement "undo" like in editors, i.e. save current 
> generated
> code state (output position) when nocode_wanted=1 and then restore it when
> nocode_wanted=0?

Perhaps, but you'd have to watch out for relocations. If you just
restored the code output position then you might end up with
relocations applying to completely the wrong code.

The other thing I worry about with nocode_wanted is register spilling:
if you just prevented code from being written during the parsing of a
nocode_wanted subexpression, or wrote it and then unwrote it, then
after the end of that subexpression the compiler might think a value
has been copied into a stack slot, because the value stack has been
updated, but the actual spill code was not generated. A bug like that
would be archicture-dependent and probably not immediately apparent.

> PS: The problem with the ({}) is exposed only with while()/for() inside it
> [cleardot]

Have you tried goto and switch, or return?

Edmund



reply via email to

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