Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The man on tops walks a lonely street; the "chain" of command is often a noose.


devel / comp.arch / Re: addressing and protection, was Paper about ISO C

SubjectAuthor
* Paper about ISO Cclamky
+- Re: Paper about ISO CBGB
+* Re: Paper about ISO CDavid Brown
|+* Re: Paper about ISO CBGB
||+* Re: Paper about ISO CMitchAlsup
|||+* Re: Paper about ISO CMitchAlsup
||||`* Re: Paper about ISO CBranimir Maksimovic
|||| `* Re: Paper about ISO CGeorge Neuner
||||  +- Re: Paper about ISO CBranimir Maksimovic
||||  `* Re: Paper about ISO CEricP
||||   `* Re: Paper about ISO CIvan Godard
||||    `* Re: Paper about ISO CEricP
||||     `* Re: Paper about ISO CMitchAlsup
||||      +* Re: Paper about ISO CBGB
||||      |`* Re: Paper about ISO CStephen Fuld
||||      | +* Re: Paper about ISO CIvan Godard
||||      | |+* Re: addressing and protection, was Paper about ISO CJohn Levine
||||      | ||+* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |||+- Re: addressing and protection, was Paper about ISO CJohn Levine
||||      | |||+* Re: addressing and protection, was Paper about ISO CIvan Godard
||||      | ||||`- Re: addressing and protection, was Paper about ISO CQuadibloc
||||      | |||`- Re: addressing and protection, was Paper about ISO CBill Findlay
||||      | ||`* Re: addressing and protection, was Paper about ISO CQuadibloc
||||      | || +- Re: addressing and protection, was Paper about ISO CStephen Fuld
||||      | || `- Re: addressing and protection, was Paper about ISO CBranimir Maksimovic
||||      | |`* Re: addressing and protection, was Paper about ISO CEricP
||||      | | +* Re: addressing and protection, was Paper about ISO CStefan Monnier
||||      | | |`- Re: addressing and protection, was Paper about ISO CEricP
||||      | | `* Re: addressing and protection, was Paper about ISO CIvan Godard
||||      | |  +* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  |+* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  ||`* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  || `* Re: addressing and protection, was Paper about ISO CJohn Dallman
||||      | |  ||  +* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  ||  |+- Re: addressing and protection, was Paper about ISO CBGB
||||      | |  ||  |+* Re: addressing and protection, was Paper about ISO CThomas Koenig
||||      | |  ||  ||`* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  ||  || `* Re: addressing and protection, was Paper about ISO CAnton Ertl
||||      | |  ||  ||  `- Re: addressing and protection, was Paper about ISO CBGB
||||      | |  ||  |`* Re: addressing and protection, was Paper about ISO CQuadibloc
||||      | |  ||  | +- Re: addressing and protection, was Paper about ISO CQuadibloc
||||      | |  ||  | `- Re: addressing and protection, was Paper about ISO CBGB
||||      | |  ||  `- Re: addressing and protection, was Paper about ISO CBGB
||||      | |  |`* Re: addressing and protection, was Paper about ISO CJohn Dallman
||||      | |  | +* Re: addressing and protection, was Paper about ISO CThomas Koenig
||||      | |  | |`* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | | `* Re: addressing and protection, was Paper about ISO CThomas Koenig
||||      | |  | |  +* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |  |+* Re: addressing and protection, was Paper about ISO CStefan Monnier
||||      | |  | |  ||+- Re: addressing and protection, was Paper about ISO CChris M. Thomasson
||||      | |  | |  ||+* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |  |||`- Re: addressing and protection, was Paper about ISO CThomas Koenig
||||      | |  | |  ||+* Re: addressing and protection, was Paper about ISO CThomas Koenig
||||      | |  | |  |||`* Re: addressing and protection, was Paper about ISO CEricP
||||      | |  | |  ||| `- Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |  ||`- Re: addressing and protection, was Paper about ISO CJohn Dallman
||||      | |  | |  |`- Re: addressing and protection, was Paper about ISO CThomas Koenig
||||      | |  | |  `* Re: addressing and protection, was Paper about ISO CIvan Godard
||||      | |  | |   +- Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |   `* Re: addressing and protection, was Paper about ISO CStephen Fuld
||||      | |  | |    +* Address space consumption (was: addressing and protection, was Paper about ISO CStefan Monnier
||||      | |  | |    |`- Re: Address space consumption (was: addressing and protection, wasMitchAlsup
||||      | |  | |    +* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |    |`- Re: addressing and protection, was Paper about ISO CThomas Koenig
||||      | |  | |    `* Re: addressing and protection, was Paper about ISO CGeorge Neuner
||||      | |  | |     `* Re: addressing and protection, was Paper about ISO CStephen Fuld
||||      | |  | |      +* Re: addressing and protection, was Paper about ISO CMichael S
||||      | |  | |      |`* Re: addressing and protection, was Paper about ISO CTerje Mathisen
||||      | |  | |      | `- Re: addressing and protection, was Paper about ISO CMichael S
||||      | |  | |      `* Re: addressing and protection, was Paper about ISO CStefan Monnier
||||      | |  | |       +* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       |`* Re: addressing and protection, was Paper about ISO CJohn Levine
||||      | |  | |       | +* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |`* Re: addressing and protection, was Paper about ISO CStephen Fuld
||||      | |  | |       | | `* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |  `* Re: addressing and protection, was Paper about ISO CJohn Levine
||||      | |  | |       | |   +- Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |   +- Re: addressing and protection, was Paper about ISO Cclamky
||||      | |  | |       | |   `* Re: addressing and protection, was Paper about ISO CGeorge Neuner
||||      | |  | |       | |    +* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |    |`* Re: addressing and protection, was Paper about ISO CGeorge Neuner
||||      | |  | |       | |    | +* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |    | |+* Re: addressing and protection, was Paper about ISO CIvan Godard
||||      | |  | |       | |    | ||+* Re: educational computation, was addressing and protection, was Paper about ISO John Levine
||||      | |  | |       | |    | |||`* Re: educational computation, was addressing and protection, was PaperIvan Godard
||||      | |  | |       | |    | ||| `- Re: educational computation, was addressing and protection, was PaperTerje Mathisen
||||      | |  | |       | |    | ||`* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |    | || `* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |       | |    | ||  +- Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |    | ||  `- Re: addressing and protection, was Paper about ISO CDavid Brown
||||      | |  | |       | |    | |+- Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |    | |`* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |       | |    | | +* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |    | | |+- Re: addressing and protection, was Paper about ISO CIvan Godard
||||      | |  | |       | |    | | |`* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |       | |    | | | +* Re: addressing and protection, was Paper about ISO CIvan Godard
||||      | |  | |       | |    | | | |+* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |       | |    | | | ||`- Re: addressing and protection, was Paper about ISO CJimBrakefield
||||      | |  | |       | |    | | | |`* Re: addressing and protection, was Paper about ISO CTerje Mathisen
||||      | |  | |       | |    | | | | `* Re: addressing and protection, was Paper about ISO CTim Rentsch
||||      | |  | |       | |    | | | |  `- Re: addressing and protection, was Paper about ISO CTerje Mathisen
||||      | |  | |       | |    | | | +* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |    | | | `- Re: addressing and protection, was Paper about ISO CTerje Mathisen
||||      | |  | |       | |    | | `- Re: addressing and protection, was Paper about ISO CAnne & Lynn Wheeler
||||      | |  | |       | |    | `- Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |       | |    `* Re: what is cheap these days, addressing and protection, was Paper about ISO CJohn Levine
||||      | |  | |       | +* Re: addressing and protection, was Paper about ISO CStephen Fuld
||||      | |  | |       | +* Re: addressing and protection, was Paper about ISO CMichael S
||||      | |  | |       | `* Re: addressing and protection, was Paper about ISO CMichael S
||||      | |  | |       +* RAM size (was: addressing and protection, was Paper about ISO C)Anton Ertl
||||      | |  | |       `- Re: addressing and protection, was Paper about ISO CTerje Mathisen
||||      | |  | +* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | `* Re: addressing and protection, was Paper about ISO CJohn Levine
||||      | |  +* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  `* Re: addressing and protection, was Paper about ISO CJohn Levine
||||      | `* Re: Paper about ISO CBGB
||||      `- Re: Paper about ISO CEricP
|||+* Re: Paper about ISO CBranimir Maksimovic
|||+* Re: Paper about ISO CThomas Koenig
|||+* Re: Paper about ISO Cantispam
|||`- Re: Paper about ISO CQuadibloc
||+* Re: Paper about ISO CThomas Koenig
||`* Re: Paper about ISO CDavid Brown
|+* Re: Paper about ISO CThomas Koenig
|`* Re: Paper about ISO CVictor Yodaiken
`* Re: Paper about ISO CKent Dickey

Pages:123456789101112131415161718192021222324252627282930313233
Re: Paper about ISO C

<sl8r6n$ifk$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21628&group=comp.arch#21628

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Tue, 26 Oct 2021 14:09:59 +0200
Organization: A noiseless patient Spider
Lines: 57
Message-ID: <sl8r6n$ifk$1@dont-email.me>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl79bl$jei$1@dont-email.me> <itpou1Fa8stU1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 26 Oct 2021 12:10:00 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="fa9dd796f275214ccb741419f69175be";
logging-data="18932"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Cq1CcEWIhZhejjx+tBCbKXQgblB+VSGo="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:vTZS5OvUPJLtnaBffXEANCmEy+Q=
In-Reply-To: <itpou1Fa8stU1@mid.individual.net>
Content-Language: en-GB
 by: David Brown - Tue, 26 Oct 2021 12:09 UTC

On 26/10/2021 09:26, Niklas Holsti wrote:
> On 2021-10-26 0:59, David Brown wrote:
>
>> I can only really think of two remaining situation where people could
>> reasonably assume certain behaviour, but it is not actually guaranteed
>> by the standards or the compiler - boundary points between functions,
>> and boundary points across compilation units.
>>
>> Some people assume that functions are compiled independently, and this
>> enforces ordering on execution, memory accesses, etc.  They think that
>> if a function calls another function, then that call acts like a memory
>> barrier of some sort.  But of course that is not the case -
>
>
> These discussions of volatile, and execution order wrt timing, gave me
> an idea: perhaps C (and other languages) should allow marking functions
> (subprograms) as "volatile", with the meaning that all of the effects of
> a call of that function (including use of processor time) should be
> ordered as volatile accesses are ordered, with respect to other volatile
> accesses.
>
> For example, if x and y are volatile variables, and foo is a volatile
> function, then in this code
>
>    x = 1;
>    foo ();
>    y = 1;
>
> we would be sure that all effects and all dynamic resource usage of the
> foo() call would occur between the assignments to x and to y.
>
> A more flexible approach would be to mark selected function calls as
> volatile, in the same way that C allows in-line use of
> pointer-to-volatile to force a volatile access to an object that is not
> itself marked volatile. Something like:
>
>    x = 1;
>    (volatile) foo ();
>    y = 1;
>
> Are volatile functions and/or volatile function calls a good idea?

That is an interesting idea. It would, I think, be feasible for such a
"volatile" function to consider each read and write it does as though it
was a volatile access. But what about other code that it might call -
should "volatile" be recursive here? And what would it really mean to
say that "processor time" is also ordered? I agree that sometimes it is
useful to try and control the points where work is done (such as
ensuring calculations are done outside of a critical section when
possible), but I think it would be hard to get a good definition and
specification of how these volatile functions would work.

I suspect this would need a lot of effort to develop into something
rigorous and definable. But the end result could definitely have its uses.

Re: Paper about ISO C

<jwvilxkrm73.fsf-monnier+comp.arch@gnu.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21630&group=comp.arch#21630

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: monn...@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Tue, 26 Oct 2021 08:54:06 -0400
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <jwvilxkrm73.fsf-monnier+comp.arch@gnu.org>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me>
<jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me>
<2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl79bl$jei$1@dont-email.me>
<jwvh7d4twhd.fsf-monnier+comp.arch@gnu.org>
<sl8a91$ul2$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="ddf27eb5cba67a29c2eeb71d25e12f01";
logging-data="32643"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX195alvoNVHZNZ5YJSheRaSZ"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Cancel-Lock: sha1:96AwLt2Pg0EoXxoiKY7Ohd5IA3g=
sha1:CnbyZ+w+zIS23t77mnh2pGkIsmE=
 by: Stefan Monnier - Tue, 26 Oct 2021 12:54 UTC

>> Such code is rare and we can mostly make it work with current compilers,
>> but it would be nice to have some way to tell the compiler that this is
>> UB-on-purpose and hence optimizations shouldn't presume that UB is
>> impossible on that code.
> That can't happen, in general.

Only if you take it as a hypothesis.
It can definitely happen if the question is "how" rather than "if".

Stefan

Re: Paper about ISO C

<jwvcznsrlmn.fsf-monnier+comp.arch@gnu.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21631&group=comp.arch#21631

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: monn...@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Tue, 26 Oct 2021 08:59:31 -0400
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <jwvcznsrlmn.fsf-monnier+comp.arch@gnu.org>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me>
<jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me>
<2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl8m0n$ipt$1@newsreader4.netcologne.de>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="ddf27eb5cba67a29c2eeb71d25e12f01";
logging-data="32643"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19N2ZT46eE4gEbpDjygADp/"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Cancel-Lock: sha1:wGRfMb2Z1A1twopOakcVbEka+L8=
sha1:2riMLG6j7LzO4dHdvWAYRVfliOI=
 by: Stefan Monnier - Tue, 26 Oct 2021 12:59 UTC

Thomas Koenig [2021-10-26 10:41:27] wrote:
> Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
>> Currently Gforth's configure.ac checks whether the C compiler
>> understands the following flags (and uses all those that the C
>> compiler understands):
>>
>> -fno-gcse
>> -fcaller-saves
>> -fno-defer-pop
>> -fno-inline
>> -fwrapv
>> -fchar-unsigned
>> -fno-strict-aliasing
>> -fno-cse-follow-jumps
>> -fno-reorder-blocks
>> -fno-reorder-blocks-and-partition
>> -fno-toplevel-reorder
>> -fno-trigraphs
>> -falign-labels=1
>> -falign-loops=1
>> -falign-jumps=1
>> -fno-delete-null-pointer-checks
>
> Wow.
[...]
> -fno-inline can be a performance killer if people prefer static
> inline functions, which are type-safe and evaluate their arguments
> only once over macros.

You have to understand that the above is used for a Forth compiler which
generates C code internally. So of course, most of the relevant
optimizations are performed by the Forth compiler and aren't needed or
even desired from the C compiler.

The C compiler only needs to do the architecture-dependent part of
optimizations, like register allocation, instruction selection, and
a bit of code scheduling.

Stefan

Re: Use Rust instead? (Was Re: Paper about ISO C)

<jwv7de0rl9a.fsf-monnier+comp.arch@gnu.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21632&group=comp.arch#21632

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: monn...@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.arch
Subject: Re: Use Rust instead? (Was Re: Paper about ISO C)
Date: Tue, 26 Oct 2021 09:08:34 -0400
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <jwv7de0rl9a.fsf-monnier+comp.arch@gnu.org>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me>
<jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<2021Oct23.192433@mips.complang.tuwien.ac.at>
<sl3m7f$11am$1@gioia.aioe.org>
<2021Oct25.181949@mips.complang.tuwien.ac.at>
<sl8mhp$ipt$4@newsreader4.netcologne.de>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="ddf27eb5cba67a29c2eeb71d25e12f01";
logging-data="32643"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18rGUjudnDMeFLy5bI6/slO"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Cancel-Lock: sha1:GSCI+cQpEJj5z/xCpLr1y822uKA=
sha1:783MdneRlCt0+EVUGQ96diyG5lQ=
 by: Stefan Monnier - Tue, 26 Oct 2021 13:08 UTC

> In general, I am in favor of languages which lets me do things I
> cannot do in other languages. I am less a fan of languages which
> try to educate me what to use and not to use.

Every time a language allows X, it inevitably prevents you from
doing the things which depend on X never happening.

And vice versa, when a language disallows X, it allows you to do things
that depend on knowing that X will never happen.

So whether X "lets me do things I cannot do in other languages" or
whether it "try to educate me what to use and not to use" is largely
a question of perspective.

Stefan

Re: Paper about ISO C

<sl9359$e89$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21633&group=comp.arch#21633

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Tue, 26 Oct 2021 16:25:44 +0200
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <sl9359$e89$1@dont-email.me>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl79bl$jei$1@dont-email.me> <jwvh7d4twhd.fsf-monnier+comp.arch@gnu.org>
<sl8a91$ul2$1@dont-email.me> <jwvilxkrm73.fsf-monnier+comp.arch@gnu.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Oct 2021 14:25:45 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="fa9dd796f275214ccb741419f69175be";
logging-data="14601"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19CAR1Ze9BHTCt+aESgnpbaIl0TVxD37xs="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:u7a/+XmsFNR5lw/UOOfbqW/ejvE=
In-Reply-To: <jwvilxkrm73.fsf-monnier+comp.arch@gnu.org>
Content-Language: en-GB
 by: David Brown - Tue, 26 Oct 2021 14:25 UTC

On 26/10/2021 14:54, Stefan Monnier wrote:
>>> Such code is rare and we can mostly make it work with current compilers,
>>> but it would be nice to have some way to tell the compiler that this is
>>> UB-on-purpose and hence optimizations shouldn't presume that UB is
>>> impossible on that code.
>> That can't happen, in general.
>
> Only if you take it as a hypothesis.
> It can definitely happen if the question is "how" rather than "if".
>

/Please/ follow standard Usenet attributions when quoting other people's
posts. It is simply common courtesy, and makes threads a lot easier to
follow.

I gave an example of UB in C for which it makes no sense to talk about a
compiler not presuming it can't happen. I could give more (many, many
more), but one is sufficient to make my point.

