[Pas2js] Disable optimization in specific units/blocks

silvioprog silvioprog at gmail.com
Thu Jan 10 23:31:25 CET 2019


Hello Mattias,

On Thu, Jan 10, 2019 at 6:58 PM Mattias Gaertner via Pas2js <
pas2js at lists.freepascal.org> wrote:
[...]

> Notes:
> Neither $PUSH, $POP nor the $optimizations directive is yet
> supported.
>

Thanks for answering. I didn't know about missing support for push/pop
directives. ☺

pas2js does not parse the asm block, so it has no idea what it uses.
>

You already alerted me (via mantis) about this compiler behavior regarding
asm blocks, but the compiler should provide some option to disable it in
specific units without disabling the entire compiler optimization.


> At the moment you must use some dummy code like "if false then
> reference..." to tell the compiler which identifiers are used.
>
> Mattias


Hm... thanks for suggesting, but I'll not use it. 😀 I'm looking for
optimizations, this workaround would grows the code.

It would be nice some keyword (e.g: *volatile*), directive and/or some
special comment like "{%no-optimize}" to disable the optimization in
specific unit parts. Any unconditional compiler behavior that removes
things from the programmer code maybe will cause serious problems in large
applications. Just my 2 cents.

--
Silvio Clécio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20190110/a8eade11/attachment.html>


More information about the Pas2js mailing list