public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106109] New: Internal compiler error
@ 2022-06-27 20:59 philip.deegan at gmail dot com
  2022-06-27 21:03 ` [Bug c++/106109] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: philip.deegan at gmail dot com @ 2022-06-27 20:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106109
           Summary: Internal compiler error
           Product: gcc
           Version: 12.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: philip.deegan at gmail dot com
  Target Milestone: ---

Hi,

With the release of FC36 and GCC12, we've begun to get an internal compiler
error for the following code,
https://github.com/PHAREHUB/PHARE/blob/master/tests/core/data/electrons/test_electrons.cpp#L464-L519

Firstly it says "invalid use of auto", but adding "-> void" to the lambda
resolves this, however following that we get an internal compiler error.

```
/io/tests/core/data/electrons/test_electrons.cpp: In member function ‘void
ElectronsTest_ThatElectronsVelocityEqualIonVelocityMinusJ_Test<gtest_TypeParam_>::TestBody()
[with gtest_TypeParam_ = std::pair<PHARE::core::DimConst<3>,
PHARE::core::InterpConst<1> >]’:
/io/tests/core/data/electrons/test_electrons.cpp:519:10: internal compiler
error: Segmentation fault
  519 |     check(this->Vex, this->Vix, this->Jx, Ne, GridYee::JxToMoments);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please submit a full bug report, with preprocessed source.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccCpGiQv.out file, please attach this to
your bugreport.
ninja: build stopped: subcommand failed.
```

```
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/12/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-gcc-major-version-only --enable-libstdcxx-backtrace
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array
--with-isl=/builddir/build/BUILD/gcc-12.1.1-20220507/obj-x86_64-redhat-linux/isl-install
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-offload-defaulted --enable-gnu-indirect-function --enable-cet
--with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
--with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.1.1 20220507 (Red Hat 12.1.1-1) (GCC) 
```
ccCpGiQv.out is uploaded here:
https://gist.github.com/PhilipDeegan/c47eb44c96f579aa62d23ab1b5f2daa0

Changing to use a free templated function fails.
Commenting out the code inside the lambda fails.

If you have any issues building, we provide some Dockerfiles.
If this is in the wrong place please let me know.
Happy to test things to help investigate.

Thanks

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

* [Bug c++/106109] Internal compiler error
  2022-06-27 20:59 [Bug c++/106109] New: Internal compiler error philip.deegan at gmail dot com
@ 2022-06-27 21:03 ` pinskia at gcc dot gnu.org
  2022-06-27 21:06 ` philip.deegan at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-06-27 21:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> ccCpGiQv.out is uploaded here:

Can you attach it? You might need to compress it too.

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

* [Bug c++/106109] Internal compiler error
  2022-06-27 20:59 [Bug c++/106109] New: Internal compiler error philip.deegan at gmail dot com
  2022-06-27 21:03 ` [Bug c++/106109] " pinskia at gcc dot gnu.org
@ 2022-06-27 21:06 ` philip.deegan at gmail dot com
  2022-06-27 21:29 ` philip.deegan at gmail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: philip.deegan at gmail dot com @ 2022-06-27 21:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Philip Deegan <philip.deegan at gmail dot com> ---
Created attachment 53211
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53211&action=edit
preprocessed source

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

* [Bug c++/106109] Internal compiler error
  2022-06-27 20:59 [Bug c++/106109] New: Internal compiler error philip.deegan at gmail dot com
  2022-06-27 21:03 ` [Bug c++/106109] " pinskia at gcc dot gnu.org
  2022-06-27 21:06 ` philip.deegan at gmail dot com
@ 2022-06-27 21:29 ` philip.deegan at gmail dot com
  2022-06-27 21:45 ` philip.deegan at gmail dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: philip.deegan at gmail dot com @ 2022-06-27 21:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Philip Deegan <philip.deegan at gmail dot com> ---
a bit more testing on our end, I think the issue stems from the lack of & on
GridYee::JxToMoments
https://github.com/PHAREHUB/PHARE/blob/master/tests/core/data/electrons/test_electrons.cpp#L519

> &GridYee::JxToMoments

I would have assumed not taking the address of a function would cause a
compiler error in this context.

adding in & resolves the internal compiler error.

sorry for the noise

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

* [Bug c++/106109] Internal compiler error
  2022-06-27 20:59 [Bug c++/106109] New: Internal compiler error philip.deegan at gmail dot com
                   ` (2 preceding siblings ...)
  2022-06-27 21:29 ` philip.deegan at gmail dot com
@ 2022-06-27 21:45 ` philip.deegan at gmail dot com
  2022-06-27 21:47 ` mpolacek at gcc dot gnu.org
  2022-10-22 22:35 ` [Bug c++/106109] [12/13 Regression] ICE with auto and pointer to method pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: philip.deegan at gmail dot com @ 2022-06-27 21:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Philip Deegan <philip.deegan at gmail dot com> ---
as a minimal reproducer 


`
template<typename T>
class G
{
public:
    auto static F() { return 1; }
};

int main()
{
    auto fn = [](auto const& f) -> void { f(); };

    fn(G<double>::F);

    return 0;
}
`

https://godbolt.org/z/f4WYnPvs6

Only if G is a template class does it appear

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

* [Bug c++/106109] Internal compiler error
  2022-06-27 20:59 [Bug c++/106109] New: Internal compiler error philip.deegan at gmail dot com
                   ` (3 preceding siblings ...)
  2022-06-27 21:45 ` philip.deegan at gmail dot com
@ 2022-06-27 21:47 ` mpolacek at gcc dot gnu.org
  2022-10-22 22:35 ` [Bug c++/106109] [12/13 Regression] ICE with auto and pointer to method pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-06-27 21:47 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Already fixed in r13-768-g850a9ce8bcca59.  We'll be updating Fedora gcc
shortly.

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

* [Bug c++/106109] [12/13 Regression] ICE with auto and pointer to method
  2022-06-27 20:59 [Bug c++/106109] New: Internal compiler error philip.deegan at gmail dot com
                   ` (4 preceding siblings ...)
  2022-06-27 21:47 ` mpolacek at gcc dot gnu.org
@ 2022-10-22 22:35 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-22 22:35 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.2
            Summary|Internal compiler error     |[12/13 Regression] ICE with
                   |                            |auto and pointer to method
           Keywords|                            |ice-on-valid-code

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

end of thread, other threads:[~2022-10-22 22:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-27 20:59 [Bug c++/106109] New: Internal compiler error philip.deegan at gmail dot com
2022-06-27 21:03 ` [Bug c++/106109] " pinskia at gcc dot gnu.org
2022-06-27 21:06 ` philip.deegan at gmail dot com
2022-06-27 21:29 ` philip.deegan at gmail dot com
2022-06-27 21:45 ` philip.deegan at gmail dot com
2022-06-27 21:47 ` mpolacek at gcc dot gnu.org
2022-10-22 22:35 ` [Bug c++/106109] [12/13 Regression] ICE with auto and pointer to method pinskia 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).