public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: Update Wconversion testcase check type.
@ 2022-05-05 10:33 jiawei
  2022-05-05 18:45 ` Marek Polacek
  0 siblings, 1 reply; 5+ messages in thread
From: jiawei @ 2022-05-05 10:33 UTC (permalink / raw)
  To: gcc-patches
  Cc: polacek, palmer, jim.wilson.gcc, kito.cheng, wuwei2016, jiawei

Some compiler target like arm-linux\riscv\power\s390x\xtensa-gcc handle 
char as unsigned char, then there are no warnings occur and got FAIL cases.
Just change the type char into explicit signed char to keep the feature
consistency.

gcc/testsuite/ChangeLog:

        * c-c++-common/Wconversion-1.c: Update type.

---
 gcc/testsuite/c-c++-common/Wconversion-1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/c-c++-common/Wconversion-1.c b/gcc/testsuite/c-c++-common/Wconversion-1.c
index ed65918c70f..7053f6b5dbb 100644
--- a/gcc/testsuite/c-c++-common/Wconversion-1.c
+++ b/gcc/testsuite/c-c++-common/Wconversion-1.c
@@ -10,5 +10,5 @@ void g()
   signed char sc = 300; /* { dg-warning "conversion from .int. to .signed char. changes value from .300. to .44." } */
   unsigned char uc = 300; /* { dg-warning "conversion from .int. to .unsigned char. changes value from .300. to .44." } */
   unsigned char uc2 = 300u; /* { dg-warning "conversion from .unsigned int. to .unsigned char. changes value from .300. to .44." } */
-  char c2 = (double)1.0 + 200; /* { dg-warning "overflow in conversion from .double. to .char. changes value from .2.01e\\+2. to .127." } */
+  signed char c2 = (double)1.0 + 200; /* { dg-warning "overflow in conversion from .double. to .signed char. changes value from .2.01e\\+2. to .127." } */
 }
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] testsuite: Update Wconversion testcase check type.
  2022-05-05 10:33 [PATCH] testsuite: Update Wconversion testcase check type jiawei
@ 2022-05-05 18:45 ` Marek Polacek
  2022-05-10 21:58   ` Palmer Dabbelt
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Polacek @ 2022-05-05 18:45 UTC (permalink / raw)
  To: jiawei; +Cc: gcc-patches, wuwei2016, kito.cheng

On Thu, May 05, 2022 at 06:33:20PM +0800, jiawei wrote:
> Some compiler target like arm-linux\riscv\power\s390x\xtensa-gcc handle 
> char as unsigned char, then there are no warnings occur and got FAIL cases.
> Just change the type char into explicit signed char to keep the feature
> consistency.
> 
> gcc/testsuite/ChangeLog:
> 
>         * c-c++-common/Wconversion-1.c: Update type.

Ok, and sorry for introducing this problem!
 
> ---
>  gcc/testsuite/c-c++-common/Wconversion-1.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gcc/testsuite/c-c++-common/Wconversion-1.c b/gcc/testsuite/c-c++-common/Wconversion-1.c
> index ed65918c70f..7053f6b5dbb 100644
> --- a/gcc/testsuite/c-c++-common/Wconversion-1.c
> +++ b/gcc/testsuite/c-c++-common/Wconversion-1.c
> @@ -10,5 +10,5 @@ void g()
>    signed char sc = 300; /* { dg-warning "conversion from .int. to .signed char. changes value from .300. to .44." } */
>    unsigned char uc = 300; /* { dg-warning "conversion from .int. to .unsigned char. changes value from .300. to .44." } */
>    unsigned char uc2 = 300u; /* { dg-warning "conversion from .unsigned int. to .unsigned char. changes value from .300. to .44." } */
> -  char c2 = (double)1.0 + 200; /* { dg-warning "overflow in conversion from .double. to .char. changes value from .2.01e\\+2. to .127." } */
> +  signed char c2 = (double)1.0 + 200; /* { dg-warning "overflow in conversion from .double. to .signed char. changes value from .2.01e\\+2. to .127." } */
>  }
> -- 
> 2.25.1
> 

Marek


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] testsuite: Update Wconversion testcase check type.
  2022-05-05 18:45 ` Marek Polacek
