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

Stop generating _d_eh_personality with -betterC #3480

Conversation

kubo39
Copy link
Contributor

@kubo39 kubo39 commented Jun 28, 2020

Closes #3479

@kubo39 kubo39 force-pushed the betterc-no-generate-eh_personality branch from 0578f17 to c7181f9 Compare June 28, 2020 02:33
@kubo39
Copy link
Contributor Author

kubo39 commented Jun 28, 2020

Hmm, it seems ldc should not generate landing pads when --checkaction=halt was given.
Edit: Ahh, checkaction should affect assert/boundscheck/final-switch only..

@kubo39 kubo39 force-pushed the betterc-no-generate-eh_personality branch from c7181f9 to 73d5d6b Compare June 28, 2020 06:48
@kinke
Copy link
Member

kinke commented Jun 28, 2020

Thx for tackling this. - The issue should be the same as reported in the forum a short while ago, and which I've redirected to https://issues.dlang.org/show_bug.cgi?id=20897, because I think the frontend should take care of not emitting any TryFinallyStatements in betterC mode (everything that can be handled there is to be preferred, so that we don't have these ugly special cases in each compiler backend). It generates this AST for the testcase:

int a = 5;
try
{
    create(0u, 1u, "2");
    return 0;
}
finally
    a = 6;

and expects each compiler to further lower this to:

int a = 5;
{
    create(0u, 1u, "2");
    return 0;
}
{
    a = 6;
}

which it trivially can and should do itself. Edit: And which it already does for manual try/finally written by the user.

@kinke
Copy link
Member

kinke commented Jun 28, 2020

Ouch, I've completely overlooked that return 0...

@kubo39
Copy link
Contributor Author

kubo39 commented Jun 28, 2020

Thanks for having a look, I agree with that so closing this.

@kubo39 kubo39 closed this Jun 28, 2020
kinke added a commit to kinke/ldc that referenced this pull request Jun 28, 2020
@kubo39 kubo39 deleted the betterc-no-generate-eh_personality branch June 28, 2020 15:55
kinke added a commit that referenced this pull request Jun 29, 2020
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

Successfully merging this pull request may close these issues.

linker error with scope(exit) with betterC
2 participants