Skip to content

Conversation

king258436
Copy link

@king258436 king258436 commented Sep 1, 2024

Fix tests/s-thread.c failure from compiler optimization in ubuntu24.04

$ clang -v
Ubuntu clang version 18.1.3 (1ubuntu1)
t003_thread: diff result of clang -pg -O3 
--- expect      2024-09-02 21:38:09.576036102 +0900
+++ result      2024-09-02 21:38:09.576036102 +0900
@@ -21,4 +21,2 @@
      b() {
-       c() {
-       } /* c */
      } /* b */
@@ -29,4 +27,2 @@
      b() {
-       c() {
-       } /* c */
      } /* b */
@@ -37,4 +33,2 @@
      b() {
-       c() {
-       } /* c */
      } /* b */
@@ -45,4 +39,2 @@
      b() {
-       c() {
-       } /* c */
      } /* b */

003 thread              : OK OK OK OK OK  OK OK OK NG OK

Copy link
Owner

@namhyung namhyung left a comment

Choose a reason for hiding this comment

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

Looks good to me. But can you please add a compiler warning or something to say why it failed? See commit 887f8d2 for example.

@MichelleJin12
Copy link
Contributor

Hi @king258436

You can run
python3 runtest.py 003
python3 runtest.py 003 -c clang -O 3 -p -v
to generate expect and result outputs

@kzall0c
Copy link
Contributor

kzall0c commented Sep 2, 2024

Thank you @king258436! You can find the verbose results with -vdp options. See #1580

Fix tests/s-thread.c failure from compiler optimization in ubuntu24.04,
clang version 18.1.3

Signed-off-by: choi wonsick <[email protected]>
@king258436
Copy link
Author

Looks good to me. But can you please add a compiler warning or something to say why it failed? See commit 887f8d2 for example.

I have updated your feedback. Thank you @namhyung very much for the review.

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.

4 participants