@ 2022-05-10 21:58   ` Palmer Dabbelt
  2022-05-10 23:57     ` Marek Polacek
  0 siblings, 1 reply; 5+ messages in thread
From: Palmer Dabbelt @ 2022-05-10 21:58 UTC (permalink / raw)
  To: gcc-patches; +Cc: jiawei, kito.cheng, wuwei2016, gcc-patches

On Thu, 05 May 2022 11:45:50 PDT (-0700), gcc-patches@gcc.gnu.org wrote:
> On Thu, May 05, 2022 at 06:33:20PM +0800, jiawei wrote:
>> Some compiler target like arm-linux\riscv\power\s390x\xtensa-gcc handle
>> char as unsigned char, then there are no warnings occur and got FAIL cases.
>> Just change the type char into explicit signed char to keep the feature
>> consistency.
>>
>> gcc/testsuite/ChangeLog:
>>
>>         * c-c++-common/Wconversion-1.c: Update type.
>
> Ok, and sorry for introducing this problem!

So this is OK for trunk?  Happy to commit it if you'd like, just wanted 
to make sure as I'm not seeing it on trunk.

>> ---
>>  gcc/testsuite/c-c++-common/Wconversion-1.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/gcc/testsuite/c-c++-common/Wconversion-1.c b/gcc/testsuite/c-c++-common/Wconversion-1.c
>> index ed65918c70f..7053f6b5dbb 100644
>> --- a/gcc/testsuite/c-c++-common/Wconversion-1.c
>> +++ b/gcc/testsuite/c-c++-common/Wconversion-1.c
>> @@ -10,5 +10,5 @@ void g()
>>    signed char sc = 300; /* { dg-warning "conversion from .int. to .signed char. changes value from .300. to .44." } */
>>    unsigned char uc = 300; /* { dg-warning "conversion from .int. to .unsigned char. changes value from .300. to .44." } */
>>    unsigned char uc2 = 300u; /* { dg-warning "conversion from .unsigned int. to .unsigned char. changes value from .300. to .44." } */
>> -  char c2 = (double)1.0 + 200; /* { dg-warning "overflow in conversion from .double. to .char. changes value from .2.01e\\+2. to .127." } */
>> +  signed char c2 = (double)1.0 + 200; /* { dg-warning "overflow in conversion from .double. to .signed char. changes value from .2.01e\\+2. to .127." } */
>>  }
>> --
>> 2.25.1
>>
>
> Marek

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] testsuite: Update Wconversion testcase check type.
  2022-05-10 21:58   ` Palmer Dabbelt
@ 2022-05-10 23:57     ` Marek Polacek
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Polacek @ 2022-05-10 23:57 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: gcc-patches, kito.cheng, wuwei2016, jiawei

On Tue, May 10, 2022 at 02:58:49PM -0700, Palmer Dabbelt wrote:
> On Thu, 05 May 2022 11:45:50 PDT (-0700), gcc-patches@gcc.gnu.org wrote:
> > On Thu, May 05, 2022 at 06:33:20PM +0800, jiawei wrote:
> > > Some compiler target like arm-linux\riscv\power\s390x\xtensa-gcc handle
> > > char as unsigned char, then there are no warnings occur and got FAIL cases.
> > > Just change the type char into explicit signed char to keep the feature
> > > consistency.
> > > 
> > > gcc/testsuite/ChangeLog:
> > > 
> > >         * c-c++-common/Wconversion-1.c: Update type.
> > 
> > Ok, and sorry for introducing this problem!
> 
> So this is OK for trunk?  Happy to commit it if you'd like, just wanted to
> make sure as I'm not seeing it on trunk.

Yes, please go ahead.
 
