GCC ME

2025-05-11 Thread sa8210821--- via Gcc



Yahoo Mail: Search, Organize, Conquer


Re: Testing for prototypes generated from Fortran

2025-05-11 Thread Richard Biener via Gcc
On Sun, May 11, 2025 at 8:38 PM Harald Anlauf  wrote:
>
> Hi Thomas,
>
> Am 11.05.25 um 12:51 schrieb Thomas Koenig via Gcc:
> > Hi Harald,
> >
> >> Hi Thomas,
> >>
> >> On 5/11/25 10:34, Thomas Koenig via Gcc wrote:
> >>> As PR120139 has shown (again), it is too easy to create regressions
> >>> for dumping C prototypes from Fortran.  The main problem
> >>> is that there is currently no test in the testsuite.
> >>>
> >
> >> for something along this variant you can try multiline-output
> >> as in the attached sample.
> >>
> >> There may be better ways...
> >
> > Hm, this could work. This would have the disadvantage that any
> > change to the generated file would show up as "regression" on
> > testing, even if it was not relevant to the test.
> >
> > Is there maybe something along the lines of "match the compiler
> > output for a certain pattern and discard everything else" in
> > dejagnu? I tried finding it in the docs, but I didn't find anything
> > that would work.
>
> the only thing that I am aware is writing multiple dg-output's with
> suitable regexes.  This allow to check that something is *present*,
> but I did not find the negation, i.e. absence of something not wanted.

I would suggest to try writing some new dejagnu harness that has
a two-stage compilation, generating the C prototypes from fortran
part of a testcase and compiling a C part of a testcase using the
prototypes.  I'm not sure whether eventually you can achieve this
with

! { dg-options "-fc-prototypes" }
! { dg-additional-sources "foo.c" }

aka, whether foo.c is then reliably compiled _after_ the fortran source

Richard.

> Good luck,
> Harald
>
> > Best regards
> >
> >  Thomas
> >
> >
>


gcc-16-20250511 is now available

2025-05-11 Thread GCC Administrator via Gcc
Snapshot gcc-16-20250511 is now available on
  https://gcc.gnu.org/pub/gcc/snapshots/16-20250511/
and on various mirrors, see https://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 16 git branch
with the following options: git://gcc.gnu.org/git/gcc.git branch master 
revision 37e61c793c1b22bdcfbf142cd6086da2745be596

You'll find:

 gcc-16-20250511.tar.xz   Complete GCC

  SHA256=4086bd9369a82d087d1bd60e2fdd926ee0401115a52542d962c085bf99f41a24
  SHA1=edbf62be0efa02feb61677bdd1b9b97e01139eef

Diffs from 16-20250504 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-16
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.


Пријавите се на Google налог

2025-05-11 Thread Google via Gcc

Ово је копија обавештења о безбедности послатог на nenadi...@gmail.com.
gcc@gcc.gnu.org је имејл за враћање приступа за овај налог. Ако не
препознајете овај налог, уклоните

га.
[image: Google]
Пријавите се на Google налог


nenadi...@gmail.com

Примили сте ову поруку јер Google налог није коришћен најмање 8 месеци.

Да би вам Google налог остао активан, одвојите мало времена да бисте се
пријавили

.

Ако се Google налог не користи у периоду од 2 године, Google може да га
избрише, као и његове активности и податке.

Сазнајте више о Смерницама за неактиван Google налог

Пријави ме

Шаљемо вам овај имејл да бисмо вас обавестили о важним променама на Google
налогу и услугама.
© 2025 Google LLC, 1600 Amphitheatre Parkway, Mountain View, CA 94043, USA


Re: Testing for prototypes generated from Fortran

2025-05-11 Thread Thomas Koenig via Gcc

Hi Harald,


Hi Thomas,

On 5/11/25 10:34, Thomas Koenig via Gcc wrote:

As PR120139 has shown (again), it is too easy to create regressions
for dumping C prototypes from Fortran.  The main problem
is that there is currently no test in the testsuite.




for something along this variant you can try multiline-output
as in the attached sample.

There may be better ways...


Hm, this could work. This would have the disadvantage that any
change to the generated file would show up as "regression" on
testing, even if it was not relevant to the test.

Is there maybe something along the lines of "match the compiler
output for a certain pattern and discard everything else" in
dejagnu? I tried finding it in the docs, but I didn't find anything
that would work.

Best regards

Thomas



Testing for prototypes generated from Fortran

2025-05-11 Thread Thomas Koenig via Gcc

As PR120139 has shown (again), it is too easy to create regressions
for dumping C prototypes from Fortran.  The main problem
is that there is currently no test in the testsuite.

