public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug d/112285] New: `in` class parameter with `gdc -fpreview=in` causes ICE
@ 2023-10-30  7:49 gcc.gnu.org at webfreak dot org
  2024-03-10 18:07 ` [Bug d/112285] " cvs-commit at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gcc.gnu.org at webfreak dot org @ 2023-10-30  7:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112285
           Summary: `in` class parameter with `gdc -fpreview=in` causes
                    ICE
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: gcc.gnu.org at webfreak dot org
  Target Milestone: ---

```
gdc (GCC) 13.2.1 20230801
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

(from ArchLinux packages)
```

reduced reproduction code:

```
// test.d
struct NativePath
{
}

class Package {
        NativePath m_path;

        void getSubConfiguration(in Package )
        {
        }
}
```

CLI:

```
gdc -fpreview=in -freport-bug test.d
```

error:

```
d21: internal compiler error: in layout_aggregate_type, at d/types.cc:562
0x1bceda4 internal_error(char const*, ...)
        ???:0
0x7bbfc5 fancy_abort(char const*, int, char const*)
        ???:0
0xa14ad3 build_ctype(Type*)
        ???:0
0xa234e2 Target::preferPassByRef(Type*)
        ???:0
0x9d7562 typeSemantic(Type*, Loc const&, Scope*)
        ???:0
0x8a1c1e DsymbolSemanticVisitor::funcDeclarationSemantic(FuncDeclaration*)
        ???:0
0x8780f0
_D3dmd7dsymbol14foreachDsymbolFPSQBf4root5array__T5ArrayTCQCeQCd7DsymbolZQxMDFQvZvZv
        ???:0
0x8869fb DsymbolSemanticVisitor::visit(ClassDeclaration*)
        ???:0
0x8780f0
_D3dmd7dsymbol14foreachDsymbolFPSQBf4root5array__T5ArrayTCQCeQCd7DsymbolZQxMDFQvZvZv
        ???:0
0x87c94d DsymbolSemanticVisitor::visit(Module*)
        ???:0
0x87e9ed dsymbolSemantic(Dsymbol*, Scope*)
        ???:0
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://bugs.archlinux.org/> for instructions.
```

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

* [Bug d/112285] `in` class parameter with `gdc -fpreview=in` causes ICE
  2023-10-30  7:49 [Bug d/112285] New: `in` class parameter with `gdc -fpreview=in` causes ICE gcc.gnu.org at webfreak dot org
@ 2024-03-10 18:07 ` cvs-commit at gcc dot gnu.org
  2024-03-10 18:53 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-10 18:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain Buclaw <ibuclaw@gcc.gnu.org>:

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

commit r14-9420-ga84b98c62d90bf9e8b01038f624a62725e6a44db
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Sun Mar 10 17:49:06 2024 +0100

    d: Fix -fpreview=in ICEs with forward referenced parameter [PR112285]

    The way that the target hook preferPassByRef is implemented, it relied
    on the GCC "back-end" tree type to determine whether or not to use `ref'
    ABI for D `in' parameters; e.g: prefer by value if it is expected that
    the target will pass the type around in registers.

    Building the GCC tree type depends on the AST type being complete - all
    semantic processing is finished - but as this hook is called from the
    front-end, this will not be the case for forward referenced or
    self-referencing types.

    The consensus in upstream is that `in' parameters should always be
    implicitly `ref', but as the front-end does not yet support all types
    being rvalue references, limit this just static arrays and structs.

            PR d/112285
            PR d/112290

    gcc/d/ChangeLog:

            * d-target.cc (Target::preferPassByRef): Return true for all static
            array and struct types.

    gcc/testsuite/ChangeLog:

            * gdc.dg/pr112285.d: New test.
            * gdc.dg/pr112290.d: New test.

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

* [Bug d/112285] `in` class parameter with `gdc -fpreview=in` causes ICE
  2023-10-30  7:49 [Bug d/112285] New: `in` class parameter with `gdc -fpreview=in` causes ICE gcc.gnu.org at webfreak dot org
  2024-03-10 18:07 ` [Bug d/112285] " cvs-commit at gcc dot gnu.org
@ 2024-03-10 18:53 ` cvs-commit at gcc dot gnu.org
  2024-03-10 19:11 ` cvs-commit at gcc dot gnu.org
  2024-03-10 19:14 ` ibuclaw at gdcproject dot org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-10 18:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Iain Buclaw
<ibuclaw@gcc.gnu.org>:

https://gcc.gnu.org/g:025ff57c19efae6c8d76df6b93e7d9827017acc9

