Re: [Patch, fortran] PR103312 - [11/12/13/14/15 Regression] ICE in gfc_find_component since r9-1098-g3cf89a7b992d483e

2024-05-21 Thread Harald Anlauf

Hi Paul,

Am 20.05.24 um 11:06 schrieb Paul Richard Thomas:

Hi All,

I don't think that this PR is really a regression although the fact that it
is marked as such brought it to my attention :-)

The fix turned out to be remarkably simple. It was found after going down a
silly number of rabbit holes, though!

The chunk in dependency.cc is probably more elaborate than it needs to be.
Returning -2 is sufficient for the testcase to work. Otherwise, the
comments in the patch say it all.


this part looks OK, but can you elaborate on this change to expr.cc:

diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc
index c883966646c..4ee2ad55915 100644
--- a/gcc/fortran/expr.cc
+++ b/gcc/fortran/expr.cc
@@ -3210,6 +3210,11 @@ gfc_reduce_init_expr (gfc_expr *expr)
 {
   bool t;

+  /* It is far too early to resolve a class compcall. Punt to
resolution.  */
+  if (expr && expr->expr_type == EXPR_COMPCALL
+  && expr->symtree->n.sym->ts.type == BT_CLASS)
+return true;
+

I would have expected to return 'false' here, as we do not
have an expression that reduces to a constant.  What am I
missing?

(The testcase compiles and works here also when using 'false'.)


OK for mainline? I will delay for a month before backporting.


OK if can you show me wrong...

Thanks,
Harald


Regards

Paul





[PING] [PATCH] Fortran: fix bounds check for assignment, class component [PR86100]

2024-05-21 Thread Harald Anlauf

Am 13.05.24 um 22:27 schrieb Harald Anlauf:

Dear all,

the attached patch does two things:

- it fixes a bogus array bounds check when deep-copying a class component
   of a derived type and the class component has rank > 1, the reason being
   that the previous code compared the full size of one side with the size
   of the first dimension of the other

- the bounds-check error message that was generated e.g. by an allocate
   statement with conflicting sizes in the allocation and the source-expr
   will now use an improved abbreviated name pointing to the component
   involved, which was introduced in 14-development.

What I could not resolve: a deep copy may still create no useful array
name in the error message (which I am now unable to trigger).  If someone
sees how to extract it reliably from the tree, please let me know.

Regtested on x86_64-pc-linux-gnu.  OK for mainline?

I would like to backport this to 14-branch after a decent delay.

Thanks,
Harald





Re: [Patch] Fortran: invoke.texi - link to OpenCoarrays.org + mention libcaf_single

2024-05-21 Thread Tobias Burnus

Hi Bernhard,

rep.dot@gmail.com wrote:

library such as @url{http://opencoarrays.org} needs to be linked.

Maybe use https?


Works, but as the certificate is not valid, it requires to ignore the 
errors in a browser, which is a worse user experience.


The error is, e.g.,

"curl: (60) SSL certificate problem: self-signed certificate"

Or at 
https://www.ssllabs.com/ssltest/analyze.html?d=www.opencoarrays.org=on


"Common names: invalid-sni.invalid / Issuer: invalid-sni.invalidĀ  
(Self-signed)"


@Damian: Can you fix the server to actually have a valid certificate?

Tobias


Re: [Patch] Fortran: invoke.texi - link to OpenCoarrays.org + mention libcaf_single

2024-05-21 Thread rep . dot . nop
On 20 May 2024 02:31:27 CEST, Sandra Loosemore  wrote:
>On 5/19/24 02:01, Tobias Burnus wrote:
>> I noticed that gfortran's coarray support did not link to the 
>> http://www.opencoarrays.org/ >
>> [snip]
>> 
>> diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
>> index 40e8e4a7cdd..78a2910b8d8 100644
>> --- a/gcc/fortran/invoke.texi
>> +++ b/gcc/fortran/invoke.texi
>> @@ -1753,7 +1753,10 @@ Single-image mode, i.e. @code{num_images()} is always 
>> one.
>>   @item @samp{lib}
>>  Library-based coarray parallelization; a suitable GNU Fortran coarray
>> -library needs to be linked.
>> +library needs to be linked such as @url{http://opencoarrays.org}.
>
>This would read better as
>
>library such as @url{http://opencoarrays.org} needs to be linked.

Maybe use https?

thanks

>
>> +Alternatively, GCC's @code{libcaf_single} library can be linked,
>> +albeit it only supports a single image.
>> +
>>  @end table
>
>OK with that tweak.
>
>-Sandra
>
>
>