GNU bug report logs - #46847
28.0.50; [native-comp] assume pseudo-insns should be verified

Previous Next

Package: emacs;

Reported by: Pip Cet <pipcet <at> gmail.com>

Date: Mon, 1 Mar 2021 13:08:01 UTC

Severity: normal

Found in version 28.0.50

Done: Andrea Corallo <acorallo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Pip Cet <pipcet <at> gmail.com>
Subject: bug#46847: closed (Re: bug#46847: 28.0.50; [native-comp] assume
 pseudo-insns should be verified)
Date: Wed, 20 Mar 2024 09:34:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#46847: 28.0.50; [native-comp] assume pseudo-insns should be verified

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 46847 <at> debbugs.gnu.org.

-- 
46847: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46847
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Andrea Corallo <acorallo <at> gnu.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 46847-done <at> debbugs.gnu.org, Pip Cet <pipcet <at> gmail.com>
Subject: Re: bug#46847: 28.0.50; [native-comp] assume pseudo-insns should be
 verified
Date: Wed, 20 Mar 2024 05:30:04 -0400
I'm closing this old bug as with 0b0c7da8c80 I've installed a sanitizer
that instruments the code in order to check that compile time value
predictions of mvars are respected at runtime.  Mvars verified are all
mvars being tested by conditional branches, this to verify the correct
CFG/execution of the program.

Enabling sanitizer instrumentation and runtime verification I'm able to
bootstrap the compiler and run all the compiler testsuite.

We might extend this further in the future but I think for now is okay.

Thanks

  Andrea

[Message part 3 (message/rfc822, inline)]
From: Pip Cet <pipcet <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; [native-comp] assume pseudo-insns should be verified
Date: Mon, 1 Mar 2021 13:06:31 +0000
This is a wishlist item for the native-comp branch, though I consider
the feature in question to be so essential that its absence also
qualifies as a bug.

The native-comp branch is emitting assume pseudo-insns. Those come in
various forms, but their interpretation is clear: they express
conditions which are meant to hold at runtime, and which the compiler
may use to optimize code.

I would like to add an optional compiler pass which asserts that the
conditions are actually true at runtime. This is a basic safeguard
that any assume() mechanism should have, and it's perfectly equivalent
to the way eassume() becomes eassert() in debug builds of Emacs.

Unfortunately, it turns out that while adding the compiler pass is
easy, there are many failures because the assume pseudo-insns emitted
at present are inconsistent or plain wrong. Some of these wrong
assumes result in reproducible Lisp-to-native-code bugs today; others
will not; for still others, we're not sure.

For example, the four following bugs became a problem only because of
a lack of this safeguard: bug#46843 (both bugs), bug#46812, bug#46670.

Merging native-comp without such a safeguard would, I am convinced,
introduce preventable, tricky, unnecessary bugs into the Emacs master
branch.  We shouldn't do that.

Pip



This bug report was last modified 1 year and 145 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.