struct accessors are not inlined even with declaimations
Qiantan Hong <qthong-FGKo4X94FMn2fBVCVOL8/[email protected]> Wed, 22 Jul 2026 08:33:26 +0000
| Newsgroups | gmane.lisp.ecl.general |
|---|---|
| Message-ID | <BY5PR02MB6771301D534DFCC14BD46E79BCC12@BY5PR02MB6771.namprd02.prod.outlook.com> |
--_000_BY5PR02MB6771301D534DFCC14BD46E79BCC12BY5PR02MB6771namp_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi there,
On Linux x86-64 ECL 26.5.5:
(declaim (optimize (speed 3) (safety 0) (debug 0))) ; to be "safe"
(declaim (inline point-x))
(defstruct point (x 0 :type fixnum))
(declaim (inline point-x)) ; to be safe...
(defun uses-accessor (p) (declare (type point p)) (point-x p))
uses-accessor still generates a FUNCALL after compile-file:
value0 =3D (cl_env_copy->function=3D(VV[9]->symbol.gfdef))->cfun.entry(1, v=
1p) /* POINT-X */;
Best,
k
--_000_BY5PR02MB6771301D534DFCC14BD46E79BCC12BY5PR02MB6771namp_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div style=3D"direction: ltr; font-family: Aptos, "Aptos_EmbeddedFont&=
quot;, "Aptos_MSFontService", Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
Hi there,</div>
<div style=3D"direction: ltr; font-family: Aptos, "Aptos_EmbeddedFont&=
quot;, "Aptos_MSFontService", Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
<br>
</div>
<div style=3D"direction: ltr; font-family: Aptos, "Aptos_EmbeddedFont&=
quot;, "Aptos_MSFontService", Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
On Linux x86-64 ECL 26.5.5:</div>
<div style=3D"direction: ltr; font-family: Aptos, "Aptos_EmbeddedFont&=
quot;, "Aptos_MSFontService", Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
<br>
</div>
<div style=3D"direction: ltr; font-family: Aptos, "Aptos_EmbeddedFont&=
quot;, "Aptos_MSFontService", Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
(declaim (optimize (speed 3) (safety 0) (debug 0))) ; to be "safe"=
;</div>
<div style=3D"direction: ltr; font-family: Aptos, "Aptos_EmbeddedFont&=
quot;, "Aptos_MSFontService", Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
(declaim (inline point-x))</div>
<div style=3D"direction: ltr; font-family: Aptos, "Aptos_EmbeddedFont&=
quot;, "Aptos_MSFontService", Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
(defstruct point (x 0 :type fixnum))</div>
<div style=3D"direction: ltr; font-family: Aptos, "Aptos_EmbeddedFont&=
quot;, "Aptos_MSFontService", Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
(declaim (inline point-x)) ; to be safe...</div>
<div style=3D"direction: ltr; font-family: Aptos, "Aptos_EmbeddedFont&=
quot;, "Aptos_MSFontService", Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
<br>
</div>
<div style=3D"direction: ltr; font-family: Aptos, "Aptos_EmbeddedFont&=
quot;, "Aptos_MSFontService", Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
(defun uses-accessor (p) (declare (type point p)) (point-x p))</div>
<div style=3D"direction: ltr; font-family: Aptos, "Aptos_EmbeddedFont&=
quot;, "Aptos_MSFontService", Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
<br>
</div>
<div style=3D"direction: ltr; font-family: Aptos, "Aptos_EmbeddedFont&=
quot;, "Aptos_MSFontService", Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
uses-accessor still generates a FUNCALL after compile-file:</div>
<div style=3D"direction: ltr; font-family: Aptos, "Aptos_EmbeddedFont&=
quot;, "Aptos_MSFontService", Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
value0 =3D (cl_env_copy->function=3D(VV[9]->symbol.gfdef))->cfun.e=
ntry(1, v1p) /* POINT-X */;</div>
<div style=3D"direction: ltr; font-family: Aptos, "Aptos_EmbeddedFont&=
quot;, "Aptos_MSFontService", Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
<br>
</div>
<div style=3D"direction: ltr; font-family: Aptos, "Aptos_EmbeddedFont&=
quot;, "Aptos_MSFontService", Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
Best,</div>
<div style=3D"direction: ltr; font-family: Aptos, "Aptos_EmbeddedFont&=
quot;, "Aptos_MSFontService", Calibri, Helvetica, sans-serif; fon=
t-size: 12pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
k</div>
</body>
</html>
--_000_BY5PR02MB6771301D534DFCC14BD46E79BCC12BY5PR02MB6771namp_--