On 6/18/26 9:48 AM, Thomas Koenig wrote:
Hi Mikael,

+
+/* Mark the variable of an expression in a vardef context as
+   set and mark everything in the references as used.  */
+
+void
+gfc_expr_set_at (gfc_expr *expr, locus *loc, enum value_set how_set)
+{
+  enum value_used prev_used;
+  gfc_symbol *sym;
+  locus prev_loc;
+
+  if (!expr)
+    return;
+
+  if (expr->expr_type != EXPR_VARIABLE)
+    return;
Don't you need to call gfc_value_used_expr in all cases, including for non- variables?  If I'm understanding well, we are in invalid code territory here, but avoiding a cascade of uninitialized diagnostics remains worth pursuing?

Without this check, I got a few ICEs during development of the patch.
Test testsuite has a lot of invalid code (which it tests for :-)

But it could be an option to not issue the warnings if an error
has already occurred.  What do you (and others) think?

There really is no pint to issuing any warnings after an error occurs. I do wonder about "potential" errors that may be pending during parsing and matching checks. In other words, ought to be issued if there is not another portion of the process that clears it. I may be all wrong on that.


Best regards

     Thomas


Reply via email to