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 #58

Open
andrewchambers opened this issue Mar 24, 2015 · 1 comment
Open

Miscompilation bug #58

andrewchambers opened this issue Mar 24, 2015 · 1 comment

Comments

@andrewchambers
Copy link
Contributor

Compiles and executes with gcc and tcc, aborts at runtime on 8cc.

if you remove the function call, then there is no error, probably error in float argument handling.

void abort(void);

double a = 1.0;

double f(double p1, double p2) {
  return p1 + p2;
}

int main() {
  if (f(a, a) != 2.0)
    abort();
  return 0;
}
@andrewchambers
Copy link
Contributor Author

I should note #55 #56 #57 and #58 are all generated from the gcc torture suite. After automated test case reduction. I have no idea what this means in terms of being GPL derived code, or if we need to rewrite such small test cases.

There were around 80 miscompilations in the gcc torture suite. I have taken a few I hand selected because they look more or less straightforward. I don't want to flood the issue tracker. I can re review the test suite after the existing bugs are resolved.

I am only creating issues for miscompilation for now, because these are so much harder to locate, and can cause problems in real applications.

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

1 participant