Re: [PING] Re: [PATCH, i386] Fix some warnings/errors that appear when enabling -Wnarrowing when building gcc

2016-09-07 Thread Uros Bizjak
On Tue, Sep 6, 2016 at 8:06 PM, Eric Gallager  wrote:
> On 9/6/16, Uros Bizjak  wrote:
>> On Tue, Sep 6, 2016 at 5:33 PM, Eric Gallager  wrote:
>>> Ping? CC-ing an i386 maintainer since the patch mostly touches
>>> i386-specific files. Also, to clarify, I say "warnings/errors" because
>>> they start off as warnings in stage 1 but then become errors in stage
>>> 2. Note also that my patch leaves out the part where I modify the
>>> configure script to enable -Wnarrowing, because the rest of the code
>>> isn't quite ready for that yet.
>>
>> You are probably referring to [1]? It looks OK, modulo:
>>
>> +DEF_TUNE (X86_TUNE_QIMODE_MATH, "qimode_math", ~(0U))
>>
>> where parenthesis are not needed.
>>
>>
>> Please resubmit the patch with a ChangeLog entry, as instructed in [2]
>>
>> [1] https://gcc.gnu.org/ml/gcc-patches/2016-08/msg02129.html
>> [2] https://gcc.gnu.org/contribute.html#patches
>>
>> Uros.
>>
>
>
> Okay, reattached. Here's a ChangeLog entry to put in gcc/ChangeLog:
>
> 2016-09-06  Eric Gallager  
>
> * config/i386/i386.c: Add 'U' suffix to constants to avoid
> -Wnarrowing.
> * config/i386/x86-tune.def: Likewise.
> * opts.c: Likewise.
>
>
> (Please also note that I don't have commit access.)

Thanks, committed with slightly adjusted ChangeLog:

2016-09-07  Eric Gallager  

* config/i386/i386.c: Add 'U' suffix to processor feature bits
to avoid -Wnarrowing warning.
* config/i386/x86-tune.def: Likewise for DEF_TUNE selector bitmasks.
* opts.c: Likewise for SANITIZER_OPT bitmasks.

Uros.


Re: [PING] Re: [PATCH, i386] Fix some warnings/errors that appear when enabling -Wnarrowing when building gcc

2016-09-06 Thread Eric Gallager
On 9/6/16, Uros Bizjak  wrote:
> On Tue, Sep 6, 2016 at 5:33 PM, Eric Gallager  wrote:
>> Ping? CC-ing an i386 maintainer since the patch mostly touches
>> i386-specific files. Also, to clarify, I say "warnings/errors" because
>> they start off as warnings in stage 1 but then become errors in stage
>> 2. Note also that my patch leaves out the part where I modify the
>> configure script to enable -Wnarrowing, because the rest of the code
>> isn't quite ready for that yet.
>
> You are probably referring to [1]? It looks OK, modulo:
>
> +DEF_TUNE (X86_TUNE_QIMODE_MATH, "qimode_math", ~(0U))
>
> where parenthesis are not needed.
>
>
> Please resubmit the patch with a ChangeLog entry, as instructed in [2]
>
> [1] https://gcc.gnu.org/ml/gcc-patches/2016-08/msg02129.html
> [2] https://gcc.gnu.org/contribute.html#patches
>
> Uros.
>


Okay, reattached. Here's a ChangeLog entry to put in gcc/ChangeLog:

2016-09-06  Eric Gallager  

* config/i386/i386.c: Add 'U' suffix to constants to avoid
-Wnarrowing.
* config/i386/x86-tune.def: Likewise.
* opts.c: Likewise.


(Please also note that I don't have commit access.)
Thanks,
Eric
 gcc/config/i386/i386.c   | 60 ++--
 gcc/config/i386/x86-tune.def |  6 ++---
 gcc/opts.c   |  4 +--
 3 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 4531647..181fc39 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -2162,45 +2162,45 @@ const struct processor_costs *ix86_tune_cost = 
_cost;
 const struct processor_costs *ix86_cost = _cost;
 
 /* Processor feature/optimization bitmasks.  */
-#define m_386 (1<

Re: [PING] Re: [PATCH, i386] Fix some warnings/errors that appear when enabling -Wnarrowing when building gcc

2016-09-06 Thread Uros Bizjak
On Tue, Sep 6, 2016 at 5:33 PM, Eric Gallager  wrote:
> Ping? CC-ing an i386 maintainer since the patch mostly touches
> i386-specific files. Also, to clarify, I say "warnings/errors" because
> they start off as warnings in stage 1 but then become errors in stage
> 2. Note also that my patch leaves out the part where I modify the
> configure script to enable -Wnarrowing, because the rest of the code
> isn't quite ready for that yet.

You are probably referring to [1]? It looks OK, modulo:

+DEF_TUNE (X86_TUNE_QIMODE_MATH, "qimode_math", ~(0U))

where parenthesis are not needed.


Please resubmit the patch with a ChangeLog entry, as instructed in [2]

[1] https://gcc.gnu.org/ml/gcc-patches/2016-08/msg02129.html
[2] https://gcc.gnu.org/contribute.html#patches

Uros.

> On 8/31/16, Eric Gallager  wrote:
>> In https://gcc.gnu.org/ml/gcc-patches/2016-08/msg01526.html I tried
>> enabling -Wnarrowing when building GCC and produced a log of the
>> resulting (uniq-ed) warnings/errors. The attached patch here fixes
>> some of them by using the 'U' suffix to make certain constants
>> unsigned so they don't become negative when applying the '~' operator
>> to them. After applying, there were still some narrowing issues
>> remaining that would have required modifying gcc/optc-gen.awk to fix
>> properly, but that looked too complicated so I'm avoiding it for now.
>> Still, at least by patching the files I did patch, I allowed bootstrap
>> to continue a little farther...
>>
>> Thanks,
>> Eric Gallager
>>


[PING] Re: [PATCH, i386] Fix some warnings/errors that appear when enabling -Wnarrowing when building gcc

2016-09-06 Thread Eric Gallager
Ping? CC-ing an i386 maintainer since the patch mostly touches
i386-specific files. Also, to clarify, I say "warnings/errors" because
they start off as warnings in stage 1 but then become errors in stage
2. Note also that my patch leaves out the part where I modify the
configure script to enable -Wnarrowing, because the rest of the code
isn't quite ready for that yet.

On 8/31/16, Eric Gallager  wrote:
> In https://gcc.gnu.org/ml/gcc-patches/2016-08/msg01526.html I tried
> enabling -Wnarrowing when building GCC and produced a log of the
> resulting (uniq-ed) warnings/errors. The attached patch here fixes
> some of them by using the 'U' suffix to make certain constants
> unsigned so they don't become negative when applying the '~' operator
> to them. After applying, there were still some narrowing issues
> remaining that would have required modifying gcc/optc-gen.awk to fix
> properly, but that looked too complicated so I'm avoiding it for now.
> Still, at least by patching the files I did patch, I allowed bootstrap
> to continue a little farther...
>
> Thanks,
> Eric Gallager
>