[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to return markup conditionally?
From: |
David Kastrup |
Subject: |
Re: How to return markup conditionally? |
Date: |
Wed, 19 Jul 2023 23:22:57 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Jean Abou Samra <jean@abou-samra.fr> writes:
> Lol, now I understand.
>
> `module/language/cps/lower-primcalls.scm`:
>
> ```
> ;; precondition: pair is mutable pair
> (define-primcall-lowerer (set-car! cps k src #f (pair val))
> (with-cps cps
> (build-term
> ($continue k src
> ($primcall 'scm-set!/immediate '(pair . 0) (pair val))))))
> ```
>
>
> One of these lovely “optimizations” that the Guile developers are so
> fond of.
Frankly, one of the most annoying "optimisation" fights I had was with
GCC's standard library because the then-head-honcho insisted on keeping
"abort ()" marked as "no-return". Because it does not return.
What it does, however, is create a core dump with a stack trace, and
that stack trace is comparatively useless if the compiler gets to assume
that the stack can be treated as outdated trash anyway.
I debugged for half an eternity on a failed assertion because the failed
assertion pinpointed a call site that was not actually being used other
than some unrelated code jumping to its abort () call in order to save a
byte of instruction.
So why would one tell the compiler that it does not need to retain a
useful stack when generating a stack trace? Because the option is not
called "invalidate stack" but "no return".
In contrast, I find the optimisation that assumes that constants will
not be modified comparatively understandable. Without that assumption,
you'll never be able to fold multiple constants.
--
David Kastrup
- Re: How to return markup conditionally?, (continued)
- Re: How to return markup conditionally?, Jean Abou Samra, 2023/07/19
- Re: How to return markup conditionally?, Valentin Petzel, 2023/07/19
- Re: How to return markup conditionally?, Jean Abou Samra, 2023/07/19
- Re: How to return markup conditionally?, Valentin Petzel, 2023/07/19
- Re: How to return markup conditionally?, Trevor Bača, 2023/07/20
- Re: How to return markup conditionally?, Valentin Petzel, 2023/07/20
- Re: How to return markup conditionally?, Trevor Bača, 2023/07/21
- Re: How to return markup conditionally?, David Kastrup, 2023/07/20
- Re: How to return markup conditionally?, Trevor Bača, 2023/07/21
- Re: How to return markup conditionally?, Jean Abou Samra, 2023/07/19
- Re: How to return markup conditionally?,
David Kastrup <=
- Re: How to return markup conditionally?, Jean Abou Samra, 2023/07/19
- Re: How to return markup conditionally?, Jean Abou Samra, 2023/07/19