a68: Use TYPE_CANONICAL for type comparisons in assignment [PR algol68/127977]
Correctly compares types using TYPE_CANONICAL in algol68 assignment to handle typedefs.
This commit updates the algol68 front-end to use TYPE_CANONICAL for type comparisons during assignment operations. Previously, it incorrectly used SET_TYPE_STRUCTURAL_EQUALITY. This change is necessary because the compiler now emits typedefs, and TYPE_CANONICAL correctly resolves type equivalence, preventing incorrect assignments and addressing PR algol68/127977.
In Details
The algol68 front-end's lowering pass now correctly uses TYPE_CANONICAL to compare types in a68_low_assignation and related functions, rather than SET_TYPE_STRUCTURAL_EQUALITY. This aligns with the front-end's emission of typedefs, ensuring that type equivalence is determined by the canonical type rather than structural similarity, fixing PR algol68/127977.
- TYPE_CANONICAL
- A GCC internal representation that denotes the canonical or fundamental type, resolving aliases and typedefs.
- SET_TYPE_STRUCTURAL_EQUALITY
- A GCC internal function or macro that establishes type equality based on the structure of the types, not their names or aliases.
- typedef
- A keyword in C-like languages (and adopted in some compiler internals) used to create an alias for an existing type. The compiler must correctly resolve these aliases.
- algol68
- The Algol 68 programming language, known for its complex type system.
- front-end
- The initial part of a compiler that parses source code, performs semantic analysis, and generates an intermediate representation (IR).