If you want to stop the compiler doing something you don't like, you
have to specify what that is, and you have to specify what you want it
to do.

Re: Paper about ISO C

<sl937s$e89$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21635&group=comp.arch#21635

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Tue, 26 Oct 2021 16:27:08 +0200
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <sl937s$e89$2@dont-email.me>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl8m0n$ipt$1@newsreader4.netcologne.de>
<jwvcznsrlmn.fsf-monnier+comp.arch@gnu.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Oct 2021 14:27:08 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="fa9dd796f275214ccb741419f69175be";
logging-data="14601"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18IUrmqpmoJYqs8IVo03w4DpSyyIkTkY1g="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:b936LC+FPFsv8Q+eP1GqSJ+0ee4=
In-Reply-To: <jwvcznsrlmn.fsf-monnier+comp.arch@gnu.org>
Content-Language: en-GB
 by: David Brown - Tue, 26 Oct 2021 14:27 UTC

On 26/10/2021 14:59, Stefan Monnier wrote:
> Thomas Koenig [2021-10-26 10:41:27] wrote:
>> Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
>>> Currently Gforth's configure.ac checks whether the C compiler
>>> understands the following flags (and uses all those that the C
>>> compiler understands):
>>>
>>> -fno-gcse
>>> -fcaller-saves
>>> -fno-defer-pop
>>> -fno-inline
>>> -fwrapv
>>> -fchar-unsigned
>>> -fno-strict-aliasing
>>> -fno-cse-follow-jumps
>>> -fno-reorder-blocks
>>> -fno-reorder-blocks-and-partition
>>> -fno-toplevel-reorder
>>> -fno-trigraphs
>>> -falign-labels=1
>>> -falign-loops=1
>>> -falign-jumps=1
>>> -fno-delete-null-pointer-checks
>>
>> Wow.
> [...]
>> -fno-inline can be a performance killer if people prefer static
>> inline functions, which are type-safe and evaluate their arguments
>> only once over macros.
>
> You have to understand that the above is used for a Forth compiler which
> generates C code internally. So of course, most of the relevant
> optimizations are performed by the Forth compiler and aren't needed or
> even desired from the C compiler.
>
> The C compiler only needs to do the architecture-dependent part of
> optimizations, like register allocation, instruction selection, and
> a bit of code scheduling.
>
>
> Stefan
>

I am not clear here whether these are flags used when compiling the
Gforth transpiler tool, or whether they are flags used when compiling
the output of Gforth. These are two /very/ different situations.

Re: Paper about ISO C

<8f6f1f13-9cbc-4142-ba79-8a0eba101523n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21636&group=comp.arch#21636

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:5f82:: with SMTP id j2mr25038789qta.35.1635258851593;
Tue, 26 Oct 2021 07:34:11 -0700 (PDT)
X-Received: by 2002:a05:6830:1e27:: with SMTP id t7mr8244453otr.96.1635258851326;
Tue, 26 Oct 2021 07:34:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 26 Oct 2021 07:34:11 -0700 (PDT)
In-Reply-To: <jwvh7d4twhd.fsf-monnier+comp.arch@gnu.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:3057:4708:a7d0:a797;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:3057:4708:a7d0:a797
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com> <sk437c$672$1@dont-email.me>
<jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org> <2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org> <5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me> <5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl79bl$jei$1@dont-email.me> <jwvh7d4twhd.fsf-monnier+comp.arch@gnu.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8f6f1f13-9cbc-4142-ba79-8a0eba101523n@googlegroups.com>
Subject: Re: Paper about ISO C
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Tue, 26 Oct 2021 14:34:11 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 60
 by: MitchAlsup - Tue, 26 Oct 2021 14:34 UTC