commit r13-8415-g025ff57c19efae6c8d76df6b93e7d9827017acc9
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Sun Mar 10 17:49:06 2024 +0100

    d: Fix -fpreview=in ICEs with forward referenced parameter [PR112285]

    The way that the target hook preferPassByRef is implemented, it relied
    on the GCC "back-end" tree type to determine whether or not to use `ref'
    ABI for D `in' parameters; e.g: prefer by value if it is expected that
    the target will pass the type around in registers.

    Building the GCC tree type depends on the AST type being complete - all
    semantic processing is finished - but as this hook is called from the
    front-end, this will not be the case for forward referenced or
    self-referencing types.

    The consensus in upstream is that `in' parameters should always be
    implicitly `ref', but as the front-end does not yet support all types
    being rvalue references, limit this just static arrays and structs.

            PR d/112285
            PR d/112290

    gcc/d/ChangeLog:

            * d-target.cc (Target::preferPassByRef): Return true for all static
            array and struct types.

    gcc/testsuite/ChangeLog:

            * gdc.dg/pr112285.d: New test.
            * gdc.dg/pr112290.d: New test.
            * gdc.test/compilable/previewin.d: Adjust testcase.

    (cherry picked from commit a84b98c62d90bf9e8b01038f624a62725e6a44db)

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

* [Bug d/112285] `in` class parameter with `gdc -fpreview=in` causes ICE
  2023-10-30  7:49 [Bug d/112285] New: `in` class parameter with `gdc -fpreview=in` causes ICE gcc.gnu.org at webfreak dot org
  2024-03-10 18:07 ` [Bug d/112285] " cvs-commit at gcc dot gnu.org
  2024-03-10 18:53 ` cvs-commit at gcc dot gnu.org
@ 2024-03-10 19:11 ` cvs-commit at gcc dot gnu.org
  2024-03-10 19:14 ` ibuclaw at gdcproject dot org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-10 19:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Iain Buclaw
<ibuclaw@gcc.gnu.org>:

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

commit r12-10202-gec3a01024dd86c51d1e563df9395123765cf548d
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Sun Mar 10 17:49:06 2024 +0100

    d: Fix -fpreview=in ICEs with forward referenced parameter [PR112285]

    The way that the target hook preferPassByRef is implemented, it relied
    on the GCC "back-end" tree type to determine whether or not to use `ref'
    ABI for D `in' parameters; e.g: prefer by value if it is expected that
    the target will pass the type around in registers.

    Building the GCC tree type depends on the AST type being complete - all
    semantic processing is finished - but as this hook is called from the
    front-end, this will not be the case for forward referenced or
    self-referencing types.

    The consensus in upstream is that `in' parameters should always be
    implicitly `ref', but as the front-end does not yet support all types
    being rvalue references, limit this just static arrays and structs.

            PR d/112285
            PR d/112290

    gcc/d/ChangeLog:

            * d-target.cc (Target::preferPassByRef): Return true for all static
            array and struct types.

    gcc/testsuite/ChangeLog:

            * gdc.dg/pr112285.d: New test.
            * gdc.dg/pr112290.d: New test.
            * gdc.test/compilable/previewin.d: Adjust testcase.

    (cherry picked from commit 025ff57c19efae6c8d76df6b93e7d9827017acc9)

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

* [Bug d/112285] `in` class parameter with `gdc -fpreview=in` causes ICE
  2023-10-30  7:49 [Bug d/112285] New: `in` class parameter with `gdc -fpreview=in` causes ICE gcc.gnu.org at webfreak dot org
                   ` (2 preceding siblings ...)
  2024-03-10 19:11 ` cvs-commit at gcc dot gnu.org
@ 2024-03-10 19:14 ` ibuclaw at gdcproject dot org
  3 siblings, 0 replies; 5+ messages in thread
From: ibuclaw at gdcproject dot org @ 2024-03-10 19:14 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Buclaw <ibuclaw at gdcproject dot org> changed:

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

--- Comment #4 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
Fix committed and backported.

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

end of thread, other threads:[~2024-03-10 19:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-30  7:49 [Bug d/112285] New: `in` class parameter with `gdc -fpreview=in` causes ICE gcc.gnu.org at webfreak dot org
2024-03-10 18:07 ` [Bug d/112285] " cvs-commit at gcc dot gnu.org
2024-03-10 18:53 ` cvs-commit at gcc dot gnu.org
2024-03-10 19:11 ` cvs-commit at gcc dot gnu.org
2024-03-10 19:14 ` ibuclaw at gdcproject dot 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).