From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id DAB79385800D; Sun, 13 Dec 2020 19:59:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DAB79385800D Received: by mail-wr1-x42b.google.com with SMTP id c5so10721271wrp.6; Sun, 13 Dec 2020 11:59:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=iQNGT3MkE5+X/PVVP8J/4X7r+Ix8WjtqSWExz5EekUA=; b=ZhJngrxWK12UsG4tY7dsWvtI3KSbhFyvDfYQ3KCQ8YNCajnqRyCVXgKkjuJIfPWXm1 DmpPgpJuMMfmrk3mlONmN3X2bRJhxHeV0IHrfNPd+x9+9Pn4FX9lq2fmmq7E+WzTEeQn shQ2DJ2P1/Uk5bGv5KoiNRvxnT6deRT6eDIRor5V5gQagbD7dyWJdBX/4gJqNBA0qAzH 4qnLSGZXSYI3DPkU4PR04qa/2cJXdIZ2aVX7CyiDR4+exz6Pmh9XrPEp1kNRERxrM0vJ I+ZYJ6lF/s4pxq0WzTZhjN/HyPIwmbgcPD9TLM1378eLDkyWVDUZzVusErmuFsNDK6is BjIg== X-Gm-Message-State: AOAM532bfpCYMmcRv1lKBaIys8KwtLXBviXm8Znq3A4k3uHu0Qn8UkRr J4Rc+vUla4udlBJ0sUmnsbA= X-Google-Smtp-Source: ABdhPJxllFeuR+WROtXYjDl713Ep5Dnn5u3PWPYsXybMu2X/Vpdu7p69/nGWpHnLtm06JISpOpl7uA== X-Received: by 2002:a05:6000:90:: with SMTP id m16mr25622104wrx.165.1607889576018; Sun, 13 Dec 2020 11:59:36 -0800 (PST) Received: from [192.168.1.212] (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.googlemail.com with ESMTPSA id d9sm27511475wrs.26.2020.12.13.11.59.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Dec 2020 11:59:35 -0800 (PST) Content-Type: text/plain; charset=utf-8; delsp=yes; format=flowed Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [patch, fortran] Optionally improve debugging of auxiliary variables From: Iain Sandoe In-Reply-To: <63a95a8d-ddc9-ccd0-e698-92c2ffffa086@netcologne.de> Date: Sun, 13 Dec 2020 19:59:34 +0000 Cc: gcc-patches , Fortran List Content-Transfer-Encoding: 8bit Message-Id: <4E78162B-817D-4DE0-BA60-6E76CCCBF4E3@googlemail.com> References: <51553200-43F3-4D21-8535-478C1D21EE5D@googlemail.com> <728EDC98-94A8-481D-BD0B-CA7D92F0AA4A@googlemail.com> <0a9111ab-c869-07c3-b644-e40601fbce47@netcologne.de> <115CC043-0544-4C9D-BF8D-96A24BBDC271@googlemail.com> <63a95a8d-ddc9-ccd0-e698-92c2ffffa086@netcologne.de> To: Thomas Koenig X-Mailer: Apple Mail (2.3273) X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2020 19:59:38 -0000 Hi Thomas, Thomas Koenig via Fortran wrote: >> I guess the hard thing is for the developer to know that (s)he wants >> the option and what to do when a conflict occurs. > > Actually, I just hit on a much simpler solution. :) .. I’m all in favour of simplicity. > We translate all symbols to lower case (except for those > with BIND(C), which do not matter in this context). So, > prefixing everything with GFC_ (upper case) should work on > any toolchain that can handle C, which is all we care about. For bonus points you can prefix with _GFC_ which puts the symbols in the implementation’s namespace (at least for C-Family purposes) and therefore means that a clash with a user’s symbols is the user’s problem … > So, here is a patch which implements this method. The tree > dump now looks like this: > > struct __st_parameter_dt GFC_dt_parm_0; > > GFC_dt_parm_0.common.filename = &"hello.f90"[1]{lb: 1 sz: 1}; > GFC_dt_parm_0.common.line = 2; > GFC_dt_parm_0.common.flags = 128; > GFC_dt_parm_0.common.unit = 6; > _gfortran_st_write (&GFC_dt_parm_0); > _gfortran_transfer_character_write (&GFC_dt_parm_0, &"Hello, world"[1]{lb: 1 sz: 1}, 12); > _gfortran_st_write_done (&GFC_dt_parm_0); > > So, thanks for raising your concerns, I like this much better now :-) > > Regression-tested. Also tested with "make dvi" and "make pdf". > If there are no other comments, I'd like to commit this as having > no user impact and kind of obvious (now :-) tomorrow or so. > > Best regards > > Thomas >