On Monday, October 25, 2021 at 8:30:43 PM UTC-5, Stefan Monnier wrote:
> David Brown [2021-10-25 23:59:16] wrote:
> > On 25/10/2021 19:58, Anton Ertl wrote:
> >> David Brown <david...@hesbynett.no> writes:
> >>> On 23/10/2021 15:56, Quadibloc wrote:
> >>>> and nothing is preventing them from taking the last version
> >>>> of gcc they liked, and maintaining it themselves. They could
> >>>> even issue a language standard for a language which they
> >>>> could call CC (for "Classic C") or something.
> >>>
> >>> Actually, the gcc folks already did that for the "other side". They
> >>> added the "-fwrapv" flag, and the "-fno-strict-aliasing" flag, and the
> >>> "-fno-delete-null-pointer-checks" flag, and probably others.
> >>
> >> There's the rub. With the "probably others" you cannot use the
> >> supposed successor of the known-working gcc as a drop-in replacement,
> >> because the supposed successor may fail to work with the old flags.
> >
> > Actually, you /can/ - you do so by writing code that has defined
> > behaviour (defined by the C standard, target ABI, compiler
> > documentation, etc.).
<
> Sometimes it's not an option. To mention an example I brought up here
> a few times, AFAIK you can't write code which scans the stack.
<
What valid programming example fits the description "Scan the stack" ?
<
> This is inherently an operation whose result can't be strictly defined
> by the standard, but the problem is that it means you're necessarily at
> the mercy of the compiler.
<
Stacks are allowed to grow upwards and downwards. How do you get the
++ or -- correct on both ?
>
> Such code is rare and we can mostly make it work with current compilers,
<
Still waiting for a valid example.
<
> but it would be nice to have some way to tell the compiler that this is
> UB-on-purpose and hence optimizations shouldn't presume that UB is
> impossible on that code.
<
-O0
>
> Of course, that won't be sufficient to give the code a meaningful and
> reliable semantics: after all, the compiler may decide to use multiple
> stacks,
<
Or a cactus stack, or a liked list which is malloc-ed each frame.
<
> divided into multiple small chunks, and it may decide to
> represent its stack in any kind of creative way. These are really
> fundamentally "undefined" and inherently depend on the compiler's
> internals. But being able to write the loop that scans between the two
> pointers which we think represent the top and bottom of the stack would
> be a good step.
<
Why are you walking the stack ?
>
>
> Stefan

Re: Specifying timing constraints was Re: Paper about ISO C

<a7a2f5d1-d39a-4493-8b37-da3a41ad64ffn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21637&group=comp.arch#21637

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:622a:11d6:: with SMTP id n22mr25360754qtk.337.1635258992860;
Tue, 26 Oct 2021 07:36:32 -0700 (PDT)
X-Received: by 2002:a05:6830:90b:: with SMTP id v11mr19814462ott.254.1635258992645;
Tue, 26 Oct 2021 07:36:32 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 26 Oct 2021 07:36:32 -0700 (PDT)
In-Reply-To: <d056984b-4bed-479c-b2ff-b67914f8b65cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:3057:4708:a7d0:a797;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:3057:4708:a7d0:a797
References: <87fstdumxd.fsf@hotmail.com> <afb9352d-8ba7-4521-b741-280e0206e255n@googlegroups.com>
<3a350cfe-971c-4042-9171-9ec2516cdf2bn@googlegroups.com> <sk6s4a$9cm$1@dont-email.me>
<1ed391dc-0d1d-4069-96d8-e83acbe01ba5n@googlegroups.com> <sk9ej9$fj9$1@dont-email.me>
<jwvtuhj4dlq.fsf-monnier+comp.arch@gnu.org> <skc7a9$698$1@dont-email.me>
<skc905$85c$1@dont-email.me> <skh20o$ji2$1@dont-email.me> <4fc4f707-2d42-492a-bd41-f791141dbfb2n@googlegroups.com>
<skhjk3$9p4$1@dont-email.me> <f9db2e75-2ec2-4572-b211-a8b2d6b3e0e6n@googlegroups.com>
<skjkqv$nd3$1@dont-email.me> <0ba079c3-d672-47b3-b86d-cfc74520ca5dn@googlegroups.com>
<86a6j6l8ci.fsf@linuxsc.com> <LClbJ.602$xjIc.241@fx01.iad>
<skl12c$i1n$1@dont-email.me> <qgDbJ.3$in7.0@fx22.iad> <skn1iv$ap3$1@dont-email.me>
<skn3ib$ouk$1@dont-email.me> <86ilxnii8c.fsf@linuxsc.com> <sl20bg$uha$1@dont-email.me>
<sl32ot$qn1$1@newsreader4.netcologne.de> <d056984b-4bed-479c-b2ff-b67914f8b65cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a7a2f5d1-d39a-4493-8b37-da3a41ad64ffn@googlegroups.com>
Subject: Re: Specifying timing constraints was Re: Paper about ISO C
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Tue, 26 Oct 2021 14:36:32 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 92
 by: MitchAlsup - Tue, 26 Oct 2021 14:36 UTC

On Tuesday, October 26, 2021 at 12:57:07 AM UTC-5, Quadibloc wrote:
> On Sunday, October 24, 2021 at 1:42:23 AM UTC-6, Thomas Koenig wrote:
> > Ivan Godard <iv...@millcomputing.com> schrieb:
> > > The lit history is full of efforts to put units into the type systems..
> > > They sure look plausible but don't work. Think of a NR sqrt routine.
>
> > MathCad has got this right. It is not a compiled language,
> > but it certainly works. I use it a lot in my day job for simple
> > engineering calculations: You see the formulas, you immediately
> > see the output, you do input in units (like kg/h), you can convert
> > the output to units you want.
> >
> > And, of course, it complains if you try to add or subtract
> > dimensions that do not match.
> >
> > (Notice I said "dimensions" in the last sentence - adding an inch
> > to a meter is fine, because both get converted automatically,
> > but adding a meter to a second is an error. Nomenclature:
> > Length is a dimension, meter or inch are units, of length
> > in this case).
> >
> > It even handles square roots of units and dimensions, which
> > are sometimes used, as characteristics of distillations colums,
> > for example.
> >
> > It handles units and dimensions as floating point numbers.
> > For dimensions, using rational numbers would probably be better.
>
> This is interesting; I am glad to hear that a language is available
> that can handle physical quantities with units correctly, thus
> reducing problems created by mistakes in dimensional analysis
> by the programmer.
>
> And given that statement of the _benefit_ of doing this, I think
> that one _could_ in a compiled language flag floating-point
> quantities with units, so that the compiler would give an error or
> warning if incorrect arithmetic operations were specified with them.
>
> This reminds me: on my web site, in my description of a
> proposed language, I've proposed an extension to the type
> system for languages like FORTRAN that are used for numerical
> computation.
>
> The language is based on one I'd come up with many years ago
> back when I was a student in University. It was basically a fancy
> Fortran with additional ease of use features.
>
> So if A, B, and C are arrays, one could write A=B+C or A=B*C
> instead of having to write a DO loop.
>
> I spoke to someone else about it, and I noted that A=B*C was
> element-by-element, not matrix multiplication, in response to
> a question. The other fellow thought I was being too slavish
> in following APL.
>
> I thought about the matter further.
>
> I felt I _was_ right in handling _arrays_ that way. Making matrix
> multiplication the default for multiplying arrays was giving
> inappropriate semantic content to the notion of an array.
>
> But I felt the other fellow had a point too. Matrix multiplication
> is important in scientific and engineering computation.
>
> So I came up with what was, to me, a solution.
>
> In FORTRAN, there is a COMPLEX data type. In my language,
> I had already added, as an obvious extension, a QUATERNION
> data type.
>
> Well, then.
>
> What about a MATRIX data type?
>
> Given that a MATRIX would bind an a x b grid of scalar
<
This is the correct solution
* is element by element
× is matrix multiply
<
> elements into a *mathematical object* which would be
> subject to special rules and operations, whereas a two-dimensional
> array is just a plain collection of things, you can have an array of
> matrices, but *not* a matrix of arrays (basically for the same
> reason you can't have a complex number whose real and imaginary
> parts are each an array with the same dimensions).
>
> This makes sense to me, but apparently to no one else, as it
> has yet to catch the world by storm.
>
> John Savard

Re: Specifying timing constraints was Re: Paper about ISO C

<316bf26c-5a00-45ca-b58e-652455e2659dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21638&group=comp.arch#21638

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:17a9:: with SMTP id ay41mr19403822qkb.452.1635259146078;
Tue, 26 Oct 2021 07:39:06 -0700 (PDT)
X-Received: by 2002:a9d:764c:: with SMTP id o12mr20370810otl.129.1635259145878;
Tue, 26 Oct 2021 07:39:05 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 26 Oct 2021 07:39:05 -0700 (PDT)
In-Reply-To: <sl86pl$bgi$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:3057:4708:a7d0:a797;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:3057:4708:a7d0:a797
References: <87fstdumxd.fsf@hotmail.com> <afb9352d-8ba7-4521-b741-280e0206e255n@googlegroups.com>
<3a350cfe-971c-4042-9171-9ec2516cdf2bn@googlegroups.com> <sk6s4a$9cm$1@dont-email.me>
<1ed391dc-0d1d-4069-96d8-e83acbe01ba5n@googlegroups.com> <sk9ej9$fj9$1@dont-email.me>
<jwvtuhj4dlq.fsf-monnier+comp.arch@gnu.org> <skc7a9$698$1@dont-email.me>
<skc905$85c$1@dont-email.me> <skh20o$ji2$1@dont-email.me> <4fc4f707-2d42-492a-bd41-f791141dbfb2n@googlegroups.com>
<skhjk3$9p4$1@dont-email.me> <f9db2e75-2ec2-4572-b211-a8b2d6b3e0e6n@googlegroups.com>
<skjkqv$nd3$1@dont-email.me> <0ba079c3-d672-47b3-b86d-cfc74520ca5dn@googlegroups.com>
<86a6j6l8ci.fsf@linuxsc.com> <LClbJ.602$xjIc.241@fx01.iad>
<skl12c$i1n$1@dont-email.me> <qgDbJ.3$in7.0@fx22.iad> <skn1iv$ap3$1@dont-email.me>
<skn3ib$ouk$1@dont-email.me> <86ilxnii8c.fsf@linuxsc.com> <sl20bg$uha$1@dont-email.me>
<sl32ot$qn1$1@newsreader4.netcologne.de> <sl86pl$bgi$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <316bf26c-5a00-45ca-b58e-652455e2659dn@googlegroups.com>
Subject: Re: Specifying timing constraints was Re: Paper about ISO C
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Tue, 26 Oct 2021 14:39:06 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 36
 by: MitchAlsup - Tue, 26 Oct 2021 14:39 UTC

On Tuesday, October 26, 2021 at 1:21:43 AM UTC-5, Stephen Fuld wrote:
> On 10/24/2021 12:42 AM, Thomas Koenig wrote:
> > Ivan Godard <iv...@millcomputing.com> schrieb:
> >
> >> The lit history is full of efforts to put units into the type systems.
> >> They sure look plausible but don't work. Think of a NR sqrt routine.
> >
> > MathCad has got this right. It is not a compiled language,
> > but it certainly works. I use it a lot in my day job for simple
> > engineering calculations: You see the formulas, you immediately
> > see the output, you do input in units (like kg/h), you can convert
> > the output to units you want.
> >
> > And, of course, it complains if you try to add or subtract
> > dimensions that do not match.
<
> What happens if you multiply two variables with dimension "length"
> together? Does it understand that the result is an "area"?
<
What happens when you multiply 1 width by 1 height ? you get an
Area. But if you multiply 1 vector length by a second vector length
you get a×b×cos(angle(a,b)).
<
If you are going this far--get it right !
<
> And that is
> a simple case. You can get far more complex combinations than that. It
> seems to me that this could be a nearly bottomless pit.
>
>
>
> --
> - Stephen Fuld
> (e-mail address disguised to prevent spam)

