public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/115167] New: CFG edge visualization to path-printing bootstrap failure
@ 2024-05-20 18:37 dje at gcc dot gnu.org
  2024-05-20 20:57 ` [Bug bootstrap/115167] [15 Regression] " dmalcolm at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: dje at gcc dot gnu.org @ 2024-05-20 18:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115167
           Summary: CFG edge visualization to path-printing bootstrap
                    failure
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dje at gcc dot gnu.org
                CC: dmalcolm at gcc dot gnu.org
  Target Milestone: ---
            Target: powerpc-ibm-aix*

Unfortunately r15-636-g770657d02c986c causes a bootstrap failure on AIX when
building f951 in stage2.  cc1 and cc1plus link successfully. There doesn't seem
to be a similar failure for powerpc64-linux BE or LE.

The failure is

ld: 0711-317 ERROR: Undefined symbol: _ZTV29range_label_for_type_mismatch
ld: 0711-317 ERROR: Undefined symbol:
._ZNK29range_label_for_type_mismatch8get_textEj

which corresponds to

vtable for range_label_for_type_mismatch
range_label_for_type_mismatch::get_text(unsigned int) const

I suspect that something is not being explicitly instantiated, which is running
afoul of the AIX linker.

Somehow your patch is causing the f951 compiler to reference these additional,
undefined symbols.  I suspect that they also are undefined for Linux targets,
but the linker ignores the error and nothing is amiss if the symbols never are
called.

It seems that the patch has created a reference to get_text() that only has
been instantiated for the C languages:
./c/c-objc-common.cc:range_label_for_type_mismatch::get_text (unsigned
/*range_idx*/) const
./cp/error.cc:range_label_for_type_mismatch::get_text (unsigned /*range_idx*/)
const

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

* [Bug bootstrap/115167] [15 Regression] CFG edge visualization to path-printing bootstrap failure
  2024-05-20 18:37 [Bug bootstrap/115167] New: CFG edge visualization to path-printing bootstrap failure dje at gcc dot gnu.org
@ 2024-05-20 20:57 ` dmalcolm at gcc dot gnu.org
  2024-05-20 22:03 ` dje at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2024-05-20 20:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Thanks for filing this, and sorry for the breakage.

Is there a cfarm machine that I ought to be able to reproduce this on?   I'm
trying with cfarm111, but get this configure error:

$ ../src/configure --with-gmp=/opt/cfarm/gmp-latest
--with-mpfr=/opt/cfarm/mpfr-latest --with-mpc=/opt/cfarm/mpc-latest
--disable-bootstrap --enable-languages=c,c++,fortran

[...snip...]
checking for the correct version of gmp.h... no
configure: error: Building GCC requires GMP 4.2+, MPFR 3.1.0+ and MPC 0.8.0+.

$ file /opt/cfarm/gmp-latest
/opt/cfarm/gmp-latest: symbolic link to /home/iulius/autobuild/bin/gmp-6.1.2.

$ ls /home/iulius/autobuild/bin/
[no output]

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

* [Bug bootstrap/115167] [15 Regression] CFG edge visualization to path-printing bootstrap failure
  2024-05-20 18:37 [Bug bootstrap/115167] New: CFG edge visualization to path-printing bootstrap failure dje at gcc dot gnu.org
  2024-05-20 20:57 ` [Bug bootstrap/115167] [15 Regression] " dmalcolm at gcc dot gnu.org
@ 2024-05-20 22:03 ` dje at gcc dot gnu.org
  2024-05-21  0:46 ` dje at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dje at gcc dot gnu.org @ 2024-05-20 22:03 UTC (permalink / raw)
  To: gcc-bugs

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

David Edelsohn <dje at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-05-20
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from David Edelsohn <dje at gcc dot gnu.org> ---
The CFARM wiki provides the following recommendation to build on AIX

$ PATH=/opt/freeware/bin:$PATH

