public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Harald Anlauf <anlauf@gmx.de>
To: Andreas Schwab <schwab@linux-m68k.org>,
	Harald Anlauf via Gcc-patches <gcc-patches@gcc.gnu.org>
Cc: fortran <fortran@gcc.gnu.org>
Subject: Re: [PATCH] Fortran: fix treatment of character, value, optional dummy arguments [PR107444]
Date: Sun, 13 Nov 2022 22:00:47 +0100	[thread overview]
Message-ID: <675f3432-8c24-738a-ed28-4728920e6062@gmx.de> (raw)
In-Reply-To: <87sfinutih.fsf@linux-m68k.org>

[-- Attachment #1: Type: text/plain, Size: 2307 bytes --]

Am 13.11.22 um 09:51 schrieb Andreas Schwab:
> This breaks aarch64:
> 
> $ /opt/gcc/gcc-20221113/Build/./gcc/xgcc -B/opt/gcc/gcc-20221113/Build/./gcc/ -B/usr/aarch64-suse-linux/bin/ -B/usr/aarch64-suse-linux/lib/ -isystem /usr/aarch64-suse-linux/include -isystem /usr/aarch64-suse-linux/sys-include -fchecking=1 ../../../../libgomp/testsuite/libgomp.fortran/is_device_ptr-2.f90 -mabi=lp64 -B/opt/gcc/gcc-20221113/Build/aarch64-suse-linux/./libgomp/ -B/opt/gcc/gcc-20221113/Build/aarch64-suse-linux/./libgomp/.libs -I/opt/gcc/gcc-20221113/Build/aarch64-suse-linux/./libgomp -I../../../../libgomp/testsuite/../../include -I../../../../libgomp/testsuite/.. -fmessage-length=0 -fno-diagnostics-show-caret -fdiagnostics-color=never -fopenmp -O -fdump-tree-original -B/opt/gcc/gcc-20221113/Build/aarch64-suse-linux/./libgomp/../libgfortran/.libs -fintrinsic-modules-path=/opt/gcc/gcc-20221113/Build/aarch64-suse-linux/./libgomp -L/opt/gcc/gcc-20221113/Build/aarch64-suse-linux/./libgomp/.libs -L/opt/gcc/gcc-20221113/Build/aarch64-suse-linux/./libgomp/../libgfortran/.libs -lgfortran -foffload=-lgfortran -lm -o ./is_device_ptr-2.exe
> during GIMPLE pass: omplower
> ../../../../libgomp/testsuite/libgomp.fortran/is_device_ptr-2.f90:66:77: internal compiler error: in gfc_omp_check_optional_argument, at fortran/trans-openmp.cc:137
> 0x8acb63 gfc_omp_check_optional_argument(tree_node*, bool)
>          ../../gcc/fortran/trans-openmp.cc:137
> 0xd29fc3 lower_omp_target
>          ../../gcc/omp-low.cc:13632
> 0xd314b3 lower_omp_1
>          ../../gcc/omp-low.cc:14523
> 0xd314b3 lower_omp
>          ../../gcc/omp-low.cc:14662
> 0xd31283 lower_omp_1
>          ../../gcc/omp-low.cc:14436
> 0xd31283 lower_omp
>          ../../gcc/omp-low.cc:14662
> 0xd318a3 lower_omp_1
>          ../../gcc/omp-low.cc:14452
> 0xd318a3 lower_omp
>          ../../gcc/omp-low.cc:14662
> 0xd377fb execute_lower_omp
>          ../../gcc/omp-low.cc:14701
> 0xd377fb execute
>          ../../gcc/omp-low.cc:14755
> Please submit a full bug report, with preprocessed source (by using -freport-bug).
> 

I apologize for forgetting to add the attached change, which does
the adjustment of the name of the generated internal symbol.
Can you please confirm that it fixes your issues?

Thanks,
Harald



[-- Attachment #2: pr107444-part2.diff --]
[-- Type: text/x-patch, Size: 1001 bytes --]

From 872ed50812d3ca13554411e107317161777ecf5d Mon Sep 17 00:00:00 2001
From: Harald Anlauf <anlauf@gmx.de>
Date: Sun, 13 Nov 2022 21:53:58 +0100
Subject: [PATCH] Fortran: fix treatment of character, value, optional dummy
 arguments [PR107444]

gcc/fortran/ChangeLog:

	PR fortran/107444
	* trans-openmp.cc (gfc_omp_check_optional_argument): Adjust to change
	of prefix of internal symbol for presence status to '.'.
---
 gcc/fortran/trans-openmp.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/fortran/trans-openmp.cc b/gcc/fortran/trans-openmp.cc
index 4bfdf85cd9b..9070c03353d 100644
--- a/gcc/fortran/trans-openmp.cc
+++ b/gcc/fortran/trans-openmp.cc
@@ -123,7 +123,7 @@ gfc_omp_check_optional_argument (tree decl, bool for_present_check)
       char name[GFC_MAX_SYMBOL_LEN + 2];
       tree tree_name;
 
-      name[0] = '_';
+      name[0] = '.';
       strcpy (&name[1], IDENTIFIER_POINTER (DECL_NAME (decl)));
       tree_name = get_identifier (name);
 
-- 
2.35.3


  reply	other threads:[~2022-11-13 21:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10 21:56 Harald Anlauf
2022-11-12 17:38 ` Mikael Morin
2022-11-13  8:51 ` Andreas Schwab
2022-11-13 21:00   ` Harald Anlauf [this message]
2022-11-14 11:00     ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=675f3432-8c24-738a-ed28-4728920e6062@gmx.de \
    --to=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).