https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119455

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2025-03-25
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Possibly the place to write down something I noticed.  It seems to me that
COBOL is a statically typed language but the GCC COBOL frontend seems to use
something like a type/object descriptor for variables and constants and
dispatching to the GCC COBOL runtime for all operations.  That means the static
types are not exposed to GCCs optimizations and the middle-end has no idea what
is done with all the data meaning optimization opportunities are basically
non-existant unless you'd consider LTOing the GCC COBOL runtime and then having
high hopes for GCC to untangle the thing.

So the optimization that's missing is probably finding appropriate middle-end
types that match the COBOL static types and directly use those for variables
and operations where possible.

I did not spot something like an intermediate COBOL AST being generated during
parsing before handing off to GENERIC, so any such optimization that would
require more than very local operation is probably difficult.

Reply via email to