This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, fortran] PR fortran/50981 segmentation fault when trying to access absent elemental actual arg


Hello Mikael,

Mikael Morin wrote:
Regression tested on x86_64-unknown-linux-gnu. OK for 4.7/4.6/4.5[/4.4] ?

OK - thanks for the comprehensive patch explanation and for the patch itself.


+	  else
+	    {
+	      /* Otherwise, evaluate the argument out of the loop and pass
+		 a reference to the value.  */
+	      gfc_conv_expr (&se, expr);

s/out of/outside/


+	  if (dummy_arg != NULL
+	&&  dummy_arg->sym->attr.optional
+	&&  arg->expr
+	&&  arg->expr->symtree
+	&&  arg->expr->symtree->n.sym->attr.optional
+	&&  arg->expr->ref == NULL)
+	    newss->info->data.scalar.can_be_null_ref = true;

I wonder whether one needs to take special care for the following Fortran 2008 feature: "A null pointer can be used to denote an absent nonallocatable nonpoin-
ter optional argument." - I guess, one doesn't.


Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]