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

            Bug ID: 88074
           Summary: g++ hangs on math expression
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: coillol at yandex dot ru
  Target Milestone: ---

Piece of program that causes the problem:

#include <complex>
#include <vector>

using ValType = std::complex<double>;

void getValue(std::vector<ValType> &V) {
  static auto Fn = [](ValType Pt) -> ValType {
    return tan(sinh(acosh(Pt) + (Pt)));
  };

  for (int i = -500; i < 500; ++i) {
  double X = static_cast<double>(i) / 20.0;
    for (int j = -500; j < 500; ++j) {
      double Y = static_cast<double>(j) / 20.0;
      ValType Pt {X, Y};
      V.push_back(Fn(Pt));
    }
  }
}

Compilation with "-std=c++11 -O1 -ftree-pre" and g++ 7.2.0 never ends. Problem
also seems to be reproducible with any version of gcc starting from 5.1.

Reply via email to