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

Transformation assert causes GNU inline merging problems with -O3 #1130

Open
J2000A opened this issue Jul 25, 2023 · 5 comments
Open

Transformation assert causes GNU inline merging problems with -O3 #1130

J2000A opened this issue Jul 25, 2023 · 5 comments
Labels
bug transform Code transformations

Comments

@J2000A
Copy link
Contributor

J2000A commented Jul 25, 2023

During the implementation for my bachelor thesis about generating test cases for the incremental analysis I encountered a problem with the flag -O3. Possibly some merging problems with GNU inline? @stilscher

Reproduce by:
echo "main(){}" > input.c
./goblint input.c --enable trans.goblint-check --set trans.activated '["assert"]' --set pre.cppflags[+] -O3
./goblint transformed.c --set pre.cppflags[+] -O3 --enable incremental.save
./goblint transformed.c --set pre.cppflags[+] -O3 --enable incremental.load

This results in the error:
Fatal error: exception Failure("there can only be one definition and one declaration per global")

Output of cat transformed.c | grep pthread_equal:

__inline extern int ( __attribute__((__leaf__, __gnu_inline__)) pthread_equal)(pthread_t __thread1 ,
__inline extern int ( __attribute__((__leaf__, __gnu_inline__)) pthread_equal)(pthread_t __thread1 ,
__inline extern int ( __attribute__((__leaf__, __gnu_inline__)) pthread_equal)(pthread_t __thread1 ,
__inline extern int ( __attribute__((__leaf__, __gnu_inline__)) pthread_equal)(pthread_t __thread1 ,

vs when not using --set pre.cppflags[+] -O3:

extern int ( __attribute__((__leaf__)) pthread_equal)(pthread_t __thread1 ,
@michael-schwarz
Copy link
Member

Is this only an issue for files that have been transformed using Goblint? If yes, I would once again suggest to move the issue over to the analyzer repository.

@J2000A
Copy link
Contributor Author

J2000A commented Aug 4, 2023

Hey @michael-schwarz,
yeah you are right this also should go to the analyzer repo 👍

@J2000A J2000A changed the title -O3 GNU inline merging problems when using incremental analysis Transformation assert causes GNU inline merging problems with -O3 Aug 5, 2023
@J2000A
Copy link
Contributor Author

J2000A commented Aug 5, 2023

I will repost this in the analyzer repo

@J2000A J2000A closed this as completed Aug 5, 2023
@michael-schwarz
Copy link
Member

I'll move it instead!

@michael-schwarz michael-schwarz transferred this issue from goblint/cil Aug 5, 2023
@sim642
Copy link
Member

sim642 commented Aug 5, 2023

This could be the same CIL issue: goblint/cil#142. It's only in incremental comparison where Goblint carefully assumes and checks that the CIL invariant holds.

@sim642 sim642 added bug transform Code transformations labels Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug transform Code transformations
Projects
None yet
Development

No branches or pull requests

3 participants