Marek


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] testsuite: Update Wconversion testcase check type.
       [not found] <k49kbomqqftfj10bjs7e8o7p.1652323041358@email.android.com>
@ 2022-05-12  4:31 ` Palmer Dabbelt
  0 siblings, 0 replies; 5+ messages in thread
From: Palmer Dabbelt @ 2022-05-12  4:31 UTC (permalink / raw)
  To: jiawei; +Cc: gcc-patches, kito.cheng, wuwei2016

On Wed, 11 May 2022 19:37:21 PDT (-0700), jiawei@iscas.ac.cn wrote:
>    Thank you, it hasn't commited into the trunk yet.

Should be now.
>
>    ISCAS
>
>    å¨ Palmer Dabbelt <palmer@dabbelt.com>ï¼2022å¹´5æ11æ¥ ä¸å5:59åéï¼
>
>      On Thu, 05 May 2022 11:45:50 PDT (-0700), [1]gcc-patches@gcc.gnu.org
>      wrote:
>      > On Thu, May 05, 2022 at 06:33:20PM +0800, jiawei wrote:
>      >> Some compiler target like arm-linux\riscv\power\s390x\xtensa-gcc
>      handle
>      >> char as unsigned char, then there are no warnings occur and got
>      FAIL cases.
>      >> Just change the type char into explicit signed char to keep the
>      feature
>      >> consistency.
>      >>
>      >> gcc/testsuite/ChangeLog:
>      >>
>      >>Â Â Â Â Â Â Â Â  * c-c++-common/Wconversion-1.c: Update type.
>      >
>      > Ok, and sorry for introducing this problem!
>      So this is OK for trunk?  Happy to commit it if you'd like, just
>      wanted
>      to make sure as I'm not seeing it on trunk.
>      >> ---
>      >>Â  gcc/testsuite/c-c++-common/Wconversion-1.c | 2 +-
>      >>Â  1 file changed, 1 insertion(+), 1 deletion(-)
>      >>
>      >> diff --git a/gcc/testsuite/c-c++-common/Wconversion-1.c
>      b/gcc/testsuite/c-c++-common/Wconversion-1.c
>      >> index ed65918c70f..7053f6b5dbb 100644
>      >> --- a/gcc/testsuite/c-c++-common/Wconversion-1.c
>      >> +++ b/gcc/testsuite/c-c++-common/Wconversion-1.c
>      >> @@ -10,5 +10,5 @@ void g()
>      >>Â Â Â  signed char sc = 300; /* { dg-warning "conversion from
>      .int. to .signed char. changes value from .300. to .44." } */
>      >>Â Â Â  unsigned char uc = 300; /* { dg-warning "conversion from
>      .int. to .unsigned char. changes value from .300. to .44." } */
>      >>Â Â Â  unsigned char uc2 = 300u; /* { dg-warning "conversion from
>      .unsigned int. to .unsigned char. changes value from .300. to .44."
>      } */
>      >> -Â  char c2 = (double)1.0 + 200; /* { dg-warning "overflow in
>      conversion from .double. to .char. changes value from .2.01e\\+2. to
>      .127." } */
>      >> +Â  signed char c2 = (double)1.0 + 200; /* { dg-warning "overflow
>      in conversion from .double. to .signed char. changes value from
>      .2.01e\\+2. to .127." } */
>      >>Â  }
>      >> --
>      >> 2.25.1
>      >>
>      >
>      > Marek
>
> References
>
>    1. mailto:gcc-patches@gcc.gnu.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-12  4:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-05 10:33 [PATCH] testsuite: Update Wconversion testcase check type jiawei
2022-05-05 18:45 ` Marek Polacek
2022-05-10 21:58   ` Palmer Dabbelt
2022-05-10 23:57     ` Marek Polacek
     [not found] <k49kbomqqftfj10bjs7e8o7p.1652323041358@email.android.com>
2022-05-12  4:31 ` Palmer Dabbelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).