public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/109403] New: Alignment of common blocks not reported correctly
@ 2023-04-04 11:55 jahns at dkrz dot de
  2023-04-11 12:27 ` [Bug lto/109403] " rguenth at gcc dot gnu.org
  2023-07-11 11:57 ` jahns at dkrz dot de
  0 siblings, 2 replies; 3+ messages in thread
From: jahns at dkrz dot de @ 2023-04-04 11:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109403
           Summary: Alignment of common blocks not reported correctly
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jahns at dkrz dot de
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

When compiling a source file with -flto, the alignment of common blocks seems
to not be reported from gcc-nm:

$ cat >align-test.f90 <<EOF
      MODULE CONFTEST_ALIGN
      USE, INTRINSIC :: ISO_C_BINDING, ONLY: C_INT
      IMPLICIT NONE
      INTEGER(C_INT), PUBLIC, &
        BIND(c, name='align_test_variable') :: align_test_variable
      END MODULE CONFTEST_ALIGN
EOF
$ gfortran -flto -O2 -c -o align-test.o align-test.f90
$ gcc-nm align-test.o
00000000 C align_test_variable

Expected value was 4 byte alignment, but any value other than 0 would be
acceptable as long as it matches what the resulting DSO or program later
contains.

I tested this initially with gfortran 11.1 and 11.2 on Linux x86_64 because
that's what I have readily available and what I'm most interested in.

An equivalent C source exhibits the same problem:
$ echo "int align_test_variable __attribute__((common));" \
  | gcc -c -flto -x c - -o align-test-c.o
$ gcc-nm align-test-c.o 
00000000 C align_test_variable

Since no one seems to have reported similar experiences I expect to still find
this problem in most recent compiler versions.

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

* [Bug lto/109403] Alignment of common blocks not reported correctly
  2023-04-04 11:55 [Bug ipa/109403] New: Alignment of common blocks not reported correctly jahns at dkrz dot de
@ 2023-04-11 12:27 ` rguenth at gcc dot gnu.org
  2023-07-11 11:57 ` jahns at dkrz dot de
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-11 12:27 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-04-11
             Status|UNCONFIRMED                 |NEW
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed, not sure how well-defined "The symbol value" displayed is.  The
required info is probably also not available in the LTO symbol table entry.

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

* [Bug lto/109403] Alignment of common blocks not reported correctly
  2023-04-04 11:55 [Bug ipa/109403] New: Alignment of common blocks not reported correctly jahns at dkrz dot de
  2023-04-11 12:27 ` [Bug lto/109403] " rguenth at gcc dot gnu.org
@ 2023-07-11 11:57 ` jahns at dkrz dot de
  1 sibling, 0 replies; 3+ messages in thread
From: jahns at dkrz dot de @ 2023-07-11 11:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Thomas Jahns <jahns at dkrz dot de> ---
Just for cross-referencing:

In the meantime, I found that someone else also ran into this problem when
using fat objects with binutils nm:

https://sourceware.org/bugzilla/show_bug.cgi?id=24326

https://stackoverflow.com/questions/55126627

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

end of thread, other threads:[~2023-07-11 11:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-04 11:55 [Bug ipa/109403] New: Alignment of common blocks not reported correctly jahns at dkrz dot de
2023-04-11 12:27 ` [Bug lto/109403] " rguenth at gcc dot gnu.org
2023-07-11 11:57 ` jahns at dkrz dot de

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