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

            Bug ID: 83037
           Summary: ice in to_sreal_scale, at profile-count.c:275
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

For the following C++ code

class a {
public:
  ~a();
  bool b();
  void m_fn2();
};
a::~a() {
  if (b())
    m_fn2();
}
void c(a);
void fn2() {
  a d;
  c(d);
}
int __attribute__((flatten)) e() { fn2(); }

compiled by recent trunk gcc and flag -O2, I get the following result:

$ ~/gcc/results.254877/bin/g++ -c -O2 bug395.cc
bug395.cc: In function ‘int e()’:
bug395.cc:16:43: warning: no return statement in function returning non-void
[-Wreturn-type]
 int __attribute__((flatten)) e() { fn2(); }
                                           ^
during GIMPLE pass: einline
bug395.cc:16:43: internal compiler error: in to_sreal_scale, at
profile-count.c:275
0xe8cab8 profile_count::to_sreal_scale(profile_count, bool*) const
        ../../trunk/gcc/profile-count.c:275
0xd21189 estimate_edge_size_and_time
        ../../trunk/gcc/ipa-fnsummary.c:2579

The bug seems to occur between revisions 254826 and 254877.

Reply via email to