public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/109216] New: Wrong behaviour explained in -fno-underscoring documentation
@ 2023-03-20 15:48 rhidalgochar at bloomberg dot net
  2023-03-20 19:46 ` [Bug fortran/109216] " anlauf at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rhidalgochar at bloomberg dot net @ 2023-03-20 15:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109216

            Bug ID: 109216
           Summary: Wrong behaviour explained in -fno-underscoring
                    documentation
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rhidalgochar at bloomberg dot net
  Target Milestone: ---

In the documentation section for codegen options it has two parts explaining
the behaviour of -fno-underscoring (and implictly -funderscoring) and
-fsecond-underscore:
https://gcc.gnu.org/onlinedocs/gfortran/Code-Gen-Options.html

However under -fno-underscoring it has an example for -funderscoring that seems
to describe the -fsecond-underscore behaviour.

Indeed if I compile the following example into an object and look at the
symbols I see that j_ and max_count_ are found as undefined symbols, not j_ and
max_count__ as suggested, though I do get that if I compile it with
-fsecond-underscore.

code: 
      program main
      integer i, j, max_count
      i = j() + max_count(i, j())
      end program main

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/109216] Wrong behaviour explained in -fno-underscoring documentation
  2023-03-20 15:48 [Bug fortran/109216] New: Wrong behaviour explained in -fno-underscoring documentation rhidalgochar at bloomberg dot net
@ 2023-03-20 19:46 ` anlauf at gcc dot gnu.org
  2023-03-20 21:48 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-03-20 19:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109216

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-03-20
           Keywords|                            |documentation
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #1 from anlauf at gcc dot gnu.org ---
Confirmed.

Patch:

diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 5679e2f2650..cbe7f377507 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -1573,7 +1573,7 @@ Do not transform names of entities specified in the
Fortran
 source file by appending underscores to them.

 With @option{-funderscoring} in effect, GNU Fortran appends one
-underscore to external names with no underscores.  This is done to ensure
+underscore to external names.  This is done to ensure
 compatibility with code produced by many UNIX Fortran compilers.

 @emph{Caution}: The default behavior of GNU Fortran is
@@ -1596,7 +1596,7 @@ I = J() + MAX_COUNT (MY_VAR, LVAR)
 @noindent
 is implemented as something akin to:
 @smallexample
-i = j_() + max_count__(&my_var__, &lvar);
+i = j_() + max_count_(&my_var, &lvar);
 @end smallexample

 With @option{-fno-underscoring}, the same statement is implemented as:

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/109216] Wrong behaviour explained in -fno-underscoring documentation
  2023-03-20 15:48 [Bug fortran/109216] New: Wrong behaviour explained in -fno-underscoring documentation rhidalgochar at bloomberg dot net
  2023-03-20 19:46 ` [Bug fortran/109216] " anlauf at gcc dot gnu.org
@ 2023-03-20 21:48 ` cvs-commit at gcc dot gnu.org
  2023-03-21  8:11 ` rguenth at gcc dot gnu.org
  2023-03-21 10:25 ` rhidalgochar at bloomberg dot net
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-20 21:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109216

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:6c2b28e43205b7b0cef9ac8504621c4cd0ccbde7

commit r13-6766-g6c2b28e43205b7b0cef9ac8504621c4cd0ccbde7
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Mon Mar 20 20:55:00 2023 +0100

    Fortran: fix documentation of -fno-underscoring [PR109216]

    gcc/fortran/ChangeLog:

            PR fortran/109216
            * invoke.texi: Correct documentation of how underscores are
appended
            to external names.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/109216] Wrong behaviour explained in -fno-underscoring documentation
  2023-03-20 15:48 [Bug fortran/109216] New: Wrong behaviour explained in -fno-underscoring documentation rhidalgochar at bloomberg dot net
  2023-03-20 19:46 ` [Bug fortran/109216] " anlauf at gcc dot gnu.org
  2023-03-20 21:48 ` cvs-commit at gcc dot gnu.org
@ 2023-03-21  8:11 ` rguenth at gcc dot gnu.org
  2023-03-21 10:25 ` rhidalgochar at bloomberg dot net
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-03-21  8:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109216

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/109216] Wrong behaviour explained in -fno-underscoring documentation
  2023-03-20 15:48 [Bug fortran/109216] New: Wrong behaviour explained in -fno-underscoring documentation rhidalgochar at bloomberg dot net
                   ` (2 preceding siblings ...)
  2023-03-21  8:11 ` rguenth at gcc dot gnu.org
@ 2023-03-21 10:25 ` rhidalgochar at bloomberg dot net
  3 siblings, 0 replies; 5+ messages in thread
From: rhidalgochar at bloomberg dot net @ 2023-03-21 10:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109216

Raoul Hidalgo Charman <rhidalgochar at bloomberg dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #4 from Raoul Hidalgo Charman <rhidalgochar at bloomberg dot net> ---
Yep, thanks for the quick response!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-21 10:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20 15:48 [Bug fortran/109216] New: Wrong behaviour explained in -fno-underscoring documentation rhidalgochar at bloomberg dot net
2023-03-20 19:46 ` [Bug fortran/109216] " anlauf at gcc dot gnu.org
2023-03-20 21:48 ` cvs-commit at gcc dot gnu.org
2023-03-21  8:11 ` rguenth at gcc dot gnu.org
2023-03-21 10:25 ` rhidalgochar at bloomberg dot net

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).