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

Fatal error: exception Env.Error "Unbound struct 'S'" #120

Closed
zhendongsu opened this issue Aug 18, 2016 · 8 comments
Closed

Fatal error: exception Env.Error "Unbound struct 'S'" #120

zhendongsu opened this issue Aug 18, 2016 · 8 comments

Comments

@zhendongsu
Copy link

$ ccomp -version
The CompCert C verified compiler, version 2.7.1
$
$ ccomp small.c
small.c:1: Error: incomplete type struct S.
Fatal error: exception Env.Error "Unbound struct 'S'"
Raised at file "cparser/Env.ml", line 173, characters 9-48
Called from file "cparser/Cutil.ml", line 147, characters 15-36
Called from file "cparser/Cutil.ml", line 408, characters 28-54
Called from file "cparser/Ceval.ml", line 244, characters 18-32
Called from file "cparser/Ceval.ml", line 267, characters 41-53
Called from file "cparser/Elab.ml", line 625, characters 18-45
Called from file "cparser/Elab.ml", line 727, characters 6-49
Called from file "cparser/Elab.ml", line 93, characters 24-32
Called from file "cparser/Elab.ml", line 734, characters 3-35
Called from file "cparser/Elab.ml", line 2171, characters 8-52
Called from file "cparser/Elab.ml", line 2186, characters 26-54
Called from file "cparser/Elab.ml", line 2441, characters 9-63
Called from file "cparser/Parse.ml", line 76, characters 15-59
Called from file "driver/Frontend.ml", line 58, characters 10-59
Called from file "driver/Driver.ml", line 72, characters 12-41
Called from file "driver/Driveraux.ml", line 140, characters 34-40
Called from file "driver/Driver.ml", line 548, characters 22-70
$
$ cat small.c
int a[alignof(struct S)];
$

@zhendongsu
Copy link
Author

Formatting has messed up the code, which should have been:

int a[__alignof__(struct S)];

@bschommer
Copy link
Member

Fixed by commit 98427e8.

@zhendongsu
Copy link
Author

Thanks for the fix, @bschommer!

BTW, are you able to reproduce #113? I see that it's still open after a few days.

@m-schmidt
Copy link
Member

Yes we can reproduce it. Fix in in the works.

@zhendongsu
Copy link
Author

Great; thanks.

@xavierleroy
Copy link
Contributor

Please don't rush. I'd like to look at #113 myself but I am currently busy with the death of a close relative.

@m-schmidt
Copy link
Member

Regarding this problem: I had a look into IRC.ml. Is it legal to call "IRC.add_pref g a b" with a and b being the same variable?

Michael Schmidt

On 19 Aug 2016, at 19:38, Xavier Leroy notifications@github.com wrote:

Please don't rush. I'd like to look at #113 myself but I am currently busy with the death of a close relative.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@xavierleroy
Copy link
Contributor

xavierleroy commented Aug 24, 2016

We really need to move this discussion out of this report. Commit 954b01e plausibly fixes the issue with #113.

Concerning IRC.add_pref a b, I don't think anything goes wrong if a = b. Eventually, IRC.coalesce will drop this move. But clearly this is wasteful in memory (more moves are recorded) and perhaps in speed of register allocation, so we should shortcut this case.

bschommer added a commit that referenced this issue May 29, 2018
As the standard says (and is already implemented) an _Alignas(0)
does not change the alignment at all. The same holds for the gcc
attribute.
Bug 23387
Lionel-Rieg pushed a commit to Lionel-Rieg/CompCert that referenced this issue Apr 21, 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

No branches or pull requests

4 participants