Commit d425c5b0 by Richard Henderson Committed by Richard Henderson

emit-rtl.c (init_emit_once): Zero unused memory in a CONST_DOUBLE.

        * emit-rtl.c (init_emit_once): Zero unused memory in a
        CONST_DOUBLE.

From-SVN: r42423
parent 9ea659ac
2001-05-21 Richard Henderson <rth@redhat.com>
* emit-rtl.c (init_emit_once): Zero unused memory in a
CONST_DOUBLE.
2001-05-21 Mark Mitchell <mark@codesourcery.com> 2001-05-21 Mark Mitchell <mark@codesourcery.com>
* tree.h (type_num_arguments): Declare it. * tree.h (type_num_arguments): Declare it.
......
...@@ -4336,9 +4336,16 @@ init_emit_once (line_numbers) ...@@ -4336,9 +4336,16 @@ init_emit_once (line_numbers)
rtx tem = rtx_alloc (CONST_DOUBLE); rtx tem = rtx_alloc (CONST_DOUBLE);
union real_extract u; union real_extract u;
memset ((char *) &u, 0, sizeof u); /* Zero any holes in a structure. */ /* Zero any holes in a structure. */
memset ((char *) &u, 0, sizeof u);
u.d = i == 0 ? dconst0 : i == 1 ? dconst1 : dconst2; u.d = i == 0 ? dconst0 : i == 1 ? dconst1 : dconst2;
/* Avoid trailing garbage in the rtx. */
if (sizeof (u) < sizeof (HOST_WIDE_INT))
CONST_DOUBLE_LOW (tem) = 0;
if (sizeof (u) < 2 * sizeof (HOST_WIDE_INT))
CONST_DOUBLE_HIGH (tem) = 0;
memcpy (&CONST_DOUBLE_LOW (tem), &u, sizeof u); memcpy (&CONST_DOUBLE_LOW (tem), &u, sizeof u);
CONST_DOUBLE_MEM (tem) = cc0_rtx; CONST_DOUBLE_MEM (tem) = cc0_rtx;
CONST_DOUBLE_CHAIN (tem) = NULL_RTX; CONST_DOUBLE_CHAIN (tem) = NULL_RTX;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment