Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miscompilation bug #56

Open
andrewchambers opened this issue Mar 24, 2015 · 2 comments
Open

Miscompilation bug #56

andrewchambers opened this issue Mar 24, 2015 · 2 comments

Comments

@andrewchambers
Copy link
Contributor

Following code aborts with 8cc at runtime, works with gcc 4.9.2 and tcc 0.9.26.

void abort(void);
void exit(int status);

struct {
  unsigned x2 : 2;
  unsigned x3 : 3;
} a = {2, 3} , *b = &a;

int main() {
  b->x3 += b->x2;
  if (b->x3 != 5)
    abort();
  exit(0);
}
@sandeep06011991
Copy link

Hi
I am a beginner looking to learn compiler theory side by side while working on real projects . I am backend developer with no experience here yet . Can I pick this bug for a beginner or could you suggest some other issue . Thanks

@andrewchambers
Copy link
Contributor Author

The backend for 8cc is not too complicated, though @rui314 doesn't seem to be maintaining this project actively at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants