https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108501
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2023-01-23
Keywords|ice-on-invalid-code |ice-on-valid-code,
| |rejects-valid
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
CC| |anlauf at gcc dot gnu.org
--- Comment #1 from anlauf at gcc dot gnu.org ---
First, I think the code is actually valid, adjusting keywords.
Furthermore, there are two issues here, an underlying one, namely that
we reject the following:
program p
real, parameter :: n = 2
real :: a(1,(n),2)
end
pr108501.f90:3:14:
3 | real :: a(1,(n),2)
| 1
Error: Expression at (1) must be of INTEGER type, found REAL
pr108501.f90:3:20:
3 | real :: a(1,(n),2)
| 1
Error: The module or main program array 'a' at (1) must have constant shape
This is already present in gcc-7, so although it is a nasty bug, it's not
a regression.
The other issue is likely exposed by this misbehavior, leading to an ICE
when checking the argument of the call in get_expr_storage_size.
This issue is also present in all versions down to at least gcc-7,
so arguably not really a regression.
I have a patch for the latter.