Re: Specifying timing constraints was Re: Paper about ISO C

<drVdJ.292$831.190@fx40.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21640&group=comp.arch#21640

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx40.iad.POSTED!not-for-mail
From: ThatWoul...@thevillage.com (EricP)
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
Newsgroups: comp.arch
Subject: Re: Specifying timing constraints was Re: Paper about ISO C
References: <87fstdumxd.fsf@hotmail.com> <sk6s4a$9cm$1@dont-email.me> <1ed391dc-0d1d-4069-96d8-e83acbe01ba5n@googlegroups.com> <sk9ej9$fj9$1@dont-email.me> <jwvtuhj4dlq.fsf-monnier+comp.arch@gnu.org> <skc7a9$698$1@dont-email.me> <skc905$85c$1@dont-email.me> <skh20o$ji2$1@dont-email.me> <4fc4f707-2d42-492a-bd41-f791141dbfb2n@googlegroups.com> <skhjk3$9p4$1@dont-email.me> <f9db2e75-2ec2-4572-b211-a8b2d6b3e0e6n@googlegroups.com> <skjkqv$nd3$1@dont-email.me> <0ba079c3-d672-47b3-b86d-cfc74520ca5dn@googlegroups.com> <86a6j6l8ci.fsf@linuxsc.com> <LClbJ.602$xjIc.241@fx01.iad> <skl12c$i1n$1@dont-email.me> <qgDbJ.3$in7.0@fx22.iad> <skn1iv$ap3$1@dont-email.me> <skn3ib$ouk$1@dont-email.me> <86ilxnii8c.fsf@linuxsc.com> <itkgveFa1f5U1@mid.individual.net> <86lf2hgjkd.fsf@linuxsc.com>
In-Reply-To: <86lf2hgjkd.fsf@linuxsc.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 53
Message-ID: <drVdJ.292$831.190@fx40.iad>
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Tue, 26 Oct 2021 15:48:25 UTC
Date: Tue, 26 Oct 2021 11:15:23 -0400
X-Received-Bytes: 3819
 by: EricP - Tue, 26 Oct 2021 15:15 UTC

Tim Rentsch wrote:
> Niklas Holsti <niklas.holsti@tidorum.invalid> writes:
>> In the Ada case, the idea (= spirit) is that you cannot combine
>> different types in that way -- for example, you cannot by default
>> add a signed integer to a modular integer. The programmer has to
>> convert one or both operands explicitly to compatible types,
>
> I understand. My point is about environments like C or C++
> where mixing of different types is allowed, and the result
> type depends on the operand types.

The type mixing in C is an illusion that is a consequence of automatic
conversions. The C compiler knows exactly what types expressions have,
and if those types don't map to known operations then it has a set
of promotion and conversion rules.

Binary operators act on pairs of same-type operands.

For integer + the compiler would have at least two definitions
signed + signed, unsigned + unsigned but they both map to the
same instruction.

For integer * and / signed and unsigned map to different instructions.

C's promotion and conversion rules basically say promote within
signed or unsigned type, and when it runs out of signed integer types
then assume the bit pattern is unsigned.

The difference for strong typing is there is no automatic type changes.
However most C compilers have a warning for operations on mixed types.

>> or [let the compiler know in some other way what it should do in
>> various specific cases, such as function overloading]
>
> This alternative illustrates the kinds of problems I'm talking
> about. Types have to know, in some sense, about other types,
> and the resultant code growth in N*N rather than linear.

Hmmm... under the hood there are only the physical types that the
hardware supports, and the compiler has to know how to change those.
e.g. integer, single, double, decimal(m.n).

Types may have some additional logical rules applied
and a conversion should apply those too.
e.g. integer range 1..10

But a strong type language compiler doesn't generate all conversions
between all logical and physical types just in case someone needs one.
It has a set of converters for the 3 or 4 physical types, just like C.
Most conversion checks result from assigning a larger to smaller integer
so it checks that you are not putting 10 lbs into a 5 lbs bag.

Re: Specifying timing constraints was Re: Paper about ISO C

<erVdJ.293$831.58@fx40.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21641&group=comp.arch#21641

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx40.iad.POSTED!not-for-mail
From: ThatWoul...@thevillage.com (EricP)
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
Newsgroups: comp.arch
Subject: Re: Specifying timing constraints was Re: Paper about ISO C
References: <87fstdumxd.fsf@hotmail.com> <sk6s4a$9cm$1@dont-email.me> <1ed391dc-0d1d-4069-96d8-e83acbe01ba5n@googlegroups.com> <sk9ej9$fj9$1@dont-email.me> <jwvtuhj4dlq.fsf-monnier+comp.arch@gnu.org> <skc7a9$698$1@dont-email.me> <skc905$85c$1@dont-email.me> <skh20o$ji2$1@dont-email.me> <4fc4f707-2d42-492a-bd41-f791141dbfb2n@googlegroups.com> <skhjk3$9p4$1@dont-email.me> <f9db2e75-2ec2-4572-b211-a8b2d6b3e0e6n@googlegroups.com> <skjkqv$nd3$1@dont-email.me> <0ba079c3-d672-47b3-b86d-cfc74520ca5dn@googlegroups.com> <86a6j6l8ci.fsf@linuxsc.com> <LClbJ.602$xjIc.241@fx01.iad> <skl12c$i1n$1@dont-email.me> <qgDbJ.3$in7.0@fx22.iad> <skn1iv$ap3$1@dont-email.me> <skn3ib$ouk$1@dont-email.me> <86ilxnii8c.fsf@linuxsc.com> <sl20bg$uha$1@dont-email.me> <86h7d5gj97.fsf@linuxsc.com>
In-Reply-To: <86h7d5gj97.fsf@linuxsc.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 48
Message-ID: <erVdJ.293$831.58@fx40.iad>
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Tue, 26 Oct 2021 15:48:26 UTC
Date: Tue, 26 Oct 2021 11:47:39 -0400
X-Received-Bytes: 3683
 by: EricP - Tue, 26 Oct 2021 15:47 UTC

Tim Rentsch wrote:
> Ivan Godard <ivan@millcomputing.com> writes:
>
>> As for your sum of sat+wrap+trunc, there's a simple solution: don't
>> pollute the types of the operations with the types of the
>> arguments. Let + take arguments and produce results from Z, and then
>> check when that is assigned or passed to see if it conforms to the
>> well defined and unambiguous type of the destination. [...]
>
> That's fine if that behavior is what is wanted. My comment is
> about a wider range of application, including for example
> combination rules more like what C or C++ have. What you are
> saying, in effect, is that user-defined types work just fine, but
> only if we are willing to change how things work; in short they
> offer a great solution, but to a different problem.

What changes for strong typing is that if you mix incompatible types
you must specify that you intended to do so. C has some automatic,
transparent conversion between types, like signed to unsigned integer,
that most modern C compilers warn about and most programmers already
include explicit casts, both to document that "yes it was intentional"
and to get the warning to shut up.

Also there may also be rules applied when converting between those
types and you want those rules invoked under your control.

For example, converting a signed-trap to unsigned-sat of the same
size changes the logical type then applies range constraints,
so it checks if the source is negative and sets it to zero.

Converting unsigned-sat to signed-trap of the same size checks if
the source is > INT_MAX (msb == 1) and traps if it is.

>> Yes, Ada got it right, thank you.
>
> I have gotten conflicting information on that point.

There were aspects of Ada83 that I liked and others I didn't.
It has changed a lot since I used it and I see that some things
that I considered problems have been smoothed out.

My tests for language X would be, can one write a compiler for X in X?
How much effort is it to write a GUI Windows/Xwindows interface app in it?
How much effort is it to write an OS in it?
(The last two requires extensive type conversions, so it stress-tests
the ergonomics of the typing rules.)

Re: Paper about ISO C

<itqmd0Ffq6jU1@mid.individual.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21642&group=comp.arch#21642

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: niklas.h...@tidorum.invalid (Niklas Holsti)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Tue, 26 Oct 2021 18:49:52 +0300
Organization: Tidorum Ltd
Lines: 60
Message-ID: <itqmd0Ffq6jU1@mid.individual.net>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl8m0n$ipt$1@newsreader4.netcologne.de>
<jwvcznsrlmn.fsf-monnier+comp.arch@gnu.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net Njdj51mf512nBkbOVFFhPABejw3a9azwZs4HJI/CVgY5ZMrIHq
Cancel-Lock: sha1:v9iFhapH7P2xj1Wyt4ybJiIHITU=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0)
Gecko/20100101 Thunderbird/78.14.0
In-Reply-To: <jwvcznsrlmn.fsf-monnier+comp.arch@gnu.org>
Content-Language: en-US
 by: Niklas Holsti - Tue, 26 Oct 2021 15:49 UTC

On 2021-10-26 15:59, Stefan Monnier wrote:
> Thomas Koenig [2021-10-26 10:41:27] wrote:
>> Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
>>> Currently Gforth's configure.ac checks whether the C compiler
>>> understands the following flags (and uses all those that the C
>>> compiler understands):
>>>
>>> -fno-gcse
>>> -fcaller-saves
>>> -fno-defer-pop
>>> -fno-inline
>>> -fwrapv
>>> -fchar-unsigned
>>> -fno-strict-aliasing
>>> -fno-cse-follow-jumps
>>> -fno-reorder-blocks
>>> -fno-reorder-blocks-and-partition
>>> -fno-toplevel-reorder
>>> -fno-trigraphs
>>> -falign-labels=1
>>> -falign-loops=1
>>> -falign-jumps=1
>>> -fno-delete-null-pointer-checks
>>
>> Wow.
> [...]
>> -fno-inline can be a performance killer if people prefer static
>> inline functions, which are type-safe and evaluate their arguments
>> only once over macros.
>
> You have to understand that the above is used for a Forth compiler which
> generates C code internally. So of course, most of the relevant
> optimizations are performed by the Forth compiler and aren't needed or
> even desired from the C compiler.
>
> The C compiler only needs to do the architecture-dependent part of
> optimizations, like register allocation, instruction selection, and
> a bit of code scheduling.

That is not how I understand Gforth. Based on earlier discussions with
Anton Ertl, Gforth does not generate C source. It has an internal set of
small C functions or code blocks, compiled by the C compiler when Gforth
is compiled, which implement each predefined Forth "word" (primitive
Forth operation). To compile a user-defined Forth word (a subroutine),
Gforth can either do as most simple interactive Forth systems do, which
is to make a list of the machine addresses of the code blocks for the
words that are used (called) in the subroutine, to be traversed by the
Forth "interpreter", _or_ Gforth can copy and concatenate the machine
code for those words, from the original code blocks for each word,
generating at run-time a new and larger machine code block for the new
word. This in-lines the machine code for each word and means that the
word can be executed as one step in the "interpreter". (I don't think
Gforth then optimizes the in-lined code in any way.)

As I understand it, the gcc options listed above are partly intended to
make this copy-and-concatenate process produce machine code that works
as intended. It amazes me that it actually works on several architectures.

(I hope Anton will correct the above if it is wrong.)

Re: Paper about ISO C

