~mcf

https://mforney.org

~mcf/cproc

Last active 11 days ago

~mcf/cproc-builds

Last active 22 days ago

~mcf/oasis

Last active 2 years ago

~mcf/libtls-bearssl

Last active 2 years ago

~mcf/dnssec-rr

Last active 4 years ago

~mcf/test

Last active 5 years ago
View more

Recent activity

Re: [PATCH] Fix zero/variable length arrays handling a month ago

From Michael Forney to ~mcf/cproc

"Sertonix" <sertonix@posteo.net> wrote:
> In 4f206ac1ea (Implement variable length arrays) arrays with the length 0
> were considered to be variable length arrays. This may not be true and
> caused cproc to segfault when parsing for example sizeof(int[0]). Using
> t->prop & PROPVM as check for variable length arrays should always work
> correctly.

Thanks for the patch!

However, the distinction between variably modified type and variably
length array is important here.

Consider this example:

Re: Curious codegen 5 months ago

From Michael Forney to ~mcf/cproc

Hi Roland,

Roland Paterson-Jones <rolandpj@gmail.com> wrote:
> I've noticed cproc generating what I'm fairly sure are redundant QBE
> cnew instructions.
> 
> Simple test case:
> 
> int
> test(int v)
> {
>     if (v == 45 || v == 47)
>         return 1;
>     return 0;

[PATCH builds.sr.ht 3/3] images/netbsd: Remove 8.x 7 months ago

From Michael Forney to ~sircmpwn/sr.ht-dev

---
 images/netbsd/8.x/functions | 1 -
 images/netbsd/8.x/genimg    | 6 ------
 2 files changed, 7 deletions(-)
 delete mode 120000 images/netbsd/8.x/functions
 delete mode 100755 images/netbsd/8.x/genimg

diff --git a/images/netbsd/8.x/functions b/images/netbsd/8.x/functions
deleted file mode 120000
index c0b5bcc..0000000
--- a/images/netbsd/8.x/functions
@@ -1 +0,0 @@
../functions
[message trimmed]

[PATCH builds.sr.ht 2/3] images/netbsd: Add 10.x 7 months ago

From Michael Forney to ~sircmpwn/sr.ht-dev

---
 images/netbsd/10.x/functions | 1 +
 images/netbsd/10.x/genimg    | 6 ++++++
 images/netbsd/latest         | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)
 create mode 120000 images/netbsd/10.x/functions
 create mode 100755 images/netbsd/10.x/genimg

diff --git a/images/netbsd/10.x/functions b/images/netbsd/10.x/functions
new file mode 120000
index 0000000..c0b5bcc
--- /dev/null
+++ b/images/netbsd/10.x/functions
@@ -0,0 +1 @@
[message trimmed]

[PATCH builds.sr.ht 1/3] images/netbsd: Update 9.x to 9.4 7 months ago

From Michael Forney to ~sircmpwn/sr.ht-dev

Starting with NetBSD 9.4, the default sshd_config uses UsePAM instead
of UsePam[0], so change the sed command to be case-insensitive.

[0] http://cvsweb.netbsd.org/bsdweb.cgi/src/crypto/external/bsd/openssh/dist/sshd_config.diff?r1=1.23&r2=1.24&f=h
---
 images/netbsd/9.x/genimg | 4 ++--
 images/netbsd/genimg     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/images/netbsd/9.x/genimg b/images/netbsd/9.x/genimg
index ab27ed8..920ab64 100755
--- a/images/netbsd/9.x/genimg
+++ b/images/netbsd/9.x/genimg
@@ -1,6 +1,6 @@
[message trimmed]

Re: [PATCH] handle typeof inside casts, va_arg, and compound expressions 7 months ago

From Michael Forney to ~mcf/cproc

Nihal Jere <nihal@nihaljere.xyz> wrote:
> ---
> This patch should handle most cases, but there is a catch:
> In the function g in test/typeof-vm.c, notice I had to initialize p.
> If it is uninitialized, and since the argument of typeof is evaluated,
> p is loaded without being stored to.

Thanks, this looks good. Found a couple minor issues which I've
amended.

> 
>  cc.h             |  3 ++-
>  decl.c           |  8 +++++---
>  expr.c           | 21 ++++++++++++---------

Re: General questions 7 months ago

From Michael Forney to ~mpu/qbe

Rosie 🌺 <acquitefx@gmail.com> wrote:
> How do I get the size of an object? (Like sizeof in C?)
> 
> In my language I created a way to generate buffers of some size like 
> `buf[64];` however due to how they work (they create a data section of 
> bytes with the size you specify like `data $buf_2 = { b 64 }` you cannot 
> assign variables to declare the size (just like in C) because this size 
> cannot be known at compile-time without pseudo-running the program.

This is something you calculate and keep track of in your frontend.
If you have some array of length N, with base type of size M, then
the size of the array is N*M.

> Therefore I would like to have a sort of `sizeof` function, which takes 

Re: [PATCH] implement _Thread_local storage class 7 months ago

From Michael Forney to ~mcf/cproc

Hey Drew,

Sorry for letting this sit for so long. Lately, I've had some renewed
energy for working on cproc and would like to get this merged
finally.

I have a few minor comments, and I'd also like a test that creates
some thread_local variables with internal and external linkage and
does some loads and stores. If you don't have the time or have lost
context on this, let me know and I can amend it myself.

I'm thinking that I would like to add a field for storage duration
to struct decl, but this is good for now.

Re: VLA status 7 months ago

From Michael Forney to ~mcf/cproc

Nihal Jere <nihal@nihaljere.xyz> wrote:
> Another outstanding issue is that VLAs as function arguments don't work
> yet. Consider:
> 
> int func(int n, int arr[n]);
> 
> n is not recognized as a valid identifier, since currently the scope is
> only created when block parsing starts (if I remember correctly). I
> think we will have to create the scope before parsing parameters, and
> add them as they are parsed for this to work properly.

Ah yes, thanks for the reminder about this.

I ended up deleting struct param since its fields are a subset of

Re: [PATCH] parse: use dynamically sized hashtable for temporaries 7 months ago

From Michael Forney to ~mpu/qbe

Michael Forney <mforney@mforney.org> wrote:
> It seems that everything is able to compile except for one function
> `f17`, which gives
> 
> 	rega.c: dying: cannot have more moves than registers
> 
> I haven't yet tried to minimize the function yet.

The result after creduce+ddmin is attached.