[Bug c++/101241] New: Internal compiler error from MathFunctions.h in the eigen library

2021-06-28 Thread r.langer at itv dot rwth-aachen.de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101241

Bug ID: 101241
   Summary: Internal compiler error from MathFunctions.h in the
eigen library
   Product: gcc
   Version: 11.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: r.langer at itv dot rwth-aachen.de
  Target Milestone: ---

I used a docker image of Clean Linux (version 34790) and installed gcc 11.1.1
with:

swupd bundle-add c-basic wget

The following commands produce the error:
wget https://gitlab.com/libeigen/eigen/-/archive/3.4-rc1/eigen-3.4-rc1.tar.bz2
tar -xf eigen-3.4-rc1.tar.bz2
printf "#include \n int main(int,char const*[]){}\n" >
eigen_bug.cpp
g++ eigen_bug.cpp -Ieigen-3.4-rc1/ -Ofast -ffast-math

Expected output from the last command:
In file included from eigen-3.4-rc1/Eigen/Core:171,
 from eigen_bug.cpp:1:
eigen-3.4-rc1/Eigen/src/Core/MathFunctions.h:1036:71: internal compiler error:
in maybe_default_option, at opts.c:332
 1036 | template<> EIGEN_TMP_NOOPT_ATTRIB bool isnan_impl(const long double& x)
{ return __builtin_isnan(x); }
  |   ^
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.


The following works fine:
g++ eigen_bug.cpp -Ieigen-3.4-rc1/ -O3 -ffast-math

[Bug c++/101241] Internal compiler error from MathFunctions.h in the eigen library

2021-06-28 Thread r.langer at itv dot rwth-aachen.de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101241

--- Comment #2 from Raymond Langer  ---
Created attachment 51072
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51072&action=edit
preprocessed output

[Bug c++/101241] Internal compiler error from MathFunctions.h in the eigen library

2021-06-28 Thread r.langer at itv dot rwth-aachen.de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101241

--- Comment #4 from Raymond Langer  ---
(In reply to Marek Polacek from comment #3)
> I cannot reproduce this:
> 
> $ xg++ -c a-eigen_bug.ii -O3 -ffast-math -march=haswell
> compiles.

Yes, 
g++ -c a-eigen_bug.ii -O3 -ffast-math -march=haswell
compiles.

However, -Ofast does not work together with -ffast-math:
g++ -c a-eigen_bug.ii -Ofast -ffast-math -march=haswell

[Bug c++/101241] Internal compiler error from MathFunctions.h in the eigen library

2021-06-28 Thread r.langer at itv dot rwth-aachen.de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101241

--- Comment #5 from Raymond Langer  ---
Using only -Ofast doesn't work either:
g++ -c a-eigen_bug.ii -Ofast

[Bug target/101241] Internal compiler error from MathFunctions.h in the eigen library

2021-06-28 Thread r.langer at itv dot rwth-aachen.de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101241

--- Comment #8 from Raymond Langer  ---
I didn't configure gcc myself. I run gcc in a Clean Linux docker container:

docker run -it clearlinux /bin/bash

In the docker container, I run:

swupd bundle-add c-basic

gcc --version

gcc (Clear Linux OS for Intel Architecture) 11.1.1 20210617
releases/gcc-11.1.0-303-ge86ad5ad01
Copyright (C) 2021 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.

The uploaded file does not compile with: 

g++ -c a-eigen_bug.ii -Ofast

[Bug target/101241] Internal compiler error from MathFunctions.h in the eigen library

2021-06-30 Thread r.langer at itv dot rwth-aachen.de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101241

--- Comment #10 from Raymond Langer  ---
I've reported the bug here:

https://github.com/clearlinux/distribution/issues/2393

The problem seems to be a Clear Linux patch.

Thanks for your support!