<sl99b3$q2h$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21644&group=comp.arch#21644

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Tue, 26 Oct 2021 09:11:15 -0700
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <sl99b3$q2h$1@dont-email.me>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl79bl$jei$1@dont-email.me> <jwvh7d4twhd.fsf-monnier+comp.arch@gnu.org>
<8f6f1f13-9cbc-4142-ba79-8a0eba101523n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Oct 2021 16:11:15 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b3833b4b15fca580ec0151ee867ffeee";
logging-data="26705"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX193chtZGY4zSCv4q6jtJ+Qa"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.2.0
Cancel-Lock: sha1:UHC9VCsX8wJrT/rUAQP+7EHpYQ0=
In-Reply-To: <8f6f1f13-9cbc-4142-ba79-8a0eba101523n@googlegroups.com>
Content-Language: en-US
 by: Ivan Godard - Tue, 26 Oct 2021 16:11 UTC

On 10/26/2021 7:34 AM, MitchAlsup wrote:
> On Monday, October 25, 2021 at 8:30:43 PM UTC-5, Stefan Monnier wrote:
>> David Brown [2021-10-25 23:59:16] wrote:
>>> On 25/10/2021 19:58, Anton Ertl wrote:
>>>> David Brown <david...@hesbynett.no> writes:
>>>>> On 23/10/2021 15:56, Quadibloc wrote:
>>>>>> and nothing is preventing them from taking the last version
>>>>>> of gcc they liked, and maintaining it themselves. They could
>>>>>> even issue a language standard for a language which they
>>>>>> could call CC (for "Classic C") or something.
>>>>>
>>>>> Actually, the gcc folks already did that for the "other side". They
>>>>> added the "-fwrapv" flag, and the "-fno-strict-aliasing" flag, and the
>>>>> "-fno-delete-null-pointer-checks" flag, and probably others.
>>>>
>>>> There's the rub. With the "probably others" you cannot use the
>>>> supposed successor of the known-working gcc as a drop-in replacement,
>>>> because the supposed successor may fail to work with the old flags.
>>>
>>> Actually, you /can/ - you do so by writing code that has defined
>>> behaviour (defined by the C standard, target ABI, compiler
>>> documentation, etc.).
> <
>> Sometimes it's not an option. To mention an example I brought up here
>> a few times, AFAIK you can't write code which scans the stack.
> <
> What valid programming example fits the description "Scan the stack" ?

libunwind.so?

Re: Paper about ISO C

<sl99d1$q2h$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21645&group=comp.arch#21645

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Tue, 26 Oct 2021 09:12:18 -0700
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <sl99d1$q2h$2@dont-email.me>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl79bl$jei$1@dont-email.me> <itpou1Fa8stU1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 26 Oct 2021 16:12:18 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b3833b4b15fca580ec0151ee867ffeee";
logging-data="26705"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19rV4kDwUIbVEz1409QLJnA"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.2.0
Cancel-Lock: sha1:v7ftU0harExqpf4Oe1t/mjoC9uo=
In-Reply-To: <itpou1Fa8stU1@mid.individual.net>
Content-Language: en-US
 by: Ivan Godard - Tue, 26 Oct 2021 16:12 UTC

On 10/26/2021 12:26 AM, Niklas Holsti wrote:
> On 2021-10-26 0:59, David Brown wrote:
>
>> I can only really think of two remaining situation where people could
>> reasonably assume certain behaviour, but it is not actually guaranteed
>> by the standards or the compiler - boundary points between functions,
>> and boundary points across compilation units.
>>
>> Some people assume that functions are compiled independently, and this
>> enforces ordering on execution, memory accesses, etc.  They think that
>> if a function calls another function, then that call acts like a memory
>> barrier of some sort.  But of course that is not the case -
>
>
> These discussions of volatile, and execution order wrt timing, gave me
> an idea: perhaps C (and other languages) should allow marking functions
> (subprograms) as "volatile", with the meaning that all of the effects of
> a call of that function (including use of processor time) should be
> ordered as volatile accesses are ordered, with respect to other volatile
> accesses.
>
> For example, if x and y are volatile variables, and foo is a volatile
> function, then in this code
>
>    x = 1;
>    foo ();
>    y = 1;
>
> we would be sure that all effects and all dynamic resource usage of the
> foo() call would occur between the assignments to x and to y.
>
> A more flexible approach would be to mark selected function calls as
> volatile, in the same way that C allows in-line use of
> pointer-to-volatile to force a volatile access to an object that is not
> itself marked volatile. Something like:
>
>    x = 1;
>    (volatile) foo ();
>    y = 1;
>
> Are volatile functions and/or volatile function calls a good idea?

Yes IMO

Re: Paper about ISO C

<6XVdJ.47$lz3.28@fx34.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21646&group=comp.arch#21646

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx34.iad.POSTED!not-for-mail
From: ThatWoul...@thevillage.com (EricP)
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me> <cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com> <sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org> <2021Oct12.185057@mips.complang.tuwien.ac.at> <jwvzgre88y4.fsf-monnier+comp.arch@gnu.org> <5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com> <sku3dr$1hb$2@dont-email.me> <5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com> <sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at> <sl79bl$jei$1@dont-email.me> <jwvh7d4twhd.fsf-monnier+comp.arch@gnu.org> <8f6f1f13-9cbc-4142-ba79-8a0eba101523n@googlegroups.com>
In-Reply-To: <8f6f1f13-9cbc-4142-ba79-8a0eba101523n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 31
Message-ID: <6XVdJ.47$lz3.28@fx34.iad>
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Tue, 26 Oct 2021 16:22:26 UTC
Date: Tue, 26 Oct 2021 12:21:47 -0400
X-Received-Bytes: 2834
 by: EricP - Tue, 26 Oct 2021 16:21 UTC

MitchAlsup wrote:
> On Monday, October 25, 2021 at 8:30:43 PM UTC-5, Stefan Monnier wrote:
> <
>> Sometimes it's not an option. To mention an example I brought up here
>> a few times, AFAIK you can't write code which scans the stack.
> <
> What valid programming example fits the description "Scan the stack" ?

In the WinNT structured exception handling model, which they brought
from VMS, the master handler scans backwards through the stack frames
looking for frame handlers. When it finds one, it invokes that frame
handler code _in the context of that frame_ passing an exception descriptor.
The frame handler can either
(a) fix the problem and continue execution where the exception was signaled
(b) resignal the exceptions so the stack scan for handlers continues
(c) unwind some or all of the stack frames invoking each intervening
handlers again but this time as in unwind mode.

In the easiest implementation, if any frame handler is present on a routine
the compiler always spills all live variables before subroutine calls.
Perhaps a smarter version would see the frame handler accessing some
frame local variable and make sure it was NOT held in a preserved
register across any calls, so it would always know where the variable
was located.

(There is more to it than that. For example, on some hardware
some exceptions are not continuable (restartable).
There can also be thread and process last-chance exception handlers,
and thread run-down handlers to release thread resources.)

Re: Specifying timing constraints was Re: Paper about ISO C

<cecc4abc-31e1-4500-abd2-c47fd4a475a5n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21647&group=comp.arch#21647

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:7c46:: with SMTP id o6mr25832981qtv.197.1635265786783;
Tue, 26 Oct 2021 09:29:46 -0700 (PDT)
X-Received: by 2002:a05:6808:10e:: with SMTP id b14mr2995982oie.44.1635265786476;
Tue, 26 Oct 2021 09:29:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 26 Oct 2021 09:29:46 -0700 (PDT)
In-Reply-To: <erVdJ.293$831.58@fx40.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:3057:4708:a7d0:a797;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:3057:4708:a7d0:a797
References: <87fstdumxd.fsf@hotmail.com> <sk6s4a$9cm$1@dont-email.me>
<1ed391dc-0d1d-4069-96d8-e83acbe01ba5n@googlegroups.com> <sk9ej9$fj9$1@dont-email.me>
<jwvtuhj4dlq.fsf-monnier+comp.arch@gnu.org> <skc7a9$698$1@dont-email.me>
<skc905$85c$1@dont-email.me> <skh20o$ji2$1@dont-email.me> <4fc4f707-2d42-492a-bd41-f791141dbfb2n@googlegroups.com>
<skhjk3$9p4$1@dont-email.me> <f9db2e75-2ec2-4572-b211-a8b2d6b3e0e6n@googlegroups.com>
<skjkqv$nd3$1@dont-email.me> <0ba079c3-d672-47b3-b86d-cfc74520ca5dn@googlegroups.com>
<86a6j6l8ci.fsf@linuxsc.com> <LClbJ.602$xjIc.241@fx01.iad>
<skl12c$i1n$1@dont-email.me> <qgDbJ.3$in7.0@fx22.iad> <skn1iv$ap3$1@dont-email.me>
<skn3ib$ouk$1@dont-email.me> <86ilxnii8c.fsf@linuxsc.com> <sl20bg$uha$1@dont-email.me>
<86h7d5gj97.fsf@linuxsc.com> <erVdJ.293$831.58@fx40.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cecc4abc-31e1-4500-abd2-c47fd4a475a5n@googlegroups.com>
Subject: Re: Specifying timing constraints was Re: Paper about ISO C
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Tue, 26 Oct 2021 16:29:46 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 59
 by: MitchAlsup - Tue, 26 Oct 2021 16:29 UTC

On Tuesday, October 26, 2021 at 10:48:28 AM UTC-5, EricP wrote:
> Tim Rentsch wrote:
> > Ivan Godard <iv...@millcomputing.com> writes:
> >
> >> As for your sum of sat+wrap+trunc, there's a simple solution: don't
> >> pollute the types of the operations with the types of the
> >> arguments. Let + take arguments and produce results from Z, and then
> >> check when that is assigned or passed to see if it conforms to the
> >> well defined and unambiguous type of the destination. [...]
> >
> > That's fine if that behavior is what is wanted. My comment is
> > about a wider range of application, including for example
> > combination rules more like what C or C++ have. What you are
> > saying, in effect, is that user-defined types work just fine, but
> > only if we are willing to change how things work; in short they
> > offer a great solution, but to a different problem.
>
> What changes for strong typing is that if you mix incompatible types
> you must specify that you intended to do so. C has some automatic,
> transparent conversion between types, like signed to unsigned integer,
> that most modern C compilers warn about and most programmers already
> include explicit casts, both to document that "yes it was intentional"
> and to get the warning to shut up.
>
> Also there may also be rules applied when converting between those
> types and you want those rules invoked under your control.
>
> For example, converting a signed-trap to unsigned-sat of the same
> size changes the logical type then applies range constraints,
> so it checks if the source is negative and sets it to zero.
<
My 66000 ISA even has an instruction to convert signed to unsigned::
if the signed is negative, then the result is zero.
<
unsigned to signed works similarly:
If the unsigned is going to be negative, then POSMAX is returned
and overflow raised.
<
These are not assignments but conversions and all My 66000 conversions
operate under the principle of best representable value.
>
> Converting unsigned-sat to signed-trap of the same size checks if
> the source is > INT_MAX (msb == 1) and traps if it is.
>
> >> Yes, Ada got it right, thank you.
> >
> > I have gotten conflicting information on that point.
>
> There were aspects of Ada83 that I liked and others I didn't.
> It has changed a lot since I used it and I see that some things
> that I considered problems have been smoothed out.
>
> My tests for language X would be, can one write a compiler for X in X?
<
And can one write the universal printf() for X in X
<
> How much effort is it to write a GUI Windows/Xwindows interface app in it?
> How much effort is it to write an OS in it?
> (The last two requires extensive type conversions, so it stress-tests
> the ergonomics of the typing rules.)

