diff mbox

Bootstrap failure in tree-object-size.c due to -Wnarrowing (was: [C++ Patch] PR 50810)

Message ID 4EA47B66.8030707@oracle.com
State New
Headers show

Commit Message

Paolo Carlini Oct. 23, 2011, 8:39 p.m. UTC
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.

/////////////////

Comments

Eric Botcazou Oct. 23, 2011, 8:45 p.m. UTC | #1
> Anyway, the below appears to work for me. Eric shall I commit it?

I have other errors for config/i386/i386.c on my x86-64 machine.  But are we 
sure that we want to warn on

static unsigned HOST_WIDE_INT unknown[4] = { -1, -1, 0, 0 };

with -Wall?  This seems overly picky to me.
Paolo Carlini Oct. 23, 2011, 8:47 p.m. UTC | #2
On 10/23/2011 10:39 PM, Paolo Carlini wrote:
> 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?
Nope, doesn't work, there are *many* more issues in gcc/config.

I'm afraid we are not ready yet to enable this, target maintainer have 
to help cleaning up gcc/config first, I'm going to revert my patch.

Paolo.
Paolo Carlini Oct. 23, 2011, 8:59 p.m. UTC | #3
On 10/23/2011 10:47 PM, Paolo Carlini wrote:
> On 10/23/2011 10:39 PM, Paolo Carlini wrote:
>> 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?
> Nope, doesn't work, there are *many* more issues in gcc/config.
>
> I'm afraid we are not ready yet to enable this, target maintainer have 
> to help cleaning up gcc/config first, I'm going to revert my patch.
Done.

Paolo.
Gabriel Dos Reis Oct. 23, 2011, 9:05 p.m. UTC | #4
On Sun, Oct 23, 2011 at 3:45 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> Anyway, the below appears to work for me. Eric shall I commit it?
>
> I have other errors for config/i386/i386.c on my x86-64 machine.  But are we
> sure that we want to warn on
>
> static unsigned HOST_WIDE_INT unknown[4] = { -1, -1, 0, 0 };
>
> with -Wall?  This seems overly picky to me.
>

The warning probably should not be in -Wall.  It is fairly recent in C++, and I
think we should allow users to adapt before enabling it by default.
Paolo Carlini Oct. 23, 2011, 9:28 p.m. UTC | #5
On 10/23/2011 11:05 PM, Gabriel Dos Reis wrote:
> On Sun, Oct 23, 2011 at 3:45 PM, Eric Botcazou<ebotcazou@adacore.com>  wrote:
>>> Anyway, the below appears to work for me. Eric shall I commit it?
>> I have other errors for config/i386/i386.c on my x86-64 machine.  But are we
>> sure that we want to warn on
>>
>> static unsigned HOST_WIDE_INT unknown[4] = { -1, -1, 0, 0 };
>>
>> with -Wall?  This seems overly picky to me.
>>
> The warning probably should not be in -Wall.  It is fairly recent in C++, and I
> think we should allow users to adapt before enabling it by default.
The issue is that we wanted -Wconversion to be enabled by -Wc++0x-compat 
(after all, it's what the PR asks) but the latter is *already* in -Wall.

Personally, I would be in favor of taking -Wc++0x-compat out of -Wall.

Paolo.
Gabriel Dos Reis Oct. 23, 2011, 10:29 p.m. UTC | #6
On Sun, Oct 23, 2011 at 4:28 PM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> On 10/23/2011 11:05 PM, Gabriel Dos Reis wrote:
>>
>> On Sun, Oct 23, 2011 at 3:45 PM, Eric Botcazou<ebotcazou@adacore.com>
>>  wrote:
>>>>
>>>> Anyway, the below appears to work for me. Eric shall I commit it?
>>>
>>> I have other errors for config/i386/i386.c on my x86-64 machine.  But are
>>> we
>>> sure that we want to warn on
>>>
>>> static unsigned HOST_WIDE_INT unknown[4] = { -1, -1, 0, 0 };
>>>
>>> with -Wall?  This seems overly picky to me.
>>>
>> The warning probably should not be in -Wall.  It is fairly recent in C++,
>> and I
>> think we should allow users to adapt before enabling it by default.
>
> The issue is that we wanted -Wconversion to be enabled by -Wc++0x-compat
> (after all, it's what the PR asks) but the latter is *already* in -Wall.

yes.

>
> Personally, I would be in favor of taking -Wc++0x-compat out of -Wall.
>

Patch pre-approved.
It makes sense though that -Wextra implies -Wc++0x-compat.
Paolo Carlini Oct. 24, 2011, 12:54 a.m. UTC | #7
Hi,
>> Personally, I would be in favor of taking -Wc++0x-compat out of -Wall.
>>
> Patch pre-approved.
Thanks.
> It makes sense though that -Wextra implies -Wc++0x-compat.
Indeed, it would. However, unfortunately, we are using -W to bootstrap 
(it just failed on me). Thus I'm bootstrapping and testing the below, 
which just takes -Wc++0x-compat out from -Wall without adding it to -Wextra.

I'll wait anyway until tomorrow in case of further comments.

Thanks again,
Paolo.

//////////////////////////////
diff mbox

Patch

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 *,