Re: [patch, fortran] Fix ICE on invalid, PR 94090

2020-04-15 Thread Fritz Reese via Gcc-patches
On Wed, Apr 15, 2020 at 1:47 PM Thomas Koenig wrote: > > Hi Fritz, > > > While you're touching the code anyway, how would you feel about > > replacing the nearby "goto done"s with a chain of "else if"? There's > > really no reason I can see for goto here, since the block following > > the conditio

Re: [patch, fortran] Fix ICE on invalid, PR 94090

2020-04-15 Thread Thomas Koenig via Gcc-patches
Hi Fritz, While you're touching the code anyway, how would you feel about replacing the nearby "goto done"s with a chain of "else if"? There's really no reason I can see for goto here, since the block following the conditions is already "done". I think this would really be pushing things at st

Re: [patch, fortran] Fix ICE on invalid, PR 94090

2020-04-15 Thread Fritz Reese via Gcc-patches
> Yes. Looking back at the code, I think it can also be cleaned up > a little - turning the error to warnings is only needed on that > particular branch, and resetting it to the default can also > happen there, and at the target of a goto statement. > > So, here's an updated patch. OK for trunk?

Re: [patch, fortran] Fix ICE on invalid, PR 94090

2020-04-15 Thread Thomas Koenig via Gcc-patches
Am 15.04.20 um 12:33 schrieb Tobias Burnus: On 4/15/20 12:26 PM, Thomas Koenig via Fortran wrote: +   /* Turn erros into warnings with -std=gnu and -std=legacy, Only glanced at it – but can you also fix the old* typo "erro(r)s"? Yes, I think I can manage that :-) Regards Thomas

Re: [patch, fortran] Fix ICE on invalid, PR 94090

2020-04-15 Thread Tobias Burnus
On 4/15/20 12:26 PM, Thomas Koenig via Fortran wrote: + /* Turn erros into warnings with -std=gnu and -std=legacy, Only glanced at it – but can you also fix the old* typo "erro(r)s"? Tobias (*old as the comment block has been moved around) - Mentor Graphics (Deutschland

Re: [patch, fortran] Fix ICE on invalid, PR 94090

2020-04-15 Thread Thomas Koenig via Gcc-patches
Hi Fritz, I wonder: could you simply replace the gfc_error_opt(0, ...) call with gfc_error? Yes. Looking back at the code, I think it can also be cleaned up a little - turning the error to warnings is only needed on that particular branch, and resetting it to the default can also happen there

Re: [patch, fortran] Fix ICE on invalid, PR 94090

2020-04-13 Thread Fritz Reese via Gcc-patches
On Mon, Apr 13, 2020 at 10:20 AM Thomas Koenig via Fortran wrote: > > Hello world, > > the attached patch fixes an ICE on invalid: When the return type of > a function was misdeclared with a wrong rank, we issued a warning, > but not an error (unless with -pedantic); later on, an ICE ensued. > > N