Re: Paper about ISO C

<a80e2b7f-fc38-49cf-8b66-86df4eb3643cn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21648&group=comp.arch#21648

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:622a:253:: with SMTP id c19mr5373643qtx.382.1635266164145;
Tue, 26 Oct 2021 09:36:04 -0700 (PDT)
X-Received: by 2002:a05:6830:23a6:: with SMTP id m6mr19631748ots.38.1635266163904;
Tue, 26 Oct 2021 09:36:03 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 26 Oct 2021 09:36:03 -0700 (PDT)
In-Reply-To: <sl99b3$q2h$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:3057:4708:a7d0:a797;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:3057:4708:a7d0:a797
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com> <sk437c$672$1@dont-email.me>
<jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org> <2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org> <5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me> <5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl79bl$jei$1@dont-email.me> <jwvh7d4twhd.fsf-monnier+comp.arch@gnu.org>
<8f6f1f13-9cbc-4142-ba79-8a0eba101523n@googlegroups.com> <sl99b3$q2h$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a80e2b7f-fc38-49cf-8b66-86df4eb3643cn@googlegroups.com>
Subject: Re: Paper about ISO C
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Tue, 26 Oct 2021 16:36:04 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 39
 by: MitchAlsup - Tue, 26 Oct 2021 16:36 UTC

On Tuesday, October 26, 2021 at 11:11:18 AM UTC-5, Ivan Godard wrote:
> On 10/26/2021 7:34 AM, MitchAlsup wrote:
> > On Monday, October 25, 2021 at 8:30:43 PM UTC-5, Stefan Monnier wrote:
> >> David Brown [2021-10-25 23:59:16] wrote:
> >>> On 25/10/2021 19:58, Anton Ertl wrote:
> >>>> David Brown <david...@hesbynett.no> writes:
> >>>>> On 23/10/2021 15:56, Quadibloc wrote:
> >>>>>> and nothing is preventing them from taking the last version
> >>>>>> of gcc they liked, and maintaining it themselves. They could
> >>>>>> even issue a language standard for a language which they
> >>>>>> could call CC (for "Classic C") or something.
> >>>>>
> >>>>> Actually, the gcc folks already did that for the "other side". They
> >>>>> added the "-fwrapv" flag, and the "-fno-strict-aliasing" flag, and the
> >>>>> "-fno-delete-null-pointer-checks" flag, and probably others.
> >>>>
> >>>> There's the rub. With the "probably others" you cannot use the
> >>>> supposed successor of the known-working gcc as a drop-in replacement,
> >>>> because the supposed successor may fail to work with the old flags.
> >>>
> >>> Actually, you /can/ - you do so by writing code that has defined
> >>> behaviour (defined by the C standard, target ABI, compiler
> >>> documentation, etc.).
> > <
> >> Sometimes it's not an option. To mention an example I brought up here
> >> a few times, AFAIK you can't write code which scans the stack.
> > <
> > What valid programming example fits the description "Scan the stack" ?
> libunwind.so?
<
Ok, granted, but this is NOT scanning the stack, it is using the known stack
format to escape from multiple layers simultaneously. It is not, for example
reading every variable looking for a certain pattern or a certain range of patterns.
<
But that function needs to be provided by the compiler as part of its own run
time (support library). It is not something that is willy-nilly generated by a
semi-concerned programmer using a few compiler switches.
<
Also, how does one unwind the stack when one has no access to the parts
of the stack that are protected from the user code ?

Re: Specifying timing constraints was Re: Paper about ISO C

<sl9b22$2gl$1@newsreader4.netcologne.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21649&group=comp.arch#21649

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-465a-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Specifying timing constraints was Re: Paper about ISO C
Date: Tue, 26 Oct 2021 16:40:34 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <sl9b22$2gl$1@newsreader4.netcologne.de>
References: <87fstdumxd.fsf@hotmail.com>
<afb9352d-8ba7-4521-b741-280e0206e255n@googlegroups.com>
<3a350cfe-971c-4042-9171-9ec2516cdf2bn@googlegroups.com>
<sk6s4a$9cm$1@dont-email.me>
<1ed391dc-0d1d-4069-96d8-e83acbe01ba5n@googlegroups.com>
<sk9ej9$fj9$1@dont-email.me> <jwvtuhj4dlq.fsf-monnier+comp.arch@gnu.org>
<skc7a9$698$1@dont-email.me> <skc905$85c$1@dont-email.me>
<skh20o$ji2$1@dont-email.me>
<4fc4f707-2d42-492a-bd41-f791141dbfb2n@googlegroups.com>
<skhjk3$9p4$1@dont-email.me>
<f9db2e75-2ec2-4572-b211-a8b2d6b3e0e6n@googlegroups.com>
<skjkqv$nd3$1@dont-email.me>
<0ba079c3-d672-47b3-b86d-cfc74520ca5dn@googlegroups.com>
<86a6j6l8ci.fsf@linuxsc.com> <LClbJ.602$xjIc.241@fx01.iad>
<skl12c$i1n$1@dont-email.me> <qgDbJ.3$in7.0@fx22.iad>
<skn1iv$ap3$1@dont-email.me> <skn3ib$ouk$1@dont-email.me>
<86ilxnii8c.fsf@linuxsc.com> <sl20bg$uha$1@dont-email.me>
<sl32ot$qn1$1@newsreader4.netcologne.de> <sl86pl$bgi$1@dont-email.me>
<316bf26c-5a00-45ca-b58e-652455e2659dn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 26 Oct 2021 16:40:34 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-465a-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:465a:0:7285:c2ff:fe6c:992d";
logging-data="2581"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Tue, 26 Oct 2021 16:40 UTC

MitchAlsup <MitchAlsup@aol.com> schrieb:
> On Tuesday, October 26, 2021 at 1:21:43 AM UTC-5, Stephen Fuld wrote:
>> On 10/24/2021 12:42 AM, Thomas Koenig wrote:
>> > Ivan Godard <iv...@millcomputing.com> schrieb:
>> >
>> >> The lit history is full of efforts to put units into the type systems.
>> >> They sure look plausible but don't work. Think of a NR sqrt routine.
>> >
>> > MathCad has got this right. It is not a compiled language,
>> > but it certainly works. I use it a lot in my day job for simple
>> > engineering calculations: You see the formulas, you immediately
>> > see the output, you do input in units (like kg/h), you can convert
>> > the output to units you want.
>> >
>> > And, of course, it complains if you try to add or subtract
>> > dimensions that do not match.
><
>> What happens if you multiply two variables with dimension "length"
>> together? Does it understand that the result is an "area"?
><
> What happens when you multiply 1 width by 1 height ? you get an
> Area. But if you multiply 1 vector length by a second vector length
> you get a×b×cos(angle(a,b)).

MathCad (like any other program) will usually not do your thinking
for you, you will have to do that yourself :-)

Re: Paper about ISO C

<sl9c25$jdu$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21650&group=comp.arch#21650

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Tue, 26 Oct 2021 09:57:42 -0700
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <sl9c25$jdu$1@dont-email.me>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl79bl$jei$1@dont-email.me> <jwvh7d4twhd.fsf-monnier+comp.arch@gnu.org>
<8f6f1f13-9cbc-4142-ba79-8a0eba101523n@googlegroups.com>
<sl99b3$q2h$1@dont-email.me>
<a80e2b7f-fc38-49cf-8b66-86df4eb3643cn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Oct 2021 16:57:41 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b3833b4b15fca580ec0151ee867ffeee";
logging-data="19902"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196nYy9WXCZ0fj6pZDg3LaA"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.2.0
Cancel-Lock: sha1:YvPJQUrXU3WiInl/dtIqGkfqEnU=
In-Reply-To: <a80e2b7f-fc38-49cf-8b66-86df4eb3643cn@googlegroups.com>
Content-Language: en-US
 by: Ivan Godard - Tue, 26 Oct 2021 16:57 UTC

On 10/26/2021 9:36 AM, MitchAlsup wrote:
> On Tuesday, October 26, 2021 at 11:11:18 AM UTC-5, Ivan Godard wrote:
>> On 10/26/2021 7:34 AM, MitchAlsup wrote:
>>> On Monday, October 25, 2021 at 8:30:43 PM UTC-5, Stefan Monnier wrote:
>>>> David Brown [2021-10-25 23:59:16] wrote:
>>>>> On 25/10/2021 19:58, Anton Ertl wrote:
>>>>>> David Brown <david...@hesbynett.no> writes:
>>>>>>> On 23/10/2021 15:56, Quadibloc wrote:
>>>>>>>> and nothing is preventing them from taking the last version
>>>>>>>> of gcc they liked, and maintaining it themselves. They could
>>>>>>>> even issue a language standard for a language which they
>>>>>>>> could call CC (for "Classic C") or something.
>>>>>>>
>>>>>>> Actually, the gcc folks already did that for the "other side". They
>>>>>>> added the "-fwrapv" flag, and the "-fno-strict-aliasing" flag, and the
>>>>>>> "-fno-delete-null-pointer-checks" flag, and probably others.
>>>>>>
>>>>>> There's the rub. With the "probably others" you cannot use the
>>>>>> supposed successor of the known-working gcc as a drop-in replacement,
>>>>>> because the supposed successor may fail to work with the old flags.
>>>>>
>>>>> Actually, you /can/ - you do so by writing code that has defined
>>>>> behaviour (defined by the C standard, target ABI, compiler
>>>>> documentation, etc.).
>>> <
>>>> Sometimes it's not an option. To mention an example I brought up here
>>>> a few times, AFAIK you can't write code which scans the stack.
>>> <
>>> What valid programming example fits the description "Scan the stack" ?
>> libunwind.so?
> <
> Ok, granted, but this is NOT scanning the stack, it is using the known stack
> format to escape from multiple layers simultaneously. It is not, for example
> reading every variable looking for a certain pattern or a certain range of patterns.
> <
> But that function needs to be provided by the compiler as part of its own run
> time (support library). It is not something that is willy-nilly generated by a
> semi-concerned programmer using a few compiler switches.
> <
> Also, how does one unwind the stack when one has no access to the parts
> of the stack that are protected from the user code ?

Good question. Our answer is NYF.

Re: Specifying timing constraints was Re: Paper about ISO C

