stormalf / chibicc

A small C compiler from rui314
MIT License
6 stars 1 forks source link

ISS-141 improving extended assembly management #24

Closed stormalf closed 1 year ago

stormalf commented 1 year ago

For now lots of the extended assembly code generated don't work as gcc. Sometimes chibicc generates different result than gcc for the same extended assembly code. Sometimes it fails with segmentation fault because some values are hard-coded like the first variable offset and 3 cases found but not the reason of that : case 1 : the first variable starts at offset -12(%rbp). case 2 : the first variable starts at offset -24(%rbp). case 3: the first variable starts at offset -16(%rbp). Need to check if we can handle differently and need to study ABI convention or other compiler to know how they manage extended assembly.