Hi Paul,
Am 20.05.24 um 11:06 schrieb Paul Richard Thomas:
Hi All,
I don't think that this PR is really a regression although the fact that it
is marked as such brought it to my attention :-)
The fix turned out to be remarkably simple. It was found after going down a
silly number of rabbit holes, though!
The chunk in dependency.cc is probably more elaborate than it needs to be.
Returning -2 is sufficient for the testcase to work. Otherwise, the
comments in the patch say it all.
this part looks OK, but can you elaborate on this change to expr.cc:
diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc
index c883966646c..4ee2ad55915 100644
--- a/gcc/fortran/expr.cc
+++ b/gcc/fortran/expr.cc
@@ -3210,6 +3210,11 @@ gfc_reduce_init_expr (gfc_expr *expr)
{
bool t;
+ /* It is far too early to resolve a class compcall. Punt to
resolution. */
+ if (expr && expr->expr_type == EXPR_COMPCALL
+ && expr->symtree->n.sym->ts.type == BT_CLASS)
+ return true;
+
I would have expected to return 'false' here, as we do not
have an expression that reduces to a constant. What am I
missing?
(The testcase compiles and works here also when using 'false'.)
OK for mainline? I will delay for a month before backporting.
OK if can you show me wrong...
Thanks,
Harald
Regards
Paul