public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/96591] New: ICE with -flto=auto and -O1: tree code ‘typename_type’ is not supported in LTO streams
@ 2020-08-12 15:58 gcc-bugs at marehr dot dialup.fu-berlin.de
  2020-08-12 17:05 ` [Bug lto/96591] " marxin at gcc dot gnu.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: gcc-bugs at marehr dot dialup.fu-berlin.de @ 2020-08-12 15:58 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96591
           Summary: ICE with -flto=auto and -O1: tree code ‘typename_type’
                    is not supported in LTO streams
           Product: gcc
           Version: 10.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc-bugs at marehr dot dialup.fu-berlin.de
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Hi gcc-team,

I'm not sure if this is the right component.

The following code:

```c++
template <typename scalar_t, unsigned length>
struct builtin_simd
{
  using type [[gnu::vector_size(sizeof(scalar_t) * length)]] = scalar_t;
};

struct simd_traits
{
  using scalar_type = int;

  template <typename new_scalar_type>
  using rebind = typename builtin_simd<new_scalar_type, 1>::type;
};

template <typename simd_t>
constexpr simd_t fill(typename simd_traits::scalar_type const scalar)
{
  return simd_t{scalar};
}

class Test
{
    using score_type = typename builtin_simd<int, 1>::type;
    score_type data[1]{fill<score_type>(8)};
};

struct TestFactoryBase
{
  virtual Test *CreateTest() = 0;
};

template <class TestClass>
struct TestFactoryImpl : public TestFactoryBase
{
  Test *CreateTest() override { return new TestClass; }
};

void MakeAndRegisterTestInfo(TestFactoryBase *factory);

int main() {
  MakeAndRegisterTestInfo(new TestFactoryImpl<Test>);
}
```

https://godbolt.org/z/55xTod

produces with

> > g++ -O1 -flto=auto ice.cpp
> during IPA pass: pure-const
> ice.cpp:42:1: internal compiler error: tree code ‘typename_type’ is not supported in LTO streams
>    42 | }
>       | ^
> Please submit a full bug report, with preprocessed source if appropriate.
> See <https://bugs.archlinux.org/> for instructions.

that error.

Some notes:
* removing "using rebind = typename builtin_simd<new_scalar_type, 1>::type;" or
* removing "constexpr" from constexpr simd_t fill(typename
simd_traits::scalar_type const scalar) 
will make it compile.

Thank you!

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

end of thread, other threads:[~2021-04-26 10:48 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-12 15:58 [Bug lto/96591] New: ICE with -flto=auto and -O1: tree code ‘typename_type’ is not supported in LTO streams gcc-bugs at marehr dot dialup.fu-berlin.de
2020-08-12 17:05 ` [Bug lto/96591] " marxin at gcc dot gnu.org
2020-08-25  9:27 ` [Bug c++/96591] [8/9/10/11 Regression] " rguenth at gcc dot gnu.org
2020-08-25 12:12 ` jakub at gcc dot gnu.org
2020-08-26  5:20 ` asolokha at gmx dot com
2020-10-12 12:34 ` rguenth at gcc dot gnu.org
2021-02-04 21:03 ` jason at gcc dot gnu.org
2021-02-06  6:20 ` [Bug lto/96591] " jason at gcc dot gnu.org
2021-02-08  7:47 ` rguenth at gcc dot gnu.org
2021-02-08  8:45 ` rguenth at gcc dot gnu.org
2021-02-08 12:05 ` cvs-commit at gcc dot gnu.org
2021-02-08 12:06 ` [Bug lto/96591] [8/9/10 " rguenth at gcc dot gnu.org
2021-03-24 14:26 ` cvs-commit at gcc dot gnu.org
2021-04-12 11:23 ` [Bug lto/96591] [8/9 " cvs-commit at gcc dot gnu.org
2021-04-26 10:46 ` [Bug lto/96591] [8 " cvs-commit at gcc dot gnu.org
2021-04-26 10:48 ` rguenth 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).