~techcable

Arizona, USA

https://techcable.net

Developer | Student | Semi-retired Minecraft dev | Compiler Nerd 🤓

Recent activity

Issue with `minic` generating incorrect QBE IR for varadic functions (crashes on M1 Macs) 3 months ago

From Techcable to ~mpu/qbe

Hi,

I've been playing around with QBE on my M1 Macbook Pro using the apple-m1 branch (commit c8cd2824ea).

I kept failing to get correct output with the 'minic' compiler.

Here were the commands I used:
./minic < test/euler9.c > euler9.qbe
../qbe -tarm64 -Gm -o euler9.s euler9.qbe
clang euler9.s -o euler9

This printed some garbage instead of the correct solution I had for the Euler 9 problem (website shows the answer after you solve it).

I assumed this was an ABI problem, but it turns out this is an issue with the IR output from minic.