$ .../src/configure --disable-werror --enable-languages=c,c++
--with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm --disable-libstdcxx-pch
--with-included-gettext

$ make SHELL=/bin/bash CONFIG_SHELL=/bin/bash


Also, gcc119 would be a much better choice than gcc111.

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

* [Bug bootstrap/115167] [15 Regression] CFG edge visualization to path-printing bootstrap failure
  2024-05-20 18:37 [Bug bootstrap/115167] New: CFG edge visualization to path-printing bootstrap failure dje at gcc dot gnu.org
  2024-05-20 20:57 ` [Bug bootstrap/115167] [15 Regression] " dmalcolm at gcc dot gnu.org
  2024-05-20 22:03 ` dje at gcc dot gnu.org
@ 2024-05-21  0:46 ` dje at gcc dot gnu.org
  2024-05-21  6:42 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dje at gcc dot gnu.org @ 2024-05-21  0:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from David Edelsohn <dje at gcc dot gnu.org> ---
On PPC64 Linux, gcc-rich-location.o now has undefined references to
range_label_for_type_mismatch:

$ nm -BCpg gcc-rich-location.o | grep range_label_for_type_mismatch
                 U vtable for range_label_for_type_mismatch
                 U range_label_for_type_mismatch::get_text(unsigned int) const

and c-objc-common.o provides definitions:

$ nm -BCpg c-objc-common.o | grep range_label_for_type_mismatch
0000000000001140 T range_label_for_type_mismatch::get_text(unsigned int) const
0000000000000000 V vtable for range_label_for_type_mismatch

AIX similarly has the undefined symbols:

$ /usr/bin/nm -BCpgl gcc-rich-location.o | grep range_label_for_type_mismatch 
         - U _ZTV29range_label_for_type_mismatch
         - U ._ZNK29range_label_for_type_mismatch8get_textEj

and the definition in c-objc-common.o:

$ /usr/bin/nm -BCpgl c-objc-common.o | grep range_label_for_type_mismatch 
      4592 T ._ZNK29range_label_for_type_mismatch8get_textEj
     13828 D _ZNK29range_label_for_type_mismatch8get_textEj
     14000 D _ZTV29range_label_for_type_mismatch


Linux seems to accept the undefined symbols in Fortran, but AIX semantics
requires a definition.

My instinct is that this is a "bug" for all systems, but Linux semantics
ignores or garbage collects the undefined symbol.

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

* [Bug bootstrap/115167] [15 Regression] CFG edge visualization to path-printing bootstrap failure
  2024-05-20 18:37 [Bug bootstrap/115167] New: CFG edge visualization to path-printing bootstrap failure dje at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-05-21  0:46 ` dje at gcc dot gnu.org
@ 2024-05-21  6:42 ` rguenth at gcc dot gnu.org
  2024-05-21 13:38 ` dmalcolm at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-21  6:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |15.0

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

* [Bug bootstrap/115167] [15 Regression] CFG edge visualization to path-printing bootstrap failure
  2024-05-20 18:37 [Bug bootstrap/115167] New: CFG edge visualization to path-printing bootstrap failure dje at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-05-21  6:42 ` rguenth at gcc dot gnu.org
@ 2024-05-21 13:38 ` dmalcolm at gcc dot gnu.org
  2024-05-24  1:42 ` dmalcolm at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2024-05-21 13:38 UTC (permalink / raw)
  To: gcc-bugs

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

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #4 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
> Also, gcc119 would be a much better choice than gcc111.

Thanks; am trying on that.

FWIW r15-636-g770657d02c986c added a new vfunc to libcpp:
  range_label::get_effects
and it's *defined* in the header, so my immediately suspicion is that's the
issue.  Investigating...

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

* [Bug bootstrap/115167] [15 Regression] CFG edge visualization to path-printing bootstrap failure
  2024-05-20 18:37 [Bug bootstrap/115167] New: CFG edge visualization to path-printing bootstrap failure dje at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-05-21 13:38 ` dmalcolm at gcc dot gnu.org