<sl9caf$jdu$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21651&group=comp.arch#21651

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: Specifying timing constraints was Re: Paper about ISO C
Date: Tue, 26 Oct 2021 10:02:08 -0700
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <sl9caf$jdu$2@dont-email.me>
References: <87fstdumxd.fsf@hotmail.com> <sk6s4a$9cm$1@dont-email.me>
<1ed391dc-0d1d-4069-96d8-e83acbe01ba5n@googlegroups.com>
<sk9ej9$fj9$1@dont-email.me> <jwvtuhj4dlq.fsf-monnier+comp.arch@gnu.org>
<skc7a9$698$1@dont-email.me> <skc905$85c$1@dont-email.me>
<skh20o$ji2$1@dont-email.me>
<4fc4f707-2d42-492a-bd41-f791141dbfb2n@googlegroups.com>
<skhjk3$9p4$1@dont-email.me>
<f9db2e75-2ec2-4572-b211-a8b2d6b3e0e6n@googlegroups.com>
<skjkqv$nd3$1@dont-email.me>
<0ba079c3-d672-47b3-b86d-cfc74520ca5dn@googlegroups.com>
<86a6j6l8ci.fsf@linuxsc.com> <LClbJ.602$xjIc.241@fx01.iad>
<skl12c$i1n$1@dont-email.me> <qgDbJ.3$in7.0@fx22.iad>
<skn1iv$ap3$1@dont-email.me> <skn3ib$ouk$1@dont-email.me>
<86ilxnii8c.fsf@linuxsc.com> <sl20bg$uha$1@dont-email.me>
<86h7d5gj97.fsf@linuxsc.com> <erVdJ.293$831.58@fx40.iad>
<cecc4abc-31e1-4500-abd2-c47fd4a475a5n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Oct 2021 17:02:07 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b3833b4b15fca580ec0151ee867ffeee";
logging-data="19902"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2hVq7XU7/cAReSVmM3bt6"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.2.0
Cancel-Lock: sha1:ICxzAFGQlG4ByYTLgQjWkFcD9C4=
In-Reply-To: <cecc4abc-31e1-4500-abd2-c47fd4a475a5n@googlegroups.com>
Content-Language: en-US
 by: Ivan Godard - Tue, 26 Oct 2021 17:02 UTC

On 10/26/2021 9:29 AM, MitchAlsup wrote:
> On Tuesday, October 26, 2021 at 10:48:28 AM UTC-5, EricP wrote:
>> Tim Rentsch wrote:
>>> Ivan Godard <iv...@millcomputing.com> writes:
>>>
>>>> As for your sum of sat+wrap+trunc, there's a simple solution: don't
>>>> pollute the types of the operations with the types of the
>>>> arguments. Let + take arguments and produce results from Z, and then
>>>> check when that is assigned or passed to see if it conforms to the
>>>> well defined and unambiguous type of the destination. [...]
>>>
>>> That's fine if that behavior is what is wanted. My comment is
>>> about a wider range of application, including for example
>>> combination rules more like what C or C++ have. What you are
>>> saying, in effect, is that user-defined types work just fine, but
>>> only if we are willing to change how things work; in short they
>>> offer a great solution, but to a different problem.
>>
>> What changes for strong typing is that if you mix incompatible types
>> you must specify that you intended to do so. C has some automatic,
>> transparent conversion between types, like signed to unsigned integer,
>> that most modern C compilers warn about and most programmers already
>> include explicit casts, both to document that "yes it was intentional"
>> and to get the warning to shut up.
>>
>> Also there may also be rules applied when converting between those
>> types and you want those rules invoked under your control.
>>
>> For example, converting a signed-trap to unsigned-sat of the same
>> size changes the logical type then applies range constraints,
>> so it checks if the source is negative and sets it to zero.
> <
> My 66000 ISA even has an instruction to convert signed to unsigned::
> if the signed is negative, then the result is zero.
> <
> unsigned to signed works similarly:
> If the unsigned is going to be negative, then POSMAX is returned
> and overflow raised.
> <
> These are not assignments but conversions and all My 66000 conversions
> operate under the principle of best representable value.

Is that a synonym for "saturation"?

Re: Paper about ISO C

<2021Oct26.174949@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21652&group=comp.arch#21652

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Tue, 26 Oct 2021 15:49:49 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 127
Distribution: world
Message-ID: <2021Oct26.174949@mips.complang.tuwien.ac.at>
References: <87fstdumxd.fsf@hotmail.com> <sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org> <2021Oct12.185057@mips.complang.tuwien.ac.at> <jwvzgre88y4.fsf-monnier+comp.arch@gnu.org> <5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com> <sku3dr$1hb$2@dont-email.me> <5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com> <sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at> <sl8m0n$ipt$1@newsreader4.netcologne.de>
Injection-Info: reader02.eternal-september.org; posting-host="d0767c986d2eb9bbc2ca097a08dfdb51";
logging-data="8243"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19SOpvmpqs937NHaMHX/lYm"
Cancel-Lock: sha1:PuXPkiyKitP1NMIRSHkuHyWcdxs=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Tue, 26 Oct 2021 15:49 UTC

Thomas Koenig <tkoenig@netcologne.de> writes:
>-fno-reorder-blocks puts the compiler back before the very first
>FORTRAN compiler, which invented basic blocks and moving them
>around for optimization.

So you want to imply that this is going to slow gforth down? Let's
test this hypothesis (gcc-10.2 on Skylake):

with with without
-fno-reorder-blocks
default --no-dynamic default
1358614162 1834084907 1959794599 cycles:u onebench.fs
3209609889 4229597875 4499690628 instructions:u onebench.fs

What happens is that without -fno-reorder-blocks a sanity check in
Gforth disables Gforth's dynamic superinstruction optimization (the
sanity check sees that the code is not arranged in one of the ways
needed for the optimization). Interestingly, the slowdown is slightly
worse than when disabling dynamic superinstructions directly, so there
is an additional effect at work. In any case, your implied claim that
-fno-reorder-blocks generally hurts performance is debunked.

>-fno-inline can be a performance killer if people prefer static
>inline functions, which are type-safe and evaluate their arguments
>only once over macros.

Ok, after reinstating -fno-reorder-blocks, let's test this hypothesis:

with without
-fno-inline
120 114 non-relocatable primitives
1358614162 1336327000 cycles:u onebench.fs
3209609889 3202121890 instructions:u onebench.fs

Here we indeed see a slight improvement from leaving inlining enabled,
both in cycles for this benchmark and in the reduced number of
non-relocatable primitives (non-relocatable primitives cannot be used
in dynamic superinstructions).

The non-relocatable primitives are there because calls inside a
primitive cause non-relocatability of the primitive on AMD64. But
there is a comment on one of the functions:

it also happens to have better register allocation on AMD64, at the
cost of a function call (and non-relocatability)

Maybe register allocation is better on gcc-10 than what I tested on at
the time.

>But then, I understand from an old PR of yours (PR 15252) that
>gforth makes heavy use of "goto variable", an extension that
>(IIRC) was originally put into gcc by Craig Burley to support
>assigned gotos in FORTRAN,

How does adding an extension to C help Fortran?

>so your code is certainly very much
>non-conforming.

In terms of the C standard, it's a conformant program.

>Luckily, assigned gotos have been depecated
>in Fortran.

I guess nobody is implementing virtual-machine interpreters in Fortran
these days, much less the kind of dynamic native code generation that
Gforth uses. Both techniques use the labels-as-values extension in
GNU C, and have been used in several programming language
implementations. It is used so widely that icc, clang and tcc have
implemented this extension as well. But nobody implements programming
languages in Fortran these days, so if assigned gotos go away, maybe
nobody will miss them.

>For the readers who do not know what I am talking about,
>here is a reduced test case from the PR:
>
>int f(int i, int j)
>{
> static void *a[5] = {&&b,&&c,&&d,&&e,&&f};
>
> if (i >=5) i = 0; if (i<=0)i=5;
> goto *a[i];
> e:
> i++; if (i >=5) i = 0; if (i<=0)i=5;
> j++;
> goto *a[i];
> f:
> i--; if (i >=5) i = 0; if (i<=0)i=5;
> j--;
> goto *a[i];
> b:
> i+=2; if (i >=5) i = 0; if (i<=0)i=5;
> goto *a[i];
> c:
> i*=2; if (i >=5) i = 0; if (i<=0)i=5;
> goto *a[i];
> d:;
>}
>
>With this sort of code, I can understand why a lot of optimizations
>like moving basic blocks around can mess up your implementation.

This is not a reduced test case from the original bug report in
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=15242> (Bug 15252 is not
from me). It's good enough for reproducing the bug, but not good for
illustrative purposes. The code for a typical virtual machine
instruction like + (addition) contains no ifs.

The bug report is about gcc at the time pessimizing the code by
dedupliating the indirect jumps, which made threaded-code interpreters
larger and much slower (ensuring close to 100% miss rate in the BTBs
of the CPUs of the time, compared to ~50% without deduplication). It
also completely disabled dynamic native code generation (which buys
another factor of 2 on larger benchmarks (more on smaller benchmarks)
on machines with BTB for indirect branch prediction).

>> Only some of those are for disabling assumptions about undefined
>> behaviour.
>
>I suspect the rest is for making code like the above work :-)

In the case of -fno-reorder-blocks, to make it work fast.

- anton
--
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>

Re: Paper about ISO C

<itqvp1Fhk66U1@mid.individual.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21653&group=comp.arch#21653

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.niel.me!aioe.org!feeder5.feed.usenet.farm!feeder1.feed.usenet.farm!feed.usenet.farm!newsreader4.netcologne.de!news.netcologne.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: niklas.h...@tidorum.invalid (Niklas Holsti)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Tue, 26 Oct 2021 21:29:17 +0300
Organization: Tidorum Ltd
Lines: 25
Message-ID: <itqvp1Fhk66U1@mid.individual.net>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl79bl$jei$1@dont-email.me> <itpou1Fa8stU1@mid.individual.net>
<sl8m4t$ipt$2@newsreader4.netcologne.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net sWX8BWv8X5UUuE2cwUiRawMvnKLI44dNLKp5uN+qmpyo2PwXNk
Cancel-Lock: sha1:6CHNoOhqWHDsHkackBeLP8GMw4M=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0)
Gecko/20100101 Thunderbird/78.14.0
In-Reply-To: <sl8m4t$ipt$2@newsreader4.netcologne.de>
Content-Language: en-US
 by: Niklas Holsti - Tue, 26 Oct 2021 18:29 UTC

On 2021-10-26 13:43, Thomas Koenig wrote:
> Niklas Holsti <niklas.holsti@tidorum.invalid> schrieb:
>
>> For example, if x and y are volatile variables, and foo is a volatile
>> function, then in this code
>>
>> x = 1;
>> foo ();
>> y = 1;
>>
>> we would be sure that all effects and all dynamic resource usage of the
>> foo() call would occur between the assignments to x and to y.
>
> You can have that already by having pointers to x and y escape
> (i.e. put bar(&x, &y) before it).

That trick does not work if the compiler knows enough about what foo()
does, for example by in-lining the call. (If the call is not in-lined,
the order is assured if the compiler cannot determine that foo makes
_no_ volatile accesses; the identities of x and y are irrelevant.
Perhaps you did not note that x and y are assumed volatile.)

The point of my proposal was to assure the ordering whatever the
compiler legally does.

Re: Specifying timing constraints was Re: Paper about ISO C