So, what to do?  I see several possibilities:

1a) Change the relevant options so that they optionally
create a file (something like -fc-prototypes=filename.h)
and then scan for the presence/absence of patterns in that
file.  (Is it OK just to open and close a file anywhere
in the front end?). The generated files should then be
removed afterwards (how?).

1b) Instead of checking for patterns in the output create a header file
which is then included in a C file for testing.  Same questions
as above, with the additional question on how to ensure that
compilation of the C file only happens after the header file
has been generated.

2) Dump to standard output and check for the presence of certain
regexps, ignoring anything else.  Again, this is something I don't
know how to do.

This is really something I would like to have fixed for gcc-16.

Other ideas? Comments? Suggestions?

Best regards

Thomas




Re: Testing for prototypes generated from Fortran

2025-05-11 Thread Harald Anlauf via Gcc

Hi Thomas,

On 5/11/25 10:34, Thomas Koenig via Gcc wrote:

As PR120139 has shown (again), it is too easy to create regressions
for dumping C prototypes from Fortran.  The main problem
is that there is currently no test in the testsuite.

So, what to do?  I see several possibilities:

1a) Change the relevant options so that they optionally
create a file (something like -fc-prototypes=filename.h)
and then scan for the presence/absence of patterns in that
file.  (Is it OK just to open and close a file anywhere
in the front end?). The generated files should then be
removed afterwards (how?).

1b) Instead of checking for patterns in the output create a header file
which is then included in a C file for testing.  Same questions
as above, with the additional question on how to ensure that
compilation of the C file only happens after the header file
has been generated.

2) Dump to standard output and check for the presence of certain
regexps, ignoring anything else.  Again, this is something I don't
know how to do.


for something along this variant you can try multiline-output
as in the attached sample.

There may be better ways...

Cheers,
Harald


This is really something I would like to have fixed for gcc-16.

Other ideas? Comments? Suggestions?

Best regards

 Thomas



! { dg-options "-fc-prototypes" }

subroutine foo (x, k) bind(c)
  integer, value :: k
  real   :: x(k)
end

#if 0
{ dg-begin-multiline-output "" }
#include 
#ifdef __cplusplus
#include 
#define __GFORTRAN_FLOAT_COMPLEX std::complex
#define __GFORTRAN_DOUBLE_COMPLEX std::complex
#define __GFORTRAN_LONG_DOUBLE_COMPLEX std::complex
extern "C" {
#else
#define __GFORTRAN_FLOAT_COMPLEX float _Complex
#define __GFORTRAN_DOUBLE_COMPLEX double _Complex
#define __GFORTRAN_LONG_DOUBLE_COMPLEX long double _Complex
#endif

void foo (float x /* WARNING: non-interoperable KIND */ , int k /* WARNING: non-interoperable KIND */ );

#ifdef __cplusplus
}
#endif
{ dg-end-multiline-output "" }
#endif


Re: Testing for prototypes generated from Fortran

2025-05-11 Thread Harald Anlauf via Gcc

Hi Thomas,

Am 11.05.25 um 12:51 schrieb Thomas Koenig via Gcc:

Hi Harald,


Hi Thomas,

On 5/11/25 10:34, Thomas Koenig via Gcc wrote:

As PR120139 has shown (again), it is too easy to create regressions
for dumping C prototypes from Fortran.  The main problem
is that there is currently no test in the testsuite.




for something along this variant you can try multiline-output
as in the attached sample.

There may be better ways...


Hm, this could work. This would have the disadvantage that any
change to the generated file would show up as "regression" on
testing, even if it was not relevant to the test.

Is there maybe something along the lines of "match the compiler
output for a certain pattern and discard everything else" in
dejagnu? I tried finding it in the docs, but I didn't find anything
that would work.


the only thing that I am aware is writing multiple dg-output's with
suitable regexes.  This allow to check that something is *present*,
but I did not find the negation, i.e. absence of something not wanted.

Good luck,
Harald


Best regards

 Thomas






Re: Testing for prototypes generated from Fortran

2025-05-11 Thread Ben Boeckel via Gcc
On Sun, May 11, 2025 at 10:34:11 +0200, Thomas Koenig via Gcc wrote:
> 2) Dump to standard output and check for the presence of certain
> regexps, ignoring anything else.  Again, this is something I don't
> know how to do.

This is…fraught with peril and fiddliness. If the test can stomach some
C++, you can use `` to `static_assert` on declaration
properties. See this test as an example of how we ensure ABI stability
as far as the header is concerned:


https://gitlab.kitware.com/paraview/catalyst/-/blob/master/tests/abi_tests/test_catalyst_abi.cpp

--Ben