From patchwork Sun Oct 23 20:39:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Bootstrap failure in tree-object-size.c due to -Wnarrowing (was: [C++ Patch] PR 50810) Date: Sun, 23 Oct 2011 10:39:02 -0000 From: Paolo Carlini X-Patchwork-Id: 121243 Message-Id: <4EA47B66.8030707@oracle.com> To: Eric Botcazou Cc: gcc-patches@gcc.gnu.org, Gerald Pfeifer , Jason Merrill On 10/23/2011 10:25 PM, Eric Botcazou wrote: >> Oh my, I thought I was till using C here... Ok, I'll fix that. > The base compiler is a C compiler, stage 2/3 are built with the C++ compiler. Yes, yes. Sorry about this. Anyway, the below appears to work for me. Eric shall I commit it? Thanks, Paolo. ///////////////// Index: tree-ssa-ccp.c =================================================================== --- tree-ssa-ccp.c (revision 180346) +++ tree-ssa-ccp.c (working copy) @@ -2011,7 +2011,9 @@ ccp_visit_stmt (gimple stmt, edge *taken_edge_p, t Mark them VARYING. */ FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_ALL_DEFS) { - prop_value_t v = { VARYING, NULL_TREE, { -1, (HOST_WIDE_INT) -1 } }; + prop_value_t v = + { VARYING, NULL_TREE, { (unsigned HOST_WIDE_INT) -1, + (HOST_WIDE_INT) -1 } }; set_lattice_value (def, v); } Index: tree-object-size.c =================================================================== --- tree-object-size.c (revision 180346) +++ tree-object-size.c (working copy) @@ -41,7 +41,9 @@ struct object_size_info unsigned int *stack, *tos; }; -static unsigned HOST_WIDE_INT unknown[4] = { -1, -1, 0, 0 }; +static unsigned HOST_WIDE_INT unknown[4] += { (unsigned HOST_WIDE_INT)-1, (unsigned HOST_WIDE_INT)-1, + (unsigned HOST_WIDE_INT)0, (unsigned HOST_WIDE_INT)0 }; static tree compute_object_offset (const_tree, const_tree); static unsigned HOST_WIDE_INT addr_object_size (struct object_size_info *,