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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
The interesting thing is that doing

#include <new>

struct X
{
  ~X(){}
};

int main(int argc, char **argv)
{
  X *p = new (std::nothrow) X[argc];
}

properly conditionalizes this store:

TARGET_EXPR <D.6173, operator new [] (NON_LVALUE_EXPR <D.6174>, (const struct
nothrow_t &) &nothrow)>;;, (struct X *) D.6173 != 0B ? *(sizetype *)
NON_LVALUE_EXPR <D.6173> = SAVE_EXPR <(sizetype) argc>;, (struct X *) (D.6173 +
8); : (struct X *) D.6173;)

so something in the wrapping triggers the error.

Reply via email to