tree
build_float_cst (const real_t &value, Type *totype)
{
- real_t new_value;
+ real_value new_value;
TypeBasic *tb = totype->isTypeBasic ();
gcc_assert (tb != NULL);
tree type_node = build_ctype (tb);
- real_convert (&new_value.rv (), TYPE_MODE (type_node), &value.rv ());
+ real_convert (&new_value, TYPE_MODE (type_node), &value.rv ());
- return build_real (type_node, new_value.rv ());
+ return build_real (type_node, new_value);
}
/* Returns the .length component from the D dynamic array EXP. */
real_t
CTFloat::fabs (real_t r)
{
- real_t x;
+ real_t x = {};
real_arithmetic (&x.rv (), ABS_EXPR, &r.rv (), NULL);
return x.normalize ();
}
real_t
CTFloat::ldexp (real_t r, int exp)
{
- real_t x;
+ real_t x = {};
real_ldexp (&x.rv (), &r.rv (), exp);
return x.normalize ();
}
real_t
CTFloat::parse (const char *buffer, bool &overflow)
{
- real_t r;
+ real_t r = {};
real_from_string3 (&r.rv (), buffer, TYPE_MODE (long_double_type_node));
/* Front-end checks overflow to see if the value is representable. */
longdouble
longdouble::add (const longdouble &r) const
{
- longdouble x;
+ longdouble x = {};
real_arithmetic (&x.rv (), PLUS_EXPR, &this->rv (), &r.rv ());
return x.normalize ();
}
longdouble
longdouble::sub (const longdouble &r) const
{
- longdouble x;
+ longdouble x = {};
real_arithmetic (&x.rv (), MINUS_EXPR, &this->rv (), &r.rv ());
return x.normalize ();
}
longdouble
longdouble::mul (const longdouble &r) const
{
- longdouble x;
+ longdouble x = {};
real_arithmetic (&x.rv (), MULT_EXPR, &this->rv (), &r.rv ());
return x.normalize ();
}
longdouble
longdouble::div (const longdouble &r) const
{
- longdouble x;
+ longdouble x = {};
real_arithmetic (&x.rv (), RDIV_EXPR, &this->rv (), &r.rv ());
return x.normalize ();
}
longdouble
longdouble::mod (const longdouble &r) const
{
- longdouble x;
+ longdouble x = {};
real_value q;
if (r.rv ().cl == rvc_zero || REAL_VALUE_ISINF (this->rv ()))
longdouble
longdouble::neg (void) const
{
- longdouble x;
+ longdouble x = {};
real_arithmetic (&x.rv (), NEGATE_EXPR, &this->rv (), NULL);
return x.normalize ();
}
bool
Port::isFloat32LiteralOutOfRange (const char *buffer)
{
- real_t r;
+ real_t r = {};
real_from_string3 (&r.rv (), buffer, TYPE_MODE (float_type_node));
bool
Port::isFloat64LiteralOutOfRange (const char *buffer)
{
- real_t r;
+ real_t r = {};
real_from_string3 (&r.rv (), buffer, TYPE_MODE (double_type_node));
--- /dev/null
+// { dg-do compile }
+struct S116961
+{
+ float thing = 0.0;
+}
+
+static assert(__traits(isZeroInit, S116961) == true);