@ 2024-05-24  1:42 ` dmalcolm at gcc dot gnu.org
  2024-05-24 12:09 ` dje at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2024-05-24  1:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Created attachment 58278
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58278&action=edit
WIP patch to split out the classes into the c-family

I tried the attached patch, to move the pertinent code to the c-family
subdirectory and its objects.

I tried bootstrapping with this on cfarm119.  It seemed to get further, but is
now failing here:

[...snip...]
ar  -X64 x ../pthread/ppc64/libgcc/libgcc_s.a shr.o
ar: 0707-100 ../pthread/ppc64/libgcc/libgcc_s.a does not exist.
make[3]: *** [../../../src/libgcc/config/rs6000/t-slibgcc-aix:101: all] Error 1
make[3]: Leaving directory
'/scratch/dmalcolm/gcc-bugfixing/build/powerpc-ibm-aix7.3.1.0/libgcc'
make[2]: *** [Makefile:18469: all-stage2-target-libgcc] Error 2
make[2]: Leaving directory '/scratch/dmalcolm/gcc-bugfixing/build'
make[1]: *** [Makefile:23365: stage2-bubble] Error 2
make[1]: Leaving directory '/scratch/dmalcolm/gcc-bugfixing/build'
make: *** [Makefile:1103: all] Error 2


That said, I forgot to do this within a "screen" and lost my ssh connection a
few times, and had to rerun make each time, so maybe I messed something up
there?

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

* [Bug bootstrap/115167] [15 Regression] CFG edge visualization to path-printing bootstrap failure
  2024-05-20 18:37 [Bug bootstrap/115167] New: CFG edge visualization to path-printing bootstrap failure dje at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2024-05-24  1:42 ` dmalcolm at gcc dot gnu.org
@ 2024-05-24 12:09 ` dje at gcc dot gnu.org
  2024-05-28 17:08 ` cvs-commit at gcc dot gnu.org
  2024-05-28 17:16 ` dmalcolm at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: dje at gcc dot gnu.org @ 2024-05-24 12:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from David Edelsohn <dje at gcc dot gnu.org> ---
The libgcc failure is due to something not being built or rebuilt.

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

* [Bug bootstrap/115167] [15 Regression] CFG edge visualization to path-printing bootstrap failure
  2024-05-20 18:37 [Bug bootstrap/115167] New: CFG edge visualization to path-printing bootstrap failure dje at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2024-05-24 12:09 ` dje at gcc dot gnu.org
@ 2024-05-28 17:08 ` cvs-commit at gcc dot gnu.org
  2024-05-28 17:16 ` dmalcolm at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-28 17:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Malcolm <dmalcolm@gcc.gnu.org>:

https://gcc.gnu.org/g:b544ff88560e100e53ed8966d38f172c5bafce8d

commit r15-865-gb544ff88560e100e53ed8966d38f172c5bafce8d
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Tue May 28 13:04:25 2024 -0400

    Fix bootstrap on AIX by adding c-family/c-type-mismatch.cc [PR115167]

    PR bootstrap/115167 reports a bootstrap failure on AIX triggered by
    r15-636-g770657d02c986c whilst building f951 in stage 2, due to
    the linker not being able to find symbols for:

      vtable for range_label_for_type_mismatch
      range_label_for_type_mismatch::get_text(unsigned int) const

    The only users of the class range_label_for_type_mismatch are in the
    C/C++ frontends, each of which supply their own implementation of:

      range_label_for_type_mismatch::get_text(unsigned int) const

    i.e. we had a cluster of symbols that was disconnnected from any
    users on f951.

    The above patch added a new range_label::get_effects vfunc to the
    base class.  My hunch is that we were getting away with not defining
    the symbol for Fortran with AIX's linker before (since none of the
    users are used), but adding the get_effects vfunc has somehow broken
    things (possibly because there's an empty implementation in the base
    class in the *header*).

    The following patch moves all of the code in
    gcc/gcc-rich-location.[cc,h,o} defining and using
    range_label_for_type_mismatch to a new
    gcc/c-family/c-type-mismatch.{cc,h,o}, to help the linker ignore this
    cluster of symbols when it's disconnected from users.

    I was able to reproduce the failure without the patch, and then
    successfully bootstrap with this patch on powerpc-ibm-aix7.3.1.0
    (cfarm119).

    gcc/ChangeLog:
            PR bootstrap/115167
            * Makefile.in (C_COMMON_OBJS): Add c-family/c-type-mismatch.o.
            * gcc-rich-location.cc
            (maybe_range_label_for_tree_type_mismatch::get_text): Move to
            c-family/c-type-mismatch.cc.
            (binary_op_rich_location::binary_op_rich_location): Likewise.
            (binary_op_rich_location::use_operator_loc_p): Likewise.
            * gcc-rich-location.h (class range_label_for_type_mismatch):
            Likewise.
            (class maybe_range_label_for_tree_type_mismatch): Likewise.
            (class op_location_t): Likewise for forward decl.
            (class binary_op_rich_location): Likewise.

    gcc/c-family/ChangeLog:
            PR bootstrap/115167
            * c-format.cc: Replace include of "gcc-rich-location.h" with
            "c-family/c-type-mismatch.h".
            * c-type-mismatch.cc: New file, taking material from
            gcc-rich-location.cc.
            * c-type-mismatch.h: New file, taking material from
            gcc-rich-location.h.
            * c-warn.cc: Replace include of "gcc-rich-location.h" with
            "c-family/c-type-mismatch.h".

    gcc/c/ChangeLog:
            PR bootstrap/115167
            * c-objc-common.cc: Replace include of "gcc-rich-location.h" with
            "c-family/c-type-mismatch.h".
            * c-typeck.cc: Likewise.

    gcc/cp/ChangeLog:
            PR bootstrap/115167
            PR bootstrap/115167
            * call.cc: Replace include of "gcc-rich-location.h" with
            "c-family/c-type-mismatch.h".
            * error.cc: Likewise.
            * typeck.cc: Likewise.

    Signed-off-by: David Malcolm <dmalcolm@redhat.com>

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

* [Bug bootstrap/115167] [15 Regression] CFG edge visualization to path-printing bootstrap failure
  2024-05-20 18:37 [Bug bootstrap/115167] New: CFG edge visualization to path-printing bootstrap failure dje at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2024-05-28 17:08 ` cvs-commit at gcc dot gnu.org
@ 2024-05-28 17:16 ` dmalcolm at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2024-05-28 17:16 UTC (permalink / raw)
  To: gcc-bugs

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

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

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

--- Comment #8 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Should be fixed by the above patch.  As noted above, I was able to bootstrap
with this patch on cfarm119.

Marking this as resolved; thanks for your help.

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

end of thread, other threads:[~2024-05-28 17:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-20 18:37 [Bug bootstrap/115167] New: CFG edge visualization to path-printing bootstrap failure dje at gcc dot gnu.org
2024-05-20 20:57 ` [Bug bootstrap/115167] [15 Regression] " dmalcolm at gcc dot gnu.org
2024-05-20 22:03 ` dje at gcc dot gnu.org
2024-05-21  0:46 ` dje at gcc dot gnu.org
2024-05-21  6:42 ` rguenth at gcc dot gnu.org
2024-05-21 13:38 ` dmalcolm at gcc dot gnu.org
2024-05-24  1:42 ` dmalcolm at gcc dot gnu.org
2024-05-24 12:09 ` dje at gcc dot gnu.org
2024-05-28 17:08 ` cvs-commit at gcc dot gnu.org
2024-05-28 17:16 ` dmalcolm at gcc dot gnu.org

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