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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, though with a reduced testcase, I got the opposite effect of having
the constructor/deconstructor causing the warning to show up while not having
it causes it not to show.


struct g
{
  g();
  ~g();
};

[[gnu::always_inline]]
inline void nowarning_data(float *data, int &n)
{
  for(int i=0; i<4800; ++i)
    data[i] = n++;
}

[[gnu::always_inline]]
inline void warning_data(float *data, int &n)
{
  for(int i=0; i<4800; ++i)
    data[i] = n++;
}



void nowarning()
{
  float data[4800];
  int n { 0 };

  for(int i=0; i<800000; ++i) {
    nowarning_data(data, n);
  }
}
void warning()
{
  struct g d;
  float data[4800];
  int n { 0 };

  for(int i=0; i<800000; ++i) {
    warning_data(data, n);
  }
}

Reply via email to