Skip to content

Fix test regressions due to C++ frontend update #8852

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

Merged
merged 8 commits into from
Apr 26, 2022
Merged

Conversation

jketema
Copy link
Contributor

@jketema jketema commented Apr 25, 2022

See the individual commit messages.

Note that 324bd9e and ef6c4c5 need further investigation, but these are non-blocking.

@jketema jketema added depends on internal PR This PR should only be merged in sync with an internal Semmle PR no-change-note-required This PR does not need a change note labels Apr 25, 2022
@jketema jketema requested a review from a team as a code owner April 25, 2022 11:15
@github-actions github-actions bot added the C++ label Apr 25, 2022
@jketema jketema changed the title Fix test regressions due to EDG update Fix test regressions due to C++ frontend update Apr 25, 2022
@@ -48,7 +48,7 @@ int builtin(int x, int y) {
acc++;
}

acc += __atomic_fetch_min(&staticint, x+y, 0);
__atomic_fetch_min(&staticint, x+y, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a bug? From https://clang.llvm.org/docs/LanguageExtensions.html#atomic-min-max-builtins-with-memory-ordering:

The return value is the original value that was stored in memory before comparison.

And since they were added with a return value in https://reviews.llvm.org/D46386, I'd be surprised if there's a version of Clang that doesn't have it.

Copy link
Contributor Author

@jketema jketema Apr 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, seems like it. I just checked the frontend signature and didn't look at what Clang did.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok there's something weird going on with version numbers in the frontend. I changed the clang version number in the test to match the one used in the previous version of the frontend. This fixes the issue without changing the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See: 73e4f0c

MathiasVP
MathiasVP previously approved these changes Apr 25, 2022
Copy link
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jketema
Copy link
Contributor Author

jketema commented Apr 25, 2022

@MathiasVP No concerns about the issue @sashabu flagged up?

Note that I'm still waiting for the DCA experiment to complete (see the internal PR)

@MathiasVP
Copy link
Contributor

@MathiasVP No concerns about the issue @sashabu flagged up?

Oh, yeah. Sorry. I should have been more clear: LGTM except for the issue @sashabu highlighted.

@jketema
Copy link
Contributor Author

jketema commented Apr 25, 2022

@MathiasVP Thanks for clarifying. I'll check with Nick and Ian on the approach to take.

jketema added 8 commits April 25, 2022 21:13
These features are no longer available and the frontend does stricter checking
on this.
The test uses an `auto` return type without a trailing return type, which is
a C++14 feature.
… frontend

There are now more artificial blocks containing more than one instruction
(artificial blocks containing a single instruction have the extractor only
emit that instruction and not the block). The second instruction in each case
is the label for breaking out of a loop or switch.
This ensures that `__atomic_fetch_min` parses and that the number of
builtins does not changed compared to the previous version of the
frontend.
Copy link
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jketema jketema merged commit e7580b6 into github:main Apr 26, 2022
@jketema jketema deleted the edg-6.3 branch April 26, 2022 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ depends on internal PR This PR should only be merged in sync with an internal Semmle PR no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants