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

Relax M table access to variables #146

Merged
merged 3 commits into from
May 31, 2022
Merged

Relax M table access to variables #146

merged 3 commits into from
May 31, 2022

Conversation

Keryan-dev
Copy link
Collaborator

This gets Mlang closer to the expressivity of the legacy compiler by allowing access to table variables through dynamic indexing.
It also removes the hack with the implicit loop variable X.

I feel this is not entirely satisfactory as it introduce writes to specific cells of array, whereas Mlang tried to represent table writes as whole array modifications until now. We should smooth up the way table variables are handled, I'm not sure how.

This also introduces potential out of bound accesses unobservable before runtime. I implemented proper boundary checks in the interpreter only.

@rmonat
Copy link
Contributor

rmonat commented May 31, 2022

I feel this is not entirely satisfactory as it introduce writes to specific cells of array, whereas Mlang tried to represent table writes as whole array modifications until now. We should smooth up the way table variables are handled, I'm not sure how.

We'll need to discuss that. I think we had whole modifications because we thought the original compiler was working this way.

@rmonat
Copy link
Contributor

rmonat commented May 31, 2022

I am encountering some issues with the DGFiP C backend:

  • with OPTIMIZE=0, one test fails: Testing file: fuzzer_2505.m_test Expected value for ICREREVET : 0.0000, computed 4.0000!
  • with OPTIMIZE=1, I have a compilation failure, ./ir_tests.h:4:2: error: unterminated conditional directive #ifndef IR_HEADER_. Maybe the effect of generate_footer is not flushed correctly before the file is closed?

@Keryan-dev
Copy link
Collaborator Author

Keryan-dev commented May 31, 2022

DGFIP backend cannot handle the available testsuite yet, nor optimized code (which breaks the expected interface).

@rmonat rmonat merged commit 32fee5d into master May 31, 2022
@rmonat rmonat deleted the generic-table-access branch May 31, 2022 14:02
mdurero added a commit that referenced this pull request Jun 10, 2022
mdurero added a commit that referenced this pull request Mar 30, 2023
mdurero added a commit that referenced this pull request Jun 30, 2023
mdurero added a commit that referenced this pull request Jul 6, 2023
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.

2 participants