Landing: 2dcdb2463f89

Project / Subsystem

gcc / fortran

Date

2026-06-06

Author

Harald Anlauf

Commit

2dcdb2463f89930b8cdd2b15f962bd3df5dd83f7

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
fortran
patch_id
commit_hash
2dcdb2463f89930b8cdd2b15f962bd3df5dd83f7
source_type
github
headline
Fortran: Fixes ICE with LOC intrinsic on polymorphic argument
tldr
GCC's Fortran compiler fixes an internal compiler error when using the LOC intrinsic with polymorphic arguments, improving stability for advanced Fortran featu…
author
Harald Anlauf
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • fortran
  • bugfix
  • intrinsics
  • polymorphism
discussion_id_link
bugzilla_pr
date
2026-06-06T00:00:00.000Z

This commit resolves an Internal Compiler Error (ICE) in GCC’s Fortran front-end that occurred when the LOC() intrinsic function was used with a polymorphic argument, as reported in PR125606. The issue stemmed from a side effect of a previous fix (PR122977) that caused gfc_is_simply_contiguous to return false for SELECT TYPE temporaries. The correction now ensures that when the argument is not scalar or simply contiguous, the compiler gracefully falls back to taking the address of the argument array’s first element, preventing the ICE.