<db3da7db-78b6-448c-ae05-2605101c72dbn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21654&group=comp.arch#21654

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:7fd5:: with SMTP id b21mr27509370qtk.101.1635273556854;
Tue, 26 Oct 2021 11:39:16 -0700 (PDT)
X-Received: by 2002:a9d:d12:: with SMTP id 18mr3383038oti.85.1635273556408;
Tue, 26 Oct 2021 11:39:16 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 26 Oct 2021 11:39:16 -0700 (PDT)
In-Reply-To: <sl9caf$jdu$2@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:b848:fcd3:4c3a:1e76;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:b848:fcd3:4c3a:1e76
References: <87fstdumxd.fsf@hotmail.com> <sk6s4a$9cm$1@dont-email.me>
<1ed391dc-0d1d-4069-96d8-e83acbe01ba5n@googlegroups.com> <sk9ej9$fj9$1@dont-email.me>
<jwvtuhj4dlq.fsf-monnier+comp.arch@gnu.org> <skc7a9$698$1@dont-email.me>
<skc905$85c$1@dont-email.me> <skh20o$ji2$1@dont-email.me> <4fc4f707-2d42-492a-bd41-f791141dbfb2n@googlegroups.com>
<skhjk3$9p4$1@dont-email.me> <f9db2e75-2ec2-4572-b211-a8b2d6b3e0e6n@googlegroups.com>
<skjkqv$nd3$1@dont-email.me> <0ba079c3-d672-47b3-b86d-cfc74520ca5dn@googlegroups.com>
<86a6j6l8ci.fsf@linuxsc.com> <LClbJ.602$xjIc.241@fx01.iad>
<skl12c$i1n$1@dont-email.me> <qgDbJ.3$in7.0@fx22.iad> <skn1iv$ap3$1@dont-email.me>
<skn3ib$ouk$1@dont-email.me> <86ilxnii8c.fsf@linuxsc.com> <sl20bg$uha$1@dont-email.me>
<86h7d5gj97.fsf@linuxsc.com> <erVdJ.293$831.58@fx40.iad> <cecc4abc-31e1-4500-abd2-c47fd4a475a5n@googlegroups.com>
<sl9caf$jdu$2@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <db3da7db-78b6-448c-ae05-2605101c72dbn@googlegroups.com>
Subject: Re: Specifying timing constraints was Re: Paper about ISO C
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Tue, 26 Oct 2021 18:39:16 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 49
 by: MitchAlsup - Tue, 26 Oct 2021 18:39 UTC

On Tuesday, October 26, 2021 at 12:02:10 PM UTC-5, Ivan Godard wrote:
> On 10/26/2021 9:29 AM, MitchAlsup wrote:
> > On Tuesday, October 26, 2021 at 10:48:28 AM UTC-5, EricP wrote:
> >> Tim Rentsch wrote:
> >>> Ivan Godard <iv...@millcomputing.com> writes:
> >>>
> >>>> As for your sum of sat+wrap+trunc, there's a simple solution: don't
> >>>> pollute the types of the operations with the types of the
> >>>> arguments. Let + take arguments and produce results from Z, and then
> >>>> check when that is assigned or passed to see if it conforms to the
> >>>> well defined and unambiguous type of the destination. [...]
> >>>
> >>> That's fine if that behavior is what is wanted. My comment is
> >>> about a wider range of application, including for example
> >>> combination rules more like what C or C++ have. What you are
> >>> saying, in effect, is that user-defined types work just fine, but
> >>> only if we are willing to change how things work; in short they
> >>> offer a great solution, but to a different problem.
> >>
> >> What changes for strong typing is that if you mix incompatible types
> >> you must specify that you intended to do so. C has some automatic,
> >> transparent conversion between types, like signed to unsigned integer,
> >> that most modern C compilers warn about and most programmers already
> >> include explicit casts, both to document that "yes it was intentional"
> >> and to get the warning to shut up.
> >>
> >> Also there may also be rules applied when converting between those
> >> types and you want those rules invoked under your control.
> >>
> >> For example, converting a signed-trap to unsigned-sat of the same
> >> size changes the logical type then applies range constraints,
> >> so it checks if the source is negative and sets it to zero.
> > <
> > My 66000 ISA even has an instruction to convert signed to unsigned::
> > if the signed is negative, then the result is zero.
> > <
> > unsigned to signed works similarly:
> > If the unsigned is going to be negative, then POSMAX is returned
> > and overflow raised.
> > <
> > These are not assignments but conversions and all My 66000 conversions
> > operate under the principle of best representable value.
<
> Is that a synonym for "saturation"?
<
Sometimes, sometimes not.
wrt signed->unsigned; unsigned saturates negative values to zero
wrt unsigned->signed; signed saturates to POSMAX.
<
But a double->float with RM=ToZero has non-infinities round to non-infinity.

Re: Paper about ISO C

<itr1s3Fi022U1@mid.individual.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21655&group=comp.arch#21655

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: niklas.h...@tidorum.invalid (Niklas Holsti)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Tue, 26 Oct 2021 22:05:39 +0300
Organization: Tidorum Ltd
Lines: 105
Message-ID: <itr1s3Fi022U1@mid.individual.net>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl79bl$jei$1@dont-email.me> <itpou1Fa8stU1@mid.individual.net>
<sl8r6n$ifk$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net xW3dpj/tZhTWy3GIUBxa2wihWXb6kxoMs8npqx4BnqcgSjzjqo
Cancel-Lock: sha1:Z854sKOvlawo1QXZF2/j4Bv806k=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0)
Gecko/20100101 Thunderbird/78.14.0
In-Reply-To: <sl8r6n$ifk$1@dont-email.me>
Content-Language: en-US
 by: Niklas Holsti - Tue, 26 Oct 2021 19:05 UTC

On 2021-10-26 15:09, David Brown wrote:
> On 26/10/2021 09:26, Niklas Holsti wrote:
>> On 2021-10-26 0:59, David Brown wrote:
>>
>>> I can only really think of two remaining situation where people could
>>> reasonably assume certain behaviour, but it is not actually guaranteed
>>> by the standards or the compiler - boundary points between functions,
>>> and boundary points across compilation units.
>>>
>>> Some people assume that functions are compiled independently, and this
>>> enforces ordering on execution, memory accesses, etc.  They think that
>>> if a function calls another function, then that call acts like a memory
>>> barrier of some sort.  But of course that is not the case -
>>
>>
>> These discussions of volatile, and execution order wrt timing, gave me
>> an idea: perhaps C (and other languages) should allow marking functions
>> (subprograms) as "volatile", with the meaning that all of the effects of
>> a call of that function (including use of processor time) should be
>> ordered as volatile accesses are ordered, with respect to other volatile
>> accesses.
>>
>> For example, if x and y are volatile variables, and foo is a volatile
>> function, then in this code
>>
>>    x = 1;
>>    foo ();
>>    y = 1;
>>
>> we would be sure that all effects and all dynamic resource usage of the
>> foo() call would occur between the assignments to x and to y.
>>
>> A more flexible approach would be to mark selected function calls as
>> volatile, in the same way that C allows in-line use of
>> pointer-to-volatile to force a volatile access to an object that is not
>> itself marked volatile. Something like:
>>
>>    x = 1;
>>    (volatile) foo ();
>>    y = 1;
>>
>> Are volatile functions and/or volatile function calls a good idea?
>
> That is an interesting idea. It would, I think, be feasible for such a
> "volatile" function to consider each read and write it does as though it
> was a volatile access.

I did not mean that. I just meant that the volatile mark would prevent
the compiler from moving any of the code of the function backwards or
forwards over a volatile access or another volatile call. That
constraint would come into play only if the compiler in-lines the call,
or knows enough about the call's effects to try to move the call
instruction (and any associated parameter-evaluation and
parameter-passing code). In other respects the function and any calls to
the function would be compiled normally and behave normally.

> But what about other code that it might call - should "volatile" be
> recursive here?

In the sense that the constraint on code motion would apply also to
nested calls (under in-lining), but again the callees themselves would
be compiled normally and execute normally -- they would not be forced to
use only volatile accesses.

Volatile accesses within foo (and within functions that foo calls) would
have their normal effect on execution order within those functions (or
their in-lined versions). So non-volatile accesses in the in-lined code
could be reordered, but not past volatile accesses (or other volatile
calls) in the caller of foo (that is, not before the assignment to x nor
after the assignment to y).

In the general case, with several levels of in-lining, the compiler
would have to keep track of nested regions such that code within a
region can be moved about within that region, even past inner nested
regions, but not into an outer region. The normal constraints on moving
volatile accesses would also apply within regions and across regions.

> And what would it really mean to say that "processor time" is also
> ordered?

I suppose the language standard would have some fuzzy wording about
"dynamically consumed resources", with processor cycles as an example,
and leave it to each implementation to document what those resources are
for this implementation.

Perhaps the consumption of such resources would be defined as an
observable effect, although the language standard could not define
precisely what that effect consists of and would have to leave it to the
implementation to document.

> I suspect this would need a lot of effort to develop into something
> rigorous and definable.

Probably so.

> But the end result could definitely have its uses.

So it seems, judging from some of the recent discussion here.

Re: Paper about ISO C

<69b29aca-621c-4346-8ff6-f7a30f60a59dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21656&group=comp.arch#21656

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:12e5:: with SMTP id f5mr2684482qkl.453.1635281595572;
Tue, 26 Oct 2021 13:53:15 -0700 (PDT)
X-Received: by 2002:a05:6808:1444:: with SMTP id x4mr782488oiv.157.1635281595343;
Tue, 26 Oct 2021 13:53:15 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 26 Oct 2021 13:53:15 -0700 (PDT)
In-Reply-To: <sl9c25$jdu$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:b848:fcd3:4c3a:1e76;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:b848:fcd3:4c3a:1e76
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com> <sk437c$672$1@dont-email.me>
<jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org> <2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org> <5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me> <5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl79bl$jei$1@dont-email.me> <jwvh7d4twhd.fsf-monnier+comp.arch@gnu.org>
<8f6f1f13-9cbc-4142-ba79-8a0eba101523n@googlegroups.com> <sl99b3$q2h$1@dont-email.me>
<a80e2b7f-fc38-49cf-8b66-86df4eb3643cn@googlegroups.com> <sl9c25$jdu$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <69b29aca-621c-4346-8ff6-f7a30f60a59dn@googlegroups.com>
Subject: Re: Paper about ISO C
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Tue, 26 Oct 2021 20:53:15 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 17
 by: MitchAlsup - Tue, 26 Oct 2021 20:53 UTC

On Tuesday, October 26, 2021 at 11:57:44 AM UTC-5, Ivan Godard wrote:
> On 10/26/2021 9:36 AM, MitchAlsup wrote:

> > But that function needs to be provided by the compiler as part of its own run
> > time (support library). It is not something that is willy-nilly generated by a
> > semi-concerned programmer using a few compiler switches.
> > <
> > Also, how does one unwind the stack when one has no access to the parts
> > of the stack that are protected from the user code ?
<
> Good question. Our answer is NYF.
<
Seems to me you have 2 choices:: some HW instruction that performs job at hand
faking access rights {sort of what I do in HW context switches...........}
Or a cheap context switch to a address space with permissions to do the job in SW.
<
It seems painfully obvious that the entirety of the mechanism is to prevent user
(unprivileged code) from accessing those locations {security, RoP,...}


devel / comp.arch / Re: addressing and protection, was Paper about ISO C

Pages:123456789101112131415161718192021222324252627282930313233
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor