A68 consolidates refs when lowering formulas
The Algol 68 front end now correctly handles references within formulas during the lowering process by consolidating operands.
The Algol 68 front end in GCC has been updated to consolidate operands for both monadic and dyadic formulas before making calls. This ensures that parameters expecting references receive the correct address, resolving an issue where such references were not properly handled during the lowering of formulas.
In Details
The Algol 68 front end (a68) is responsible for parsing and processing Algol 68 code within GCC. This change specifically targets the a68-low-units.cc file, which handles the lowering of Algol 68 constructs into a more generic intermediate representation. The fix relates to how a68_lower_formula and a68_lower_monadic_formula manage references (pointers) within formulas, ensuring they are correctly consolidated before use. This prevents potential issues where parameters expecting memory addresses might receive incorrect or uninitialized values.
For Context
Compilers like GCC translate human-readable source code into machine code. This commit is for the Algol 68 front end, which is the part of GCC that understands the Algol 68 programming language. When programs use 'formulas' (like mathematical expressions or function calls), and these formulas involve 'references' (which are essentially pointers to memory locations), the compiler needs to make sure it's always working with the correct memory address. This update ensures that during an intermediate translation step (called 'lowering'), the compiler correctly identifies and uses the right memory addresses for these references, preventing potential errors or crashes in the compiled program.