-
Notifications
You must be signed in to change notification settings - Fork 111
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
Fail to write global variable #12
Comments
It is a known issue that global variable initialization is not supported. Therefore, you can not initialize a global such as |
eecheng87
added a commit
to eecheng87/shecc
that referenced
this issue
Oct 14, 2020
eecheng87
added a commit
to eecheng87/shecc
that referenced
this issue
Oct 15, 2020
Close sysprog21#12 Change test bench
eecheng87
added a commit
to eecheng87/shecc
that referenced
this issue
Oct 15, 2020
Close sysprog21#12 Change test bench Support global expression for initialization
eecheng87
added a commit
to eecheng87/shecc
that referenced
this issue
Oct 16, 2020
Close sysprog21#12 Change test bench Support global expression for initialization Pass code review
eecheng87
added a commit
to eecheng87/shecc
that referenced
this issue
Oct 16, 2020
Close sysprog21#12 Change test bench Support global expression for initialization Pass code review Change for code review
eecheng87
added a commit
to eecheng87/shecc
that referenced
this issue
Oct 16, 2020
Close sysprog21#12 1. To initialize global variable, we need to decide the value before execution time. `read_global_assignment` help us evaluate this immediate value and store it in .data section where store the initial value of variable in generated ELF. 2. This commit doesn't support pointer and array initialization. 3. Add correspond test bench in line 250 of driver.sh.
eecheng87
added a commit
to eecheng87/shecc
that referenced
this issue
Oct 16, 2020
Close sysprog21#12 1. To initialize global variable, we need to decide the value before execution time. `read_global_assignment` help us evaluate this immediate value and store it in .data section where store the initial value of variable in generated ELF. 2. This commit doesn't support pointer and array initialization. 3. Add global initialization item in test driver.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I am trying to add feature: global variable initialization.
I modify some code and it seems good when I dump IR, following is simple sample
corresponding C code
As I mention, it seems good for assigning initial value to
a
in IR, but the value printed is 0. This weird stuff stuck me a few day. Anything I ignore about writing value to global variable? Thanks!The text was updated successfully, but these errors were encountered: