zig icon indicating copy to clipboard operation
zig copied to clipboard

C backend fixes

Open jacobly0 opened this issue 3 years ago • 2 comments

This enabled all of the behavior tests for the C backend that were passing and fixed all of the C warnings from the flags -Wextra -Wall -pedantic for the behavior tests except various unused (but set) and uninitalized (only with safety off) warnings, and then fixes a bunch of disabled behavior tests.

Some notable C backend milestones achieved with these changes:

  • The C backend is now passing 87% (1191/1366) of the behavior tests vs the LLVM backend.
  • The official hello world now works on at least x86_64-linux (with and without libc).
  • The test runner now prints output to the console.

Fixes #12751 Fixes #11651

jacobly0 avatar Oct 07 '22 02:10 jacobly0

I know this PR is still in draft, but could you extract 1cc6a95 into its own PR? It will make this and the new PR easier to review and we can merge the fixes separately from the C backend improvements. Especially as the fix contains changes to all of the native backends also, which was quite easy to miss from the title and description of this PR.

Luukdegram avatar Oct 11 '22 11:10 Luukdegram

Looking forward to this!

andrewrk avatar Oct 15 '22 18:10 andrewrk

std: add cbe hacks to more targets

Interesting :thinking:

I'm going to look into enhancing the lowering of inline assembly, so that it can automatically do these transforms (e.g. turning "{x8}" to "{i}" and inserting a "mov" when inside a naked function body). In the meantime, these hacks are nice workarounds :+1:

andrewrk avatar Oct 23 '22 18:10 andrewrk

Related: #13278

andrewrk avatar Oct 23 '22 20:10 andrewrk

Is this still intentionally a draft, or are you perhaps looking for review & merge now?

andrewrk avatar Oct 29 '22 20:10 andrewrk

This is in as good a state as any to review and merge. I can always open a new PR with further fixes.

jacobly0 avatar Oct 29 '22 20:10 jacobly0