On Sat, Mar 15, 2025 at 3:46 AM Tobias Burnus <tbur...@baylibre.com> wrote:
>
> I wonder why sometimes my line breaks are preserved and at other times all 
> eaten.
>
> Next try ...
>
> Tobias Burnus wrote:
>
> Hi Thomas,
>
> Thomas Koenig wrote:
> > Just one question - as this will change the module file, will we still
> > be compatible with reading gfortran 8 to gfortran 14-written module
> > files?
>
> It shouldn't. On writing there is:
>
> * mio_omp_declare_simd [old function, additional condition]:
>
> if (*odsp == NULL)
>
>    {
>
>       if (ns->omp_declare_variant)
>
>        {
>
>          mio_lparen ();
>
>          mio_rparen ();
>        }
>
>        return;
>
>
> Thus, on writing, it only writes '(' if there is
> a 'declare simd' (with its context, unchanged) - or (new) an empty '( )'
> if there is a 'declare variant'.
>
> * mio_omp_declare_variant itself has the code:
>
>
> if (iomode == IO_OUTPUT)
>
>    {
>
>      if (*odvp == NULL) return;
>
> Thus, if there is no 'declare variant', the output for 'declare simd'
> should the same as before - and the code is simple enough that I would
> even claim 'is' (unless the memory is corrupted).
>
>
> And as the output remains the same in that case, there should be also
> no problem reading  both old .mod files with new compiler - and even
> the reverse, i.e. reading .mod files, written by after this patch, with
> an old GCC version. [The latter will fail due to the recent version bump, but
> that's unrelated to this patch.]
>
>
> The only potentially failing cases are:
>
> * Code that contains 'declare variant' that is written by a new
> compiler, but read by an old compiler (missing downward compatibility).
>
> But due to the version bump in GCC 15 (r15-6704-g21ee71afa72746;Jan
> 25, 2025), this only affects GCC 15 version between January and March -
> and only when the module contained 'declare variant'. [The mode-reading
> error is that the code stumbles over the '(' [ followed by some items
> and ')'] - while expecting the outer ')'.]
>
>
> * Some bug in the added code.
>
> This is very unlikely to hit code without 'declare variant', but there
> is some chance that I missed some corner case with 'declare variant'
> present - which might either cause missing data, wrong data (that might
> cause later fails [ICE, bogus diagnostic, wrong code]) or even a .mod
> reading issue. - While I ran into all those issues (with declare variant
> present) - fund in course of writing the test cases, I hope that I found
> most if not all such bugs.
>
>
> Thus, we should be all fine. I guess, we
> eventually will have some additions to the context selectors in the
> 'match' clauses, which will break downward (but not upward)
> compatibility. At least the TODO in openmp.cc implies that some work is
> needed and there is some chance that the current code will not handle
> it. (That's tracked as https://gcc.gnu.org/PR113067 )
>
> Cheers,
>
> Tobias
>

I got

gfortran: fatal error: cannot read spec file 'libgomp.spec': No such
file or directory
compilation terminated.
compiler exited with status 1
FAIL: gfortran.dg/gomp/declare-variant-mod-1.f90   -O  (test for excess errors)
Excess errors:


-- 
H.J.

Reply via email to