public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99294] New: [modules] tdef-inst-1 fails with -fno-module-lazy
@ 2021-02-26 21:28 nathan at gcc dot gnu.org
  2021-02-26 21:29 ` [Bug c++/99294] " nathan at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-02-26 21:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99294
           Summary: [modules] tdef-inst-1 fails with -fno-module-lazy
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nathan at gcc dot gnu.org
  Target Milestone: ---

In working on 99170 I hit a new assert, that appears unrelated to the 99170
WIP.

./cc1plus -fmodules-ts tdef-inst-1_a.C -quiet
./cc1plus -fmodules-ts tdef-inst-1_b.C -quiet -fno-module-lazy

during RTL pass: expand
tdef-inst-1_b.C: In function 'string Quux()':
tdef-inst-1_b.C:8:10: internal compiler error: in make_decl_rtl, at
varasm.c:1418
    8 |   return 1; // failed to find converting ctor of string
      |          ^
0x1b36309 make_decl_rtl(tree_node*)
        ../../../src/gcc/varasm.c:1418
0x10221eb expand_return
        ../../../src/gcc/cfgexpand.c:3741
0x1022881 expand_gimple_stmt_1
        ../../../src/gcc/cfgexpand.c:3882
0x1022df1 expand_gimple_stmt
        ../../../src/gcc/cfgexpand.c:4008
0x102b0e6 expand_gimple_basic_block
        ../../../src/gcc/cfgexpand.c:6045

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

* [Bug c++/99294] [modules] tdef-inst-1 fails with -fno-module-lazy
  2021-02-26 21:28 [Bug c++/99294] New: [modules] tdef-inst-1 fails with -fno-module-lazy nathan at gcc dot gnu.org
@ 2021-02-26 21:29 ` nathan at gcc dot gnu.org
  2021-03-01 13:58 ` cvs-commit at gcc dot gnu.org
  2021-03-01 13:58 ` nathan at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-02-26 21:29 UTC (permalink / raw)
  To: gcc-bugs

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

Nathan Sidwell <nathan at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-02-26
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |nathan at gcc dot gnu.org

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

* [Bug c++/99294] [modules] tdef-inst-1 fails with -fno-module-lazy
  2021-02-26 21:28 [Bug c++/99294] New: [modules] tdef-inst-1 fails with -fno-module-lazy nathan at gcc dot gnu.org
  2021-02-26 21:29 ` [Bug c++/99294] " nathan at gcc dot gnu.org
@ 2021-03-01 13:58 ` cvs-commit at gcc dot gnu.org
  2021-03-01 13:58 ` nathan at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-01 13:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathan Sidwell <nathan@gcc.gnu.org>:

https://gcc.gnu.org/g:2e0bb9eec2d455840bc4773391b3313a320b3c23

commit r11-7441-g2e0bb9eec2d455840bc4773391b3313a320b3c23
Author: Nathan Sidwell <nathan@acm.org>
Date:   Mon Mar 1 05:41:10 2021 -0800

    c++: Completeness of typedef structs [PR 99294]

    When we read in a class definition, we use fixup_type_variants to
    propagate the now-completed fields of the class's TYPE to other
    variants.  Unfortunately that doesn't propagate all of them, and in
    this case we had a typedef to an (incomplete) instantiation.  That
    typedef ended up with a VOIDmode, which blew up gimple expansion as
    the type itself isn't VOID.  Without modules, that information is
    propagated in finalize_type_size when laying out the class.  But that
    doesn't happen with stream-in -- we already know the layout.  There is
    already some overlap between the two functions, now there's a bit
    more.  In fixup_type_variants, I pay attention to the TYPE_NAME to
    decide whether to override a user's TYPE_ALIGN -- variants of the
    main-variant typedef just copy the main-variant.  Other variants
    recalculate.  Overaligning is still permitted.

    I also added a TYPE_ALIGN_RAW accessor, and fixed a bug in the
    alignment streaming I noticed.  I did not refactor TYPE_ALIGN beyond
    using the new accessor.  (It could be written as ((1 << align_raw) >>
    1), rather than use the conditional.)

            PR c++/99294
            gcc/
            * tree.h (TYPE_ALIGN_RAW): New accessor.
            (TYPE_ALIGN): Use it.
            gcc/cp/
            * class.c (fixup_type_variants): Propagate mode, precision,
            alignment & emptiness.
            * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
            (trees_in::tree_node): Rematerialize alignment here.
            gcc/testsuite/
            * g++.dg/modules/pr99294.h: New.
            * g++.dg/modules/pr99294_a.C: New.
            * g++.dg/modules/pr99294_b.C: New.

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

* [Bug c++/99294] [modules] tdef-inst-1 fails with -fno-module-lazy
  2021-02-26 21:28 [Bug c++/99294] New: [modules] tdef-inst-1 fails with -fno-module-lazy nathan at gcc dot gnu.org
  2021-02-26 21:29 ` [Bug c++/99294] " nathan at gcc dot gnu.org
  2021-03-01 13:58 ` cvs-commit at gcc dot gnu.org
@ 2021-03-01 13:58 ` nathan at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-03-01 13:58 UTC (permalink / raw)
  To: gcc-bugs

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

Nathan Sidwell <nathan at gcc dot gnu.org> changed:

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

--- Comment #2 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
2e0bb9eec2d 2021-03-01 | c++: Completeness of typedef structs [PR 99294]

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

end of thread, other threads:[~2021-03-01 13:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26 21:28 [Bug c++/99294] New: [modules] tdef-inst-1 fails with -fno-module-lazy nathan at gcc dot gnu.org
2021-02-26 21:29 ` [Bug c++/99294] " nathan at gcc dot gnu.org
2021-03-01 13:58 ` cvs-commit at gcc dot gnu.org
2021-03-01 13:58 ` nathan 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).