diff mbox

add more detail to -Wconversion and -Woverflow (PR 80731)

Message ID 315bf6c8-04e5-01ac-7278-d93c04f83b0e@gmail.com
State New
Headers show

Commit Message

Martin Sebor May 18, 2017, 12:04 a.m. UTC
While working on a new warning for unsafe conversion I noticed
that the existing warnings that diagnose these kinds of problems
are missing some useful detail. For example, given declarations
of an integer Type and an integer Constant defined in some header,
a C programmer who writes this declaration:

   Type x = Constant;

might see the following:

   warning: overflow in implicit constant conversion [-Woverflow]

To help the programmer better understand the problem and its impact
it would be helpful to mention the types of the operands, and if
available, also the values of the expressions.  For instance, like
so:

   warning: overflow in conversion from ‘int’ to ‘T {aka signed char}’ 
changes value from ‘123456789’ to ‘21’ [-Woverflow]

The attached simple patch does just that.  In making the changes
I tried to make the text of all the warnings follow the same
consistent wording pattern without losing any essential information
(e.g., I dropped "implicit" or "constant" because the implicit part
is evident from the code (no cast) and explicit conversions aren't
diagnosed, and because constant is apparent from the rest of the
diagnostic that includes its value.

Besides adding more detail and tweaking the wording the patch
makes no functional changes (i.e., doesn't add new or remove
existing warnings).

Martin

PS While adjusting the tests (a painstaking process) it occurred
to me that these kinds of changes would be a whole lot easier if
dg-warning directives simply checked for "-Woption-name" rather
than some (often arbitrary) part of the warning text.  It might
even be more accurate if the pattern happens to match the text
of two or more warnings controlled by different options.

It's of course important to also exercise the full text of
the warnings, especially where additional detail is included
(like in this patch), but that can be done in a small subset
of tests.  All the others that just verify the presence of
a warning controlled by a given option could use the simpler
approach.

Comments

Martin Sebor May 23, 2017, 2:42 a.m. UTC | #1
Ping:
   https://gcc.gnu.org/ml/gcc-patches/2017-05/msg01428.html

On 05/17/2017 06:04 PM, Martin Sebor wrote:
> While working on a new warning for unsafe conversion I noticed
> that the existing warnings that diagnose these kinds of problems
> are missing some useful detail. For example, given declarations
> of an integer Type and an integer Constant defined in some header,
> a C programmer who writes this declaration:
>
>   Type x = Constant;
>
> might see the following:
>
>   warning: overflow in implicit constant conversion [-Woverflow]
>
> To help the programmer better understand the problem and its impact
> it would be helpful to mention the types of the operands, and if
> available, also the values of the expressions.  For instance, like
> so:
>
>   warning: overflow in conversion from ‘int’ to ‘T {aka signed char}’
> changes value from ‘123456789’ to ‘21’ [-Woverflow]
>
> The attached simple patch does just that.  In making the changes
> I tried to make the text of all the warnings follow the same
> consistent wording pattern without losing any essential information
> (e.g., I dropped "implicit" or "constant" because the implicit part
> is evident from the code (no cast) and explicit conversions aren't
> diagnosed, and because constant is apparent from the rest of the
> diagnostic that includes its value.
>
> Besides adding more detail and tweaking the wording the patch
> makes no functional changes (i.e., doesn't add new or remove
> existing warnings).
>
> Martin
>
> PS While adjusting the tests (a painstaking process) it occurred
> to me that these kinds of changes would be a whole lot easier if
> dg-warning directives simply checked for "-Woption-name" rather
> than some (often arbitrary) part of the warning text.  It might
> even be more accurate if the pattern happens to match the text
> of two or more warnings controlled by different options.
>
> It's of course important to also exercise the full text of
> the warnings, especially where additional detail is included
> (like in this patch), but that can be done in a small subset
> of tests.  All the others that just verify the presence of
> a warning controlled by a given option could use the simpler
> approach.
Joseph Myers May 24, 2017, 5:08 p.m. UTC | #2
On Wed, 17 May 2017, Martin Sebor wrote:

> @@ -1036,31 +1079,76 @@ warnings_for_convert_and_check (location_t loc, tree type, tree expr,
>  	  /* This detects cases like converting -129 or 256 to
>  	     unsigned char.  */
>  	  if (!int_fits_type_p (expr, c_common_signed_type (type)))
> -	    warning_at (loc, OPT_Woverflow,
> -			"large integer implicitly truncated to unsigned type");
> +	    {
> +	      if (cst)
> +		warning_at (loc, OPT_Woverflow,
> +			    (TYPE_UNSIGNED (exprtype)
> +			     ? "conversion from %qT to %qT "
> +			     "changes value from %qE to %qE"
> +			     : "unsigned conversion from %qT to %qT "
> +			     "changes value from %qE to %qE"),
> +			    exprtype, type, expr, result);
> +	      else
> +		warning_at (loc, OPT_Woverflow,
> +			    (TYPE_UNSIGNED (exprtype)
> +			     ? "conversion from %qT to %qT "
> +			     "changes the value of %qE"
> +			     : "unsigned conversion from %qT to %qT "
> +			     "changes the value of %qE"),
> +			    exprtype, type, expr);
> +	    }

You need to use G_() around both arguments to ?:, otherwise only one will 
get extracted for translation.

> diff --git a/gcc/testsuite/c-c++-common/pr68657-1.c b/gcc/testsuite/c-c++-common/pr68657-1.c
> index 84f3e54..33fdf86 100644
> --- a/gcc/testsuite/c-c++-common/pr68657-1.c
> +++ b/gcc/testsuite/c-c++-common/pr68657-1.c
> @@ -5,14 +5,14 @@
>  void
>  f1 (void)
>  {
> -  unsigned int a = -5;	/* { dg-error "negative integer implicitly converted to unsigned type" } */
> +  unsigned int a = -5;	/* { dg-error "unsigned conversion from .int. to .unsigned int. changes value from .-5. to .4294967291." } */

The more specific match would fail for targets with 16-bit int.  You need 
to keep it less specific in this test (if you want to test the more 
specific text as well, another test could be added for that, restricted to 
the int32 effective-target).

(The changes to Wconversion-real-integer-3.C and 
Wconversion-real-integer2.C are OK in that those tests are restricted to 
int32plus, although in theory 64-bit int would be an issue there.)

> +  /* According to 6.3.1.3 of C11:
> +     -3-  Otherwise, the new type is signed and the value cannot be
> +          represented in it; either the result is implementation-defined
> +	  or an implementation-defined signal is raised.
> +
> +     In GCC such conversios wrap and diagnosed by mentioning "overflow"
> +     if the absolut value of the operand is in excess of the maximum of
> +     the destination of type, and "conversion" otherwise, as follows:  */

s/conversios/conversions/; s/absolut/absolute/

OK with those changes.
Martin Sebor May 24, 2017, 10:16 p.m. UTC | #3
On 05/24/2017 11:08 AM, Joseph Myers wrote:
> On Wed, 17 May 2017, Martin Sebor wrote:
>
>> @@ -1036,31 +1079,76 @@ warnings_for_convert_and_check (location_t loc, tree type, tree expr,
>>  	  /* This detects cases like converting -129 or 256 to
>>  	     unsigned char.  */
>>  	  if (!int_fits_type_p (expr, c_common_signed_type (type)))
>> -	    warning_at (loc, OPT_Woverflow,
>> -			"large integer implicitly truncated to unsigned type");
>> +	    {
>> +	      if (cst)
>> +		warning_at (loc, OPT_Woverflow,
>> +			    (TYPE_UNSIGNED (exprtype)
>> +			     ? "conversion from %qT to %qT "
>> +			     "changes value from %qE to %qE"
>> +			     : "unsigned conversion from %qT to %qT "
>> +			     "changes value from %qE to %qE"),
>> +			    exprtype, type, expr, result);
>> +	      else
>> +		warning_at (loc, OPT_Woverflow,
>> +			    (TYPE_UNSIGNED (exprtype)
>> +			     ? "conversion from %qT to %qT "
>> +			     "changes the value of %qE"
>> +			     : "unsigned conversion from %qT to %qT "
>> +			     "changes the value of %qE"),
>> +			    exprtype, type, expr);
>> +	    }
>
> You need to use G_() around both arguments to ?:, otherwise only one will
> get extracted for translation.
>
>> diff --git a/gcc/testsuite/c-c++-common/pr68657-1.c b/gcc/testsuite/c-c++-common/pr68657-1.c
>> index 84f3e54..33fdf86 100644
>> --- a/gcc/testsuite/c-c++-common/pr68657-1.c
>> +++ b/gcc/testsuite/c-c++-common/pr68657-1.c
>> @@ -5,14 +5,14 @@
>>  void
>>  f1 (void)
>>  {
>> -  unsigned int a = -5;	/* { dg-error "negative integer implicitly converted to unsigned type" } */
>> +  unsigned int a = -5;	/* { dg-error "unsigned conversion from .int. to .unsigned int. changes value from .-5. to .4294967291." } */
>
> The more specific match would fail for targets with 16-bit int.  You need
> to keep it less specific in this test (if you want to test the more
> specific text as well, another test could be added for that, restricted to
> the int32 effective-target).
>
> (The changes to Wconversion-real-integer-3.C and
> Wconversion-real-integer2.C are OK in that those tests are restricted to
> int32plus, although in theory 64-bit int would be an issue there.)
>
>> +  /* According to 6.3.1.3 of C11:
>> +     -3-  Otherwise, the new type is signed and the value cannot be
>> +          represented in it; either the result is implementation-defined
>> +	  or an implementation-defined signal is raised.
>> +
>> +     In GCC such conversios wrap and diagnosed by mentioning "overflow"
>> +     if the absolut value of the operand is in excess of the maximum of
>> +     the destination of type, and "conversion" otherwise, as follows:  */
>
> s/conversios/conversions/; s/absolut/absolute/
>
> OK with those changes.

Thanks for the careful review!  Done and committed in r248431.

Martin
Andreas Schwab May 25, 2017, 3:34 p.m. UTC | #4
FAIL: gcc.dg/overflow-warn-9.c  (test for warnings, line 59)
FAIL: gcc.dg/overflow-warn-9.c  (test for warnings, line 60)
FAIL: gcc.dg/overflow-warn-9.c  (test for warnings, line 62)
FAIL: gcc.dg/overflow-warn-9.c (test for excess errors)
Excess errors:
/daten/aranym/gcc/gcc-20170525/gcc/testsuite/gcc.dg/overflow-warn-9.c:62:9: warning: signed conversion from 'long unsigned int' to 'long int' changes value from '2147483648' to '-2147483648' [-Wsign-conversion]

FAIL: gcc.dg/pr59963-2.c  (test for warnings, line 16)
FAIL: gcc.dg/pr59963-2.c (test for excess errors)
Excess errors:
/daten/aranym/gcc/gcc-20170525/gcc/testsuite/gcc.dg/pr59963-2.c:16:6: warning: overflow in conversion from 'long unsigned int' to 'short int' changes value from '4294967295' to '-1' [-Woverflow]

FAIL: gcc.dg/pr60114.c  (test for warnings, line 12)
FAIL: gcc.dg/pr60114.c  (test for warnings, line 13)
FAIL: gcc.dg/pr60114.c  (test for warnings, line 14)
FAIL: gcc.dg/pr60114.c  (test for warnings, line 23)
FAIL: gcc.dg/pr60114.c  (test for warnings, line 24)
FAIL: gcc.dg/pr60114.c (test for excess errors)
Excess errors:
/daten/aranym/gcc/gcc-20170525/gcc/testsuite/gcc.dg/pr60114.c:12:9: warning: signed conversion from 'unsigned int' to 'int' changes value from '2147483648' to '-2147483648' [-Wsign-conversion]
/daten/aranym/gcc/gcc-20170525/gcc/testsuite/gcc.dg/pr60114.c:13:11: warning: signed conversion from 'unsigned int' to 'int' changes value from '2147483648' to '-2147483648' [-Wsign-conversion]
/daten/aranym/gcc/gcc-20170525/gcc/testsuite/gcc.dg/pr60114.c:14:16: warning: signed conversion from 'unsigned int' to 'int' changes value from '2147483648' to '-2147483648' [-Wsign-conversion]
/daten/aranym/gcc/gcc-20170525/gcc/testsuite/gcc.dg/pr60114.c:23:17: warning: overflow in conversion from 'int' to 'signed char' changes value from '256' to '0' [-Woverflow]
/daten/aranym/gcc/gcc-20170525/gcc/testsuite/gcc.dg/pr60114.c:24:20: warning: overflow in conversion from 'int' to 'signed char' changes value from '256' to '0' [-Woverflow]

Andreas.
Martin Sebor May 25, 2017, 4:52 p.m. UTC | #5
Thank you.  The excess failures should be gone with r248464.

Some comments below.

On 05/25/2017 09:34 AM, Andreas Schwab wrote:
> FAIL: gcc.dg/overflow-warn-9.c  (test for warnings, line 59)
> FAIL: gcc.dg/overflow-warn-9.c  (test for warnings, line 60)
> FAIL: gcc.dg/overflow-warn-9.c  (test for warnings, line 62)
> FAIL: gcc.dg/overflow-warn-9.c (test for excess errors)
> Excess errors:
> /daten/aranym/gcc/gcc-20170525/gcc/testsuite/gcc.dg/overflow-warn-9.c:62:9: warning: signed conversion from 'long unsigned int' to 'long int' changes value from '2147483648' to '-2147483648' [-Wsign-conversion]

These were ILP32 issues.

> FAIL: gcc.dg/pr59963-2.c  (test for warnings, line 16)
> FAIL: gcc.dg/pr59963-2.c (test for excess errors)
> Excess errors:
> /daten/aranym/gcc/gcc-20170525/gcc/testsuite/gcc.dg/pr59963-2.c:16:6: warning: overflow in conversion from 'long unsigned int' to 'short int' changes value from '4294967295' to '-1' [-Woverflow]
>
> FAIL: gcc.dg/pr60114.c  (test for warnings, line 12)
> FAIL: gcc.dg/pr60114.c  (test for warnings, line 13)
> FAIL: gcc.dg/pr60114.c  (test for warnings, line 14)
> FAIL: gcc.dg/pr60114.c  (test for warnings, line 23)
> FAIL: gcc.dg/pr60114.c  (test for warnings, line 24)
> FAIL: gcc.dg/pr60114.c (test for excess errors)
> Excess errors:
> /daten/aranym/gcc/gcc-20170525/gcc/testsuite/gcc.dg/pr60114.c:12:9: warning: signed conversion from 'unsigned int' to 'int' changes value from '2147483648' to '-2147483648' [-Wsign-conversion]
> /daten/aranym/gcc/gcc-20170525/gcc/testsuite/gcc.dg/pr60114.c:13:11: warning: signed conversion from 'unsigned int' to 'int' changes value from '2147483648' to '-2147483648' [-Wsign-conversion]
> /daten/aranym/gcc/gcc-20170525/gcc/testsuite/gcc.dg/pr60114.c:14:16: warning: signed conversion from 'unsigned int' to 'int' changes value from '2147483648' to '-2147483648' [-Wsign-conversion]
> /daten/aranym/gcc/gcc-20170525/gcc/testsuite/gcc.dg/pr60114.c:23:17: warning: overflow in conversion from 'int' to 'signed char' changes value from '256' to '0' [-Woverflow]
> /daten/aranym/gcc/gcc-20170525/gcc/testsuite/gcc.dg/pr60114.c:24:20: warning: overflow in conversion from 'int' to 'signed char' changes value from '256' to '0' [-Woverflow]

Besides verifying the right warning on each line, these tests
also verify the column number of each expected warning, e.g.,
like so (pr59963-2.c):

   return f (0xffffffffL, /* { dg-warning "13:-Woverflow" } */
             0xffffffffL) /* { dg-warning "13:-Woverflow" } */
          && f (0xffffffffL, /* { dg-warning "9:-Woverflow" } */
                0xffffffffL); /* { dg-warning "9:-Woverflow" } */

The 13 is the 1-based column number corresponding to the number
of characters from the beginning of the line to the position
of the caret in the source file.  To make things interesting,
the column number hardcoded into the tests is not the same as
what one sees in editors like emacs that use zerop-based column
numbers, or even others like vi that translate tabs into the
appropriate number of spaces.  Some lines in some tests have
all spaces, others may have tabs.  That's why above, the third
line has a lower column number than the two above it, even though
the caret on the third line is expected to be offset farther to
the right.

The script I use to apply patches after they have been approved
and retested one last time just before the final commit adjusts
whitespace to conform to the GNU coding standard (among other
things).  In particular, it replaces blocks of 8 spaces with
tabs as the outdated rule still requires.  That breaks these
assertions.

I'll change my script to avoid changing tests but I think the
long term solution is to eliminate the outdated requirement to
replace spaces with tabs.  It serves no useful purpose and only
makes things harder for us.  Another option is to tweak either
DejaGnu or the GCC part of it to treat a tab the same as a block
of 8 spaces.

Martin
Andreas Schwab May 28, 2017, 2:41 p.m. UTC | #6
On Mai 17 2017, Martin Sebor <msebor@gmail.com> wrote:

> diff --git a/gcc/testsuite/g++.dg/ext/utf16-4.C b/gcc/testsuite/g++.dg/ext/utf16-4.C
> index e8d6531..2c4377c 100644
> --- a/gcc/testsuite/g++.dg/ext/utf16-4.C
> +++ b/gcc/testsuite/g++.dg/ext/utf16-4.C
> @@ -10,9 +10,9 @@ const static char16_t	c2 = u'\U00064321';	/* { dg-warning "constant too long" }
>  const static char16_t	c3 = 'a';
>  const static char16_t	c4 = U'a';
>  const static char16_t	c5 = U'\u2029';
> -const static char16_t	c6 = U'\U00064321';	/* { dg-warning "implicitly truncated" } */
> +const static char16_t	c6 = U'\U00064321';	/* { dg-warning "conversion from .char32_t. to .char16_t. changes value from .410401. to .17185." } */
>  const static char16_t	c7 = L'a';
>  const static char16_t	c8 = L'\u2029';
> -const static char16_t	c9 = L'\U00064321';	/* { dg-warning "implicitly truncated" "" { target { 4byte_wchar_t } } } */
> +const static char16_t	c9 = L'\U00064321';	/* { dg-warning "unsigned conversion from .wchar_t. to .char16_t. changes value from .410401. to .17185." "" { target { 4byte_wchar_t } } } */

That fails on aarch64.

FAIL: g++.dg/ext/utf16-4.C  -std=c++11  (test for warnings, line 16)
FAIL: g++.dg/ext/utf16-4.C  -std=c++11 (test for excess errors)
Excess errors:
/opt/gcc/gcc-20170528/gcc/testsuite/g++.dg/ext/utf16-4.C:16:28: warning: conversion from 'wchar_t' to 'char16_t' changes value from '410401' to '17185' [-Woverflow]

Andreas.
Christophe Lyon May 29, 2017, 2:02 p.m. UTC | #7
On 25 May 2017 at 00:16, Martin Sebor <msebor@gmail.com> wrote:
> On 05/24/2017 11:08 AM, Joseph Myers wrote:
>>
>> On Wed, 17 May 2017, Martin Sebor wrote:
>>
>>> @@ -1036,31 +1079,76 @@ warnings_for_convert_and_check (location_t loc,
>>> tree type, tree expr,
>>>           /* This detects cases like converting -129 or 256 to
>>>              unsigned char.  */
>>>           if (!int_fits_type_p (expr, c_common_signed_type (type)))
>>> -           warning_at (loc, OPT_Woverflow,
>>> -                       "large integer implicitly truncated to unsigned
>>> type");
>>> +           {
>>> +             if (cst)
>>> +               warning_at (loc, OPT_Woverflow,
>>> +                           (TYPE_UNSIGNED (exprtype)
>>> +                            ? "conversion from %qT to %qT "
>>> +                            "changes value from %qE to %qE"
>>> +                            : "unsigned conversion from %qT to %qT "
>>> +                            "changes value from %qE to %qE"),
>>> +                           exprtype, type, expr, result);
>>> +             else
>>> +               warning_at (loc, OPT_Woverflow,
>>> +                           (TYPE_UNSIGNED (exprtype)
>>> +                            ? "conversion from %qT to %qT "
>>> +                            "changes the value of %qE"
>>> +                            : "unsigned conversion from %qT to %qT "
>>> +                            "changes the value of %qE"),
>>> +                           exprtype, type, expr);
>>> +           }
>>
>>
>> You need to use G_() around both arguments to ?:, otherwise only one will
>> get extracted for translation.
>>
>>> diff --git a/gcc/testsuite/c-c++-common/pr68657-1.c
>>> b/gcc/testsuite/c-c++-common/pr68657-1.c
>>> index 84f3e54..33fdf86 100644
>>> --- a/gcc/testsuite/c-c++-common/pr68657-1.c
>>> +++ b/gcc/testsuite/c-c++-common/pr68657-1.c
>>> @@ -5,14 +5,14 @@
>>>  void
>>>  f1 (void)
>>>  {
>>> -  unsigned int a = -5; /* { dg-error "negative integer implicitly
>>> converted to unsigned type" } */
>>> +  unsigned int a = -5; /* { dg-error "unsigned conversion from .int. to
>>> .unsigned int. changes value from .-5. to .4294967291." } */
>>
>>
>> The more specific match would fail for targets with 16-bit int.  You need
>> to keep it less specific in this test (if you want to test the more
>> specific text as well, another test could be added for that, restricted to
>> the int32 effective-target).
>>
>> (The changes to Wconversion-real-integer-3.C and
>> Wconversion-real-integer2.C are OK in that those tests are restricted to
>> int32plus, although in theory 64-bit int would be an issue there.)
>>
>>> +  /* According to 6.3.1.3 of C11:
>>> +     -3-  Otherwise, the new type is signed and the value cannot be
>>> +          represented in it; either the result is implementation-defined
>>> +         or an implementation-defined signal is raised.
>>> +
>>> +     In GCC such conversios wrap and diagnosed by mentioning "overflow"
>>> +     if the absolut value of the operand is in excess of the maximum of
>>> +     the destination of type, and "conversion" otherwise, as follows:
>>> */
>>
>>
>> s/conversios/conversions/; s/absolut/absolute/
>>
>> OK with those changes.
>
>
> Thanks for the careful review!  Done and committed in r248431.
>

Hi,

I have noticed failures on arm*:
  Executed from: gcc.dg/fixed-point/fixed-point.exp
    gcc.dg/fixed-point/int-warning.c  (test for warnings, line 12)
    gcc.dg/fixed-point/int-warning.c  (test for warnings, line 13)
    gcc.dg/fixed-point/int-warning.c  (test for warnings, line 14)
    gcc.dg/fixed-point/int-warning.c  (test for warnings, line 15)
    gcc.dg/fixed-point/int-warning.c  (test for warnings, line 16)
    gcc.dg/fixed-point/int-warning.c  (test for warnings, line 17)
    gcc.dg/fixed-point/int-warning.c  (test for warnings, line 18)
    gcc.dg/fixed-point/int-warning.c  (test for warnings, line 19)
    gcc.dg/fixed-point/int-warning.c  (test for warnings, line 20)
    gcc.dg/fixed-point/int-warning.c  (test for warnings, line 21)
    gcc.dg/fixed-point/int-warning.c  (test for warnings, line 22)
    gcc.dg/fixed-point/int-warning.c  (test for warnings, line 23)
    gcc.dg/fixed-point/int-warning.c (test for excess errors)

Excess errors:
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:12:8:
warning: overflow in conversion from '_Accum' to 'signed char' chages
value from '5.0e+2' to '-12' [-Woverflow]
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:13:8:
warning: overflow in conversion from '_Accum' to 'signed char' chages
value from '-5.0e+2' to '12' [-Woverflow]
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:14:8:
warning: overflow in conversion from 'long _Accum' to 'signed char'
chages value from '5.0e+2' to '-12' [-Woverflow]
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:15:8:
warning: overflow in conversion from 'long _Accum' to 'signed char'
chages value from '-5.0e+2' to '12' [-Woverflow]
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:16:8:
warning: overflow in conversion from 'long long _Accum' to 'signed
char' chages value from '5.0e+2' to '-12' [-Woverflow]
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:17:8:
warning: overflow in conversion from 'long long _Accum' to 'signed
char' chages value from '-5.0e+2' to '12' [-Woverflow]
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:18:8:
warning: overflow in conversion from '_Accum' to 'unsigned char'
chages value from '5.0e+2' to '244' [-Woverflow]
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:19:8:
warning: overflow in conversion from '_Accum' to 'unsigned char'
chages value from '-5.0e+2' to '12' [-Woverflow]
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:20:8:
warning: overflow in conversion from 'long _Accum' to 'unsigned char'
chages value from '5.0e+2' to '244' [-Woverflow]
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:21:8:
warning: overflow in conversion from 'long _Accum' to 'unsigned char'
chages value from '-5.0e+2' to '12' [-Woverflow]
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:22:8:
warning: overflow in conversion from 'long long _Accum' to 'unsigned
char' chages value from '5.0e+2' to '244' [-Woverflow]
/aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:23:8:
warning: overflow in conversion from 'long long _Accum' to 'unsigned
char' chages value from '-5.0e+2' to '12' [-Woverflow]

Still present at r248552.

Thanks,

Christophe

> Martin
>
Martin Sebor May 30, 2017, 9:28 p.m. UTC | #8
On 05/29/2017 08:02 AM, Christophe Lyon wrote:
> On 25 May 2017 at 00:16, Martin Sebor <msebor@gmail.com> wrote:
>> On 05/24/2017 11:08 AM, Joseph Myers wrote:
>>>
>>> On Wed, 17 May 2017, Martin Sebor wrote:
>>>
>>>> @@ -1036,31 +1079,76 @@ warnings_for_convert_and_check (location_t loc,
>>>> tree type, tree expr,
>>>>           /* This detects cases like converting -129 or 256 to
>>>>              unsigned char.  */
>>>>           if (!int_fits_type_p (expr, c_common_signed_type (type)))
>>>> -           warning_at (loc, OPT_Woverflow,
>>>> -                       "large integer implicitly truncated to unsigned
>>>> type");
>>>> +           {
>>>> +             if (cst)
>>>> +               warning_at (loc, OPT_Woverflow,
>>>> +                           (TYPE_UNSIGNED (exprtype)
>>>> +                            ? "conversion from %qT to %qT "
>>>> +                            "changes value from %qE to %qE"
>>>> +                            : "unsigned conversion from %qT to %qT "
>>>> +                            "changes value from %qE to %qE"),
>>>> +                           exprtype, type, expr, result);
>>>> +             else
>>>> +               warning_at (loc, OPT_Woverflow,
>>>> +                           (TYPE_UNSIGNED (exprtype)
>>>> +                            ? "conversion from %qT to %qT "
>>>> +                            "changes the value of %qE"
>>>> +                            : "unsigned conversion from %qT to %qT "
>>>> +                            "changes the value of %qE"),
>>>> +                           exprtype, type, expr);
>>>> +           }
>>>
>>>
>>> You need to use G_() around both arguments to ?:, otherwise only one will
>>> get extracted for translation.
>>>
>>>> diff --git a/gcc/testsuite/c-c++-common/pr68657-1.c
>>>> b/gcc/testsuite/c-c++-common/pr68657-1.c
>>>> index 84f3e54..33fdf86 100644
>>>> --- a/gcc/testsuite/c-c++-common/pr68657-1.c
>>>> +++ b/gcc/testsuite/c-c++-common/pr68657-1.c
>>>> @@ -5,14 +5,14 @@
>>>>  void
>>>>  f1 (void)
>>>>  {
>>>> -  unsigned int a = -5; /* { dg-error "negative integer implicitly
>>>> converted to unsigned type" } */
>>>> +  unsigned int a = -5; /* { dg-error "unsigned conversion from .int. to
>>>> .unsigned int. changes value from .-5. to .4294967291." } */
>>>
>>>
>>> The more specific match would fail for targets with 16-bit int.  You need
>>> to keep it less specific in this test (if you want to test the more
>>> specific text as well, another test could be added for that, restricted to
>>> the int32 effective-target).
>>>
>>> (The changes to Wconversion-real-integer-3.C and
>>> Wconversion-real-integer2.C are OK in that those tests are restricted to
>>> int32plus, although in theory 64-bit int would be an issue there.)
>>>
>>>> +  /* According to 6.3.1.3 of C11:
>>>> +     -3-  Otherwise, the new type is signed and the value cannot be
>>>> +          represented in it; either the result is implementation-defined
>>>> +         or an implementation-defined signal is raised.
>>>> +
>>>> +     In GCC such conversios wrap and diagnosed by mentioning "overflow"
>>>> +     if the absolut value of the operand is in excess of the maximum of
>>>> +     the destination of type, and "conversion" otherwise, as follows:
>>>> */
>>>
>>>
>>> s/conversios/conversions/; s/absolut/absolute/
>>>
>>> OK with those changes.
>>
>>
>> Thanks for the careful review!  Done and committed in r248431.
>>
>
> Hi,
>
> I have noticed failures on arm*:
>   Executed from: gcc.dg/fixed-point/fixed-point.exp
>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 12)
>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 13)
>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 14)
>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 15)
>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 16)
>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 17)
>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 18)
>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 19)
>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 20)
>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 21)
>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 22)
>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 23)
>     gcc.dg/fixed-point/int-warning.c (test for excess errors)
>
> Excess errors:
> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:12:8:
> warning: overflow in conversion from '_Accum' to 'signed char' chages
> value from '5.0e+2' to '-12' [-Woverflow]
> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:13:8:
> warning: overflow in conversion from '_Accum' to 'signed char' chages
> value from '-5.0e+2' to '12' [-Woverflow]
> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:14:8:
> warning: overflow in conversion from 'long _Accum' to 'signed char'
> chages value from '5.0e+2' to '-12' [-Woverflow]
> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:15:8:
> warning: overflow in conversion from 'long _Accum' to 'signed char'
> chages value from '-5.0e+2' to '12' [-Woverflow]
> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:16:8:
> warning: overflow in conversion from 'long long _Accum' to 'signed
> char' chages value from '5.0e+2' to '-12' [-Woverflow]
> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:17:8:
> warning: overflow in conversion from 'long long _Accum' to 'signed
> char' chages value from '-5.0e+2' to '12' [-Woverflow]
> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:18:8:
> warning: overflow in conversion from '_Accum' to 'unsigned char'
> chages value from '5.0e+2' to '244' [-Woverflow]
> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:19:8:
> warning: overflow in conversion from '_Accum' to 'unsigned char'
> chages value from '-5.0e+2' to '12' [-Woverflow]
> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:20:8:
> warning: overflow in conversion from 'long _Accum' to 'unsigned char'
> chages value from '5.0e+2' to '244' [-Woverflow]
> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:21:8:
> warning: overflow in conversion from 'long _Accum' to 'unsigned char'
> chages value from '-5.0e+2' to '12' [-Woverflow]
> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:22:8:
> warning: overflow in conversion from 'long long _Accum' to 'unsigned
> char' chages value from '5.0e+2' to '244' [-Woverflow]
> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:23:8:
> warning: overflow in conversion from 'long long _Accum' to 'unsigned
> char' chages value from '-5.0e+2' to '12' [-Woverflow]
>
> Still present at r248552.

Both of these should be fixed by r248700..

Martin
Christophe Lyon May 31, 2017, 7:19 a.m. UTC | #9
On 30 May 2017 at 23:28, Martin Sebor <msebor@gmail.com> wrote:
> On 05/29/2017 08:02 AM, Christophe Lyon wrote:
>>
>> On 25 May 2017 at 00:16, Martin Sebor <msebor@gmail.com> wrote:
>>>
>>> On 05/24/2017 11:08 AM, Joseph Myers wrote:
>>>>
>>>>
>>>> On Wed, 17 May 2017, Martin Sebor wrote:
>>>>
>>>>> @@ -1036,31 +1079,76 @@ warnings_for_convert_and_check (location_t loc,
>>>>> tree type, tree expr,
>>>>>           /* This detects cases like converting -129 or 256 to
>>>>>              unsigned char.  */
>>>>>           if (!int_fits_type_p (expr, c_common_signed_type (type)))
>>>>> -           warning_at (loc, OPT_Woverflow,
>>>>> -                       "large integer implicitly truncated to unsigned
>>>>> type");
>>>>> +           {
>>>>> +             if (cst)
>>>>> +               warning_at (loc, OPT_Woverflow,
>>>>> +                           (TYPE_UNSIGNED (exprtype)
>>>>> +                            ? "conversion from %qT to %qT "
>>>>> +                            "changes value from %qE to %qE"
>>>>> +                            : "unsigned conversion from %qT to %qT "
>>>>> +                            "changes value from %qE to %qE"),
>>>>> +                           exprtype, type, expr, result);
>>>>> +             else
>>>>> +               warning_at (loc, OPT_Woverflow,
>>>>> +                           (TYPE_UNSIGNED (exprtype)
>>>>> +                            ? "conversion from %qT to %qT "
>>>>> +                            "changes the value of %qE"
>>>>> +                            : "unsigned conversion from %qT to %qT "
>>>>> +                            "changes the value of %qE"),
>>>>> +                           exprtype, type, expr);
>>>>> +           }
>>>>
>>>>
>>>>
>>>> You need to use G_() around both arguments to ?:, otherwise only one
>>>> will
>>>> get extracted for translation.
>>>>
>>>>> diff --git a/gcc/testsuite/c-c++-common/pr68657-1.c
>>>>> b/gcc/testsuite/c-c++-common/pr68657-1.c
>>>>> index 84f3e54..33fdf86 100644
>>>>> --- a/gcc/testsuite/c-c++-common/pr68657-1.c
>>>>> +++ b/gcc/testsuite/c-c++-common/pr68657-1.c
>>>>> @@ -5,14 +5,14 @@
>>>>>  void
>>>>>  f1 (void)
>>>>>  {
>>>>> -  unsigned int a = -5; /* { dg-error "negative integer implicitly
>>>>> converted to unsigned type" } */
>>>>> +  unsigned int a = -5; /* { dg-error "unsigned conversion from .int.
>>>>> to
>>>>> .unsigned int. changes value from .-5. to .4294967291." } */
>>>>
>>>>
>>>>
>>>> The more specific match would fail for targets with 16-bit int.  You
>>>> need
>>>> to keep it less specific in this test (if you want to test the more
>>>> specific text as well, another test could be added for that, restricted
>>>> to
>>>> the int32 effective-target).
>>>>
>>>> (The changes to Wconversion-real-integer-3.C and
>>>> Wconversion-real-integer2.C are OK in that those tests are restricted to
>>>> int32plus, although in theory 64-bit int would be an issue there.)
>>>>
>>>>> +  /* According to 6.3.1.3 of C11:
>>>>> +     -3-  Otherwise, the new type is signed and the value cannot be
>>>>> +          represented in it; either the result is
>>>>> implementation-defined
>>>>> +         or an implementation-defined signal is raised.
>>>>> +
>>>>> +     In GCC such conversios wrap and diagnosed by mentioning
>>>>> "overflow"
>>>>> +     if the absolut value of the operand is in excess of the maximum
>>>>> of
>>>>> +     the destination of type, and "conversion" otherwise, as follows:
>>>>> */
>>>>
>>>>
>>>>
>>>> s/conversios/conversions/; s/absolut/absolute/
>>>>
>>>> OK with those changes.
>>>
>>>
>>>
>>> Thanks for the careful review!  Done and committed in r248431.
>>>
>>
>> Hi,
>>
>> I have noticed failures on arm*:
>>   Executed from: gcc.dg/fixed-point/fixed-point.exp
>>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 12)
>>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 13)
>>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 14)
>>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 15)
>>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 16)
>>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 17)
>>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 18)
>>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 19)
>>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 20)
>>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 21)
>>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 22)
>>     gcc.dg/fixed-point/int-warning.c  (test for warnings, line 23)
>>     gcc.dg/fixed-point/int-warning.c (test for excess errors)
>>
>> Excess errors:
>>
>> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:12:8:
>> warning: overflow in conversion from '_Accum' to 'signed char' chages
>> value from '5.0e+2' to '-12' [-Woverflow]
>>
>> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:13:8:
>> warning: overflow in conversion from '_Accum' to 'signed char' chages
>> value from '-5.0e+2' to '12' [-Woverflow]
>>
>> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:14:8:
>> warning: overflow in conversion from 'long _Accum' to 'signed char'
>> chages value from '5.0e+2' to '-12' [-Woverflow]
>>
>> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:15:8:
>> warning: overflow in conversion from 'long _Accum' to 'signed char'
>> chages value from '-5.0e+2' to '12' [-Woverflow]
>>
>> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:16:8:
>> warning: overflow in conversion from 'long long _Accum' to 'signed
>> char' chages value from '5.0e+2' to '-12' [-Woverflow]
>>
>> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:17:8:
>> warning: overflow in conversion from 'long long _Accum' to 'signed
>> char' chages value from '-5.0e+2' to '12' [-Woverflow]
>>
>> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:18:8:
>> warning: overflow in conversion from '_Accum' to 'unsigned char'
>> chages value from '5.0e+2' to '244' [-Woverflow]
>>
>> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:19:8:
>> warning: overflow in conversion from '_Accum' to 'unsigned char'
>> chages value from '-5.0e+2' to '12' [-Woverflow]
>>
>> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:20:8:
>> warning: overflow in conversion from 'long _Accum' to 'unsigned char'
>> chages value from '5.0e+2' to '244' [-Woverflow]
>>
>> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:21:8:
>> warning: overflow in conversion from 'long _Accum' to 'unsigned char'
>> chages value from '-5.0e+2' to '12' [-Woverflow]
>>
>> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:22:8:
>> warning: overflow in conversion from 'long long _Accum' to 'unsigned
>> char' chages value from '5.0e+2' to '244' [-Woverflow]
>>
>> /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/fixed-point/int-warning.c:23:8:
>> warning: overflow in conversion from 'long long _Accum' to 'unsigned
>> char' chages value from '-5.0e+2' to '12' [-Woverflow]
>>
>> Still present at r248552.
>
>
> Both of these should be fixed by r248700..
>
OK for me indeed, thanks.

Christophe

> Martin
>
diff mbox

Patch

PR c/80731 - poor -Woverflow warnings

gcc/c-family/ChangeLog:

	PR c/80731
	* c-common.h (unsafe_conversion_p): Add a function argument.
	* c-common.c (unsafe_conversion_p): Same.
	Add type names and values to diagnostics.
	(scalar_to_vector): Adjust.
	* c-warn.c (constant_expression_error): Add a function argument.
	Add type names and values to diagnostics.
	(conversion_warning): Add a function argument.
	Add type names and values to diagnostics.
	(warnings_for_convert_and_check): Same.

gcc/c/ChangeLog:

	PR c/80731
	* c-fold.c (c_fully_fold_internal): Adjust.
	* c-typeck.c (parser_build_unary_op): Adjust.

gcc/cp/ChangeLog:

	PR c/80731
	* call.c (fully_fold_internal): Adjust.

gcc/testsuite/ChangeLog:

	PR c/80731
	* c-c++-common/Wfloat-conversion.c: Adjust.
	* c-c++-common/dfp/convert-int-saturate.c: Same.
	* c-c++-common/pr68657-1.c: Same.
	* g++.dg/ext/utf-cvt.C: Same.
	* g++.dg/ext/utf16-4.C: Same.
	* g++.dg/warn/Wconversion-real-integer-3.C: Same.
	* g++.dg/warn/Wconversion-real-integer2.C: Same.
	* g++.dg/warn/Wconversion3.C: Same.
	* g++.dg/warn/Wconversion4.C: Same.
	* g++.dg/warn/Wsign-conversion.C: Same.
	* g++.dg/warn/overflow-warn-1.C: Same.
	* g++.dg/warn/overflow-warn-3.C: Same.
	* g++.dg/warn/overflow-warn-4.C: Same.
	* g++.dg/warn/pr35635.C: Same.
	* g++.old-deja/g++.mike/enum1.C: Same.
	* gcc.dg/Wconversion-3.c: Same.
	* gcc.dg/Wconversion-5.c: Same.
	* gcc.dg/Wconversion-complex-c99.c: Same.
	* gcc.dg/Wconversion-complex-gnu.c: Same.
	* gcc.dg/Wconversion-integer.c: Same.
	* gcc.dg/Wsign-conversion.c: Same.
	* gcc.dg/bitfld-2.c: Same.
	* gcc.dg/c90-const-expr-11.c: Same.
	* gcc.dg/c90-const-expr-7.c: Same.
	* gcc.dg/c99-const-expr-7.c: Same.
	* gcc.dg/overflow-warn-1.c: Same.
	* gcc.dg/overflow-warn-2.c: Same.
	* gcc.dg/overflow-warn-3.c: Same.
	* gcc.dg/overflow-warn-4.c: Same.
	* gcc.dg/overflow-warn-5.c: Same.
	* gcc.dg/overflow-warn-8.c: Same.
	* gcc.dg/overflow-warn-9.c: New test.
	* gcc.dg/pr35635.c: Adjust.
	* gcc.dg/pr59940.c: Same.
	* gcc.dg/pr59963-2.c: Same.
	* gcc.dg/pr60114.c: Same.
	* gcc.dg/switch-warn-2.c: Same.
	* gcc.dg/utf-cvt.c: Same.
	* gcc.dg/utf16-4.c: Same.

diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index ad686d2..95841c9 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -1225,16 +1225,24 @@  int_safely_convertible_to_real_p (const_tree from_type, const_tree to_type)
    can return SAFE_CONVERSION (zero) in that case.  Function can produce
    signedness warnings if PRODUCE_WARNS is true.
 
+   RESULT, when non-null is the result of the conversion.  When constant
+   it is included in the text of diagnostics.
+
    Function allows conversions from complex constants to non-complex types,
    provided that imaginary part is zero and real part can be safely converted
    to TYPE.  */
 
 enum conversion_safety
-unsafe_conversion_p (location_t loc, tree type, tree expr, bool produce_warns)
+unsafe_conversion_p (location_t loc, tree type, tree expr, tree result,
+		     bool produce_warns)
 {
   enum conversion_safety give_warning = SAFE_CONVERSION; /* is 0 or false */
   tree expr_type = TREE_TYPE (expr);
-  loc = expansion_point_location_if_in_system_header (loc);
+
+  bool cstresult = (result
+		    && TREE_CODE_CLASS (TREE_CODE (result)) == tcc_constant);
+
+    loc = expansion_point_location_if_in_system_header (loc);
 
   if (TREE_CODE (expr) == REAL_CST || TREE_CODE (expr) == INTEGER_CST)
     {
@@ -1260,14 +1268,31 @@  unsafe_conversion_p (location_t loc, tree type, tree expr, bool produce_warns)
 	      && tree_int_cst_sgn (expr) < 0)
 	    {
 	      if (produce_warns)
-		warning_at (loc, OPT_Wsign_conversion, "negative integer"
-			    " implicitly converted to unsigned type");
+		{
+		  if (cstresult)
+		    warning_at (loc, OPT_Wsign_conversion,
+				"unsigned conversion from %qT to %qT "
+				"changes value from %qE to %qE",
+				expr_type, type, expr, result);
+		  else
+		    warning_at (loc, OPT_Wsign_conversion,
+				"unsigned conversion from %qT to %qT "
+				"changes the value of %qE",
+				expr_type, type, expr);
+		}
 	    }
 	  else if (!TYPE_UNSIGNED (type) && TYPE_UNSIGNED (expr_type))
 	    {
-	      if (produce_warns)
-		warning_at (loc, OPT_Wsign_conversion, "conversion of unsigned"
-			    " constant value to negative integer");
+	      if (cstresult)
+		warning_at (loc, OPT_Wsign_conversion,
+			    "signed conversion from %qT to %qT changes "
+			    "value from %qE to %qE",
+			    expr_type, type, expr, result);
+	      else
+		warning_at (loc, OPT_Wsign_conversion,
+			    "signed conversion from %qT to %qT changes "
+			    "the value of %qE",
+			    expr_type, type, expr);
 	    }
 	  else
 	    give_warning = UNSAFE_OTHER;
@@ -1306,7 +1331,7 @@  unsafe_conversion_p (location_t loc, tree type, tree expr, bool produce_warns)
 	   with different type of EXPR, but it is still safe, because when EXPR
 	   is a constant, it's type is not used in text of generated warnings
 	   (otherwise they could sound misleading).  */
-	return unsafe_conversion_p (loc, type, TREE_REALPART (expr),
+	return unsafe_conversion_p (loc, type, TREE_REALPART (expr), result,
 				    produce_warns);
       /* Conversion from complex constant with non-zero imaginary part.  */
       else
@@ -1326,9 +1351,10 @@  unsafe_conversion_p (location_t loc, tree type, tree expr, bool produce_warns)
 		 Possible solution: add a separate function for checking
 		 constants and combine result of two calls appropriately.  */
 	      enum conversion_safety re_safety =
-		  unsafe_conversion_p (loc, type, TREE_REALPART (expr), false);
+		  unsafe_conversion_p (loc, type, TREE_REALPART (expr),
+				       result, false);
 	      enum conversion_safety im_safety =
-		  unsafe_conversion_p (loc, type, imag_part, false);
+		unsafe_conversion_p (loc, type, imag_part, result, false);
 
 	      /* Merge the results into appropriate single warning.  */
 
@@ -7670,7 +7696,8 @@  scalar_to_vector (location_t loc, enum tree_code code, tree op0, tree op1,
 	if (TREE_CODE (type0) == INTEGER_TYPE
 	    && TREE_CODE (TREE_TYPE (type1)) == INTEGER_TYPE)
 	  {
-	    if (unsafe_conversion_p (loc, TREE_TYPE (type1), op0, false))
+	    if (unsafe_conversion_p (loc, TREE_TYPE (type1), op0,
+				     NULL_TREE, false))
 	      {
 		if (complain)
 		  error_at (loc, "conversion of scalar %qT to vector %qT "
@@ -7718,7 +7745,8 @@  scalar_to_vector (location_t loc, enum tree_code code, tree op0, tree op1,
 	if (TREE_CODE (type0) == INTEGER_TYPE
 	    && TREE_CODE (TREE_TYPE (type1)) == INTEGER_TYPE)
 	  {
-	    if (unsafe_conversion_p (loc, TREE_TYPE (type1), op0, false))
+	    if (unsafe_conversion_p (loc, TREE_TYPE (type1), op0,
+				     NULL_TREE, false))
 	      {
 		if (complain)
 		  error_at (loc, "conversion of scalar %qT to vector %qT "
@@ -7733,7 +7761,8 @@  scalar_to_vector (location_t loc, enum tree_code code, tree op0, tree op1,
 		     || TREE_CODE (type0) == INTEGER_TYPE)
 		 && SCALAR_FLOAT_TYPE_P (TREE_TYPE (type1)))
 	  {
-	    if (unsafe_conversion_p (loc, TREE_TYPE (type1), op0, false))
+	    if (unsafe_conversion_p (loc, TREE_TYPE (type1), op0,
+				     NULL_TREE, false))
 	      {
 		if (complain)
 		  error_at (loc, "conversion of scalar %qT to vector %qT "
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 9e3982d..a77c84f 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -831,7 +831,7 @@  extern tree c_common_signed_type (tree);
 extern tree c_common_signed_or_unsigned_type (int, tree);
 extern void c_common_init_ts (void);
 extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int);
-extern enum conversion_safety unsafe_conversion_p (location_t, tree, tree,
+extern enum conversion_safety unsafe_conversion_p (location_t, tree, tree, tree,
 						   bool);
 extern bool decl_with_nonnull_addr_p (const_tree);
 extern tree c_fully_fold (tree, bool, bool *);
@@ -1483,7 +1483,7 @@  extern bool cilk_recognize_spawn (tree, tree *);
 /* In c-warn.c.  */
 extern void constant_expression_warning (tree);
 extern void constant_expression_error (tree);
-extern void overflow_warning (location_t, tree);
+extern void overflow_warning (location_t, tree, tree = NULL_TREE);
 extern void warn_logical_operator (location_t, enum tree_code, tree,
 				   enum tree_code, tree, enum tree_code, tree);
 extern void warn_tautological_cmp (location_t, enum tree_code, tree, tree);
diff --git a/gcc/c-family/c-warn.c b/gcc/c-family/c-warn.c
index aa0cfa9..6e83c53 100644
--- a/gcc/c-family/c-warn.c
+++ b/gcc/c-family/c-warn.c
@@ -63,8 +63,9 @@  constant_expression_error (tree value)
     error ("overflow in constant expression");
 }
 
-/* Print a warning if an expression had overflow in folding and its
-   operands hadn't.
+/* Print a warning if an expression result VALUE had an overflow
+   in folding and its operands hadn't.  EXPR, which may be null, is
+   the operand of the expression.
 
    Invoke this function on every expression that
    (1) appears in the source code, and
@@ -75,42 +76,74 @@  constant_expression_error (tree value)
    already overflowed.  */
 
 void
-overflow_warning (location_t loc, tree value)
+overflow_warning (location_t loc, tree value, tree expr)
 {
   if (c_inhibit_evaluation_warnings != 0)
     return;
 
+  const char *warnfmt = NULL;
+
   switch (TREE_CODE (value))
     {
     case INTEGER_CST:
-      warning_at (loc, OPT_Woverflow, "integer overflow in expression");
+      warnfmt = (expr
+		 ? G_("integer overflow in expression %qE of type %qT "
+		      "results in %qE")
+		 : G_("integer overflow in expression of type %qT "
+		      "results in %qE"));
       break;
 
     case REAL_CST:
-      warning_at (loc, OPT_Woverflow,
-		  "floating point overflow in expression");
+      warnfmt = (expr
+		 ? G_ ("floating point overflow in expression %qE "
+		       "of type %qT results in %qE")
+		 : G_ ("floating point overflow in expression of type %qT "
+		       "results in %qE"));
       break;
 
     case FIXED_CST:
-      warning_at (loc, OPT_Woverflow, "fixed-point overflow in expression");
+      warnfmt = (expr
+		 ? G_("fixed-point overflow in expression %qE of type %qT "
+		      "results in %qE")
+		 : G_("fixed-point overflow in expression of type %qT "
+		      "results in %qE"));
       break;
 
     case VECTOR_CST:
-      warning_at (loc, OPT_Woverflow, "vector overflow in expression");
+      warnfmt = (expr
+		 ? G_("vector overflow in expression %qE of type %qT "
+		      "results in %qE")
+		 : G_("vector overflow in expression of type %qT "
+		      "results in %qE"));
       break;
 
     case COMPLEX_CST:
       if (TREE_CODE (TREE_REALPART (value)) == INTEGER_CST)
-	warning_at (loc, OPT_Woverflow,
-		    "complex integer overflow in expression");
+	warnfmt = (expr
+		   ? G_("complex integer overflow in expression %qE "
+			"of type %qT results in %qE")
+		   : G_("complex integer overflow in expression of type %qT "
+			"results in %qE"));
       else if (TREE_CODE (TREE_REALPART (value)) == REAL_CST)
-	warning_at (loc, OPT_Woverflow,
-		    "complex floating point overflow in expression");
+	warnfmt = (expr
+		   ? G_("complex floating point overflow in expression %qE "
+			"of type %qT results in %qE")
+		   : G_("complex floating point overflow in expression "
+			"of type %qT results in %qE"));
+      else
+	return;
       break;
 
     default:
-      break;
+      return;
     }
+
+  if (expr)
+    warning_at (loc, OPT_Woverflow, warnfmt, expr, TREE_TYPE (expr), value);
+  else
+    warning_at (loc, OPT_Woverflow, warnfmt, TREE_TYPE (value), value);
+
+  TREE_NO_WARNING (value) = 1;
 }
 
 /* Helper function for walk_tree.  Unwrap C_MAYBE_CONST_EXPRs in an expression
@@ -930,7 +963,7 @@  check_main_parameter_types (tree decl)
    This is a helper function for warnings_for_convert_and_check.  */
 
 static void
-conversion_warning (location_t loc, tree type, tree expr)
+conversion_warning (location_t loc, tree type, tree expr, tree result)
 {
   tree expr_type = TREE_TYPE (expr);
   enum conversion_safety conversion_kind;
@@ -971,43 +1004,49 @@  conversion_warning (location_t loc, tree type, tree expr)
     case REAL_CST:
     case INTEGER_CST:
     case COMPLEX_CST:
-      conversion_kind = unsafe_conversion_p (loc, type, expr, true);
-      if (conversion_kind == UNSAFE_REAL)
-	warning_at (loc, OPT_Wfloat_conversion,
-		    "conversion to %qT alters %qT constant value",
-		    type, expr_type);
-      else if (conversion_kind)
-	warning_at (loc, OPT_Wconversion,
-		    "conversion to %qT alters %qT constant value",
-		    type, expr_type);
-      return;
+      {
+	conversion_kind = unsafe_conversion_p (loc, type, expr, result, true);
+	int warnopt;
+	if (conversion_kind == UNSAFE_REAL)
+	  warnopt = OPT_Wfloat_conversion;
+	else if (conversion_kind)
+	  warnopt = OPT_Wconversion;
+	else
+	  break;
 
+	if (TREE_CODE_CLASS (TREE_CODE (result)) == tcc_constant)
+	  warning_at (loc, warnopt,
+		      "conversion from %qT to %qT changes value from %qE to %qE",
+		      expr_type, type, expr, result);
+	else
+	  warning_at (loc, warnopt,
+		      "conversion from %qT to %qT changes the value of %qE",
+		      expr_type, type, expr);
+	break;
+      }
     case COND_EXPR:
-      {
+	  {
 	/* In case of COND_EXPR, we do not care about the type of
 	   COND_EXPR, only about the conversion of each operand.  */
 	tree op1 = TREE_OPERAND (expr, 1);
 	tree op2 = TREE_OPERAND (expr, 2);
 
-	conversion_warning (loc, type, op1);
-	conversion_warning (loc, type, op2);
+	conversion_warning (loc, type, op1, result);
+	conversion_warning (loc, type, op2, result);
 	return;
       }
 
     default: /* 'expr' is not a constant.  */
-      conversion_kind = unsafe_conversion_p (loc, type, expr, true);
-      if (conversion_kind == UNSAFE_REAL)
-	warning_at (loc, OPT_Wfloat_conversion,
-		    "conversion to %qT from %qT may alter its value",
-		    type, expr_type);
-      else if (conversion_kind == UNSAFE_IMAGINARY)
-	warning_at (loc, OPT_Wconversion,
-		    "conversion to %qT from %qT discards imaginary component",
-		    type, expr_type);
-      else if (conversion_kind)
+      conversion_kind = unsafe_conversion_p (loc, type, expr, result, true);
+      if (conversion_kind == UNSAFE_IMAGINARY)
 	warning_at (loc, OPT_Wconversion,
-		    "conversion to %qT from %qT may alter its value",
-		    type, expr_type);
+		    "conversion from %qT to to %qT discards imaginary "
+		    "component",
+		    expr_type, type);
+      else if (conversion_kind == UNSAFE_REAL || conversion_kind)
+	warning_at (loc, OPT_Wfloat_conversion,
+		    "conversion from %qT to %qT may change value",
+		    expr_type, type);
     }
 }
 
@@ -1021,6 +1060,10 @@  warnings_for_convert_and_check (location_t loc, tree type, tree expr,
 {
   loc = expansion_point_location_if_in_system_header (loc);
 
+  bool cst = TREE_CODE_CLASS (TREE_CODE (result)) == tcc_constant;
+
+  tree exprtype = TREE_TYPE (expr);
+
   if (TREE_CODE (expr) == INTEGER_CST
       && (TREE_CODE (type) == INTEGER_TYPE
 	  || TREE_CODE (type) == ENUMERAL_TYPE)
@@ -1036,31 +1079,76 @@  warnings_for_convert_and_check (location_t loc, tree type, tree expr,
 	  /* This detects cases like converting -129 or 256 to
 	     unsigned char.  */
 	  if (!int_fits_type_p (expr, c_common_signed_type (type)))
-	    warning_at (loc, OPT_Woverflow,
-			"large integer implicitly truncated to unsigned type");
+	    {
+	      if (cst)
+		warning_at (loc, OPT_Woverflow,
+			    (TYPE_UNSIGNED (exprtype)
+			     ? "conversion from %qT to %qT "
+			     "changes value from %qE to %qE"
+			     : "unsigned conversion from %qT to %qT "
+			     "changes value from %qE to %qE"),
+			    exprtype, type, expr, result);
+	      else
+		warning_at (loc, OPT_Woverflow,
+			    (TYPE_UNSIGNED (exprtype)
+			     ? "conversion from %qT to %qT "
+			     "changes the value of %qE"
+			     : "unsigned conversion from %qT to %qT "
+			     "changes the value of %qE"),
+			    exprtype, type, expr);
+	    }
 	  else
-	    conversion_warning (loc, type, expr);
+	    conversion_warning (loc, type, expr, result);
 	}
       else if (!int_fits_type_p (expr, c_common_unsigned_type (type)))
-	warning_at (loc, OPT_Woverflow,
-		 "overflow in implicit constant conversion");
+	{
+	  if (cst)
+	    warning_at (loc, OPT_Woverflow,
+			"overflow in conversion from %qT to %qT "
+			"changes value from %qE to %qE",
+			exprtype, type, expr, result);
+	  else
+	    warning_at (loc, OPT_Woverflow,
+			"overflow in conversion from %qT to %qT "
+			"changes the value of %qE",
+			exprtype, type, expr);
+	}
       /* No warning for converting 0x80000000 to int.  */
       else if (pedantic
-	       && (TREE_CODE (TREE_TYPE (expr)) != INTEGER_TYPE
-		   || TYPE_PRECISION (TREE_TYPE (expr))
+	       && (TREE_CODE (exprtype) != INTEGER_TYPE
+		   || TYPE_PRECISION (exprtype)
 		   != TYPE_PRECISION (type)))
-	warning_at (loc, OPT_Woverflow,
-		    "overflow in implicit constant conversion");
-
+	{
+	  if (cst)
+	    warning_at (loc, OPT_Woverflow,
+			"overflow in conversion from %qT to %qT "
+			"changes value from %qE to %qE",
+			exprtype, type, expr, result);
+	  else
+	    warning_at (loc, OPT_Woverflow,
+			"overflow in conversion from %qT to %qT "
+			"changes the value of %qE",
+			exprtype, type, expr);
+	}
       else
-	conversion_warning (loc, type, expr);
+	conversion_warning (loc, type, expr, result);
     }
   else if ((TREE_CODE (result) == INTEGER_CST
 	    || TREE_CODE (result) == FIXED_CST) && TREE_OVERFLOW (result))
-    warning_at (loc, OPT_Woverflow,
-		"overflow in implicit constant conversion");
+    {
+      if (cst)
+	warning_at (loc, OPT_Woverflow,
+		    "overflow in conversion from %qT to %qT "
+		    "chages value from %qE to %qE",
+		    exprtype, type, expr, result);
+      else
+	warning_at (loc, OPT_Woverflow,
+		    "overflow in conversion from %qT to %qT "
+		    "chages the value of %qE",
+		    exprtype, type, expr);
+    }
   else
-    conversion_warning (loc, type, expr);
+    conversion_warning (loc, type, expr, result);
 }
 
 /* Subroutines of c_do_switch_warnings, called via splay_tree_foreach.
diff --git a/gcc/c/c-fold.c b/gcc/c/c-fold.c
index b060d76..32dc70b 100644
--- a/gcc/c/c-fold.c
+++ b/gcc/c/c-fold.c
@@ -308,7 +308,7 @@  c_fully_fold_internal (tree expr, bool in_init, bool *maybe_const_operands,
       if (TREE_OVERFLOW_P (ret)
 	  && !TREE_OVERFLOW_P (op0)
 	  && !TREE_OVERFLOW_P (op1))
-	overflow_warning (EXPR_LOC_OR_LOC (expr, input_location), ret);
+	overflow_warning (EXPR_LOC_OR_LOC (expr, input_location), ret, expr);
       if (code == LSHIFT_EXPR
 	  && TREE_CODE (orig_op0) != INTEGER_CST
 	  && TREE_CODE (TREE_TYPE (orig_op0)) == INTEGER_TYPE
@@ -429,7 +429,7 @@  c_fully_fold_internal (tree expr, bool in_init, bool *maybe_const_operands,
 
 	default:
 	  if (TREE_OVERFLOW_P (ret) && !TREE_OVERFLOW_P (op0))
-	    overflow_warning (EXPR_LOCATION (expr), ret);
+	    overflow_warning (EXPR_LOCATION (expr), ret, op0);
 	  break;
 	}
       goto out;
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 6f9909c..2d818da 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -3587,7 +3587,7 @@  parser_build_unary_op (location_t loc, enum tree_code code, struct c_expr arg)
       result.value = build_unary_op (loc, code, arg.value, false);
 
       if (TREE_OVERFLOW_P (result.value) && !TREE_OVERFLOW_P (arg.value))
-	overflow_warning (loc, result.value);
+	overflow_warning (loc, result.value, arg.value);
     }
 
   /* We are typically called when parsing a prefix token at LOC acting on
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index b9807cf..206680f 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -4815,14 +4815,14 @@  build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3,
 	     but the warnings (like Wsign-conversion) have already been
 	     given by the scalar build_conditional_expr_1. We still check
 	     unsafe_conversion_p to forbid truncating long long -> float.  */
-	  if (unsafe_conversion_p (loc, stype, arg2, false))
+	  if (unsafe_conversion_p (loc, stype, arg2, NULL_TREE, false))
 	    {
 	      if (complain & tf_error)
 		error_at (loc, "conversion of scalar %qT to vector %qT "
 			       "involves truncation", arg2_type, vtype);
 	      return error_mark_node;
 	    }
-	  if (unsafe_conversion_p (loc, stype, arg3, false))
+	  if (unsafe_conversion_p (loc, stype, arg3, NULL_TREE, false))
 	    {
 	      if (complain & tf_error)
 		error_at (loc, "conversion of scalar %qT to vector %qT "
diff --git a/gcc/testsuite/c-c++-common/Wfloat-conversion.c b/gcc/testsuite/c-c++-common/Wfloat-conversion.c
index e872755..e9899bc 100644
--- a/gcc/testsuite/c-c++-common/Wfloat-conversion.c
+++ b/gcc/testsuite/c-c++-common/Wfloat-conversion.c
@@ -29,30 +29,30 @@  void h (void)
   double d = 0;
   long double ld = 0;
 
-  ffloat (3.1); /* { dg-warning "conversion to 'float' alters 'double' constant value" } */
-  vfloat = 3.1; /* { dg-warning "conversion to 'float' alters 'double' constant value" } */
-  ffloat (3.1L); /* { dg-warning "conversion to 'float' alters 'long double' constant value" } */
-  vfloat = 3.1L;  /* { dg-warning "conversion to 'float' alters 'long double' constant value" } */
-  fdouble (3.1L); /* { dg-warning "conversion to 'double' alters 'long double' constant value" "" { target large_long_double } } */
-  vdouble = 3.1L; /* { dg-warning "conversion to 'double' alters 'long double' constant value" "" { target large_long_double } } */
-  ffloat (vdouble); /* { dg-warning "conversion to 'float' from 'double' may alter its value" } */
-  vfloat = vdouble; /* { dg-warning "conversion to 'float' from 'double' may alter its value" } */
-  ffloat (vlongdouble); /* { dg-warning "conversion to 'float' from 'long double' may alter its value" } */
-  vfloat = vlongdouble; /* { dg-warning "conversion to 'float' from 'long double' may alter its value" } */
-  fdouble (vlongdouble); /* { dg-warning "conversion to 'double' from 'long double' may alter its value" "" { target large_long_double } } */
-  vdouble = vlongdouble; /* { dg-warning "conversion to 'double' from 'long double' may alter its value" "" { target large_long_double } } */
+  ffloat (3.1); /* { dg-warning "conversion from .double. to .float. changes value" } */
+  vfloat = 3.1; /* { dg-warning "conversion from .double. to .float. changes value" } */
+  ffloat (3.1L); /* { dg-warning "conversion from .long double. to .float. changes value" } */
+  vfloat = 3.1L;  /* { dg-warning "conversion from .long double. to .float. changes value" } */
+  fdouble (3.1L); /* { dg-warning "conversion from .long double. to .double. changes value" "" { target large_long_double } } */
+  vdouble = 3.1L; /* { dg-warning "conversion from .long double. to .double. changes value" "" { target large_long_double } } */
+  ffloat (vdouble); /* { dg-warning "conversion from .double. to .float. may change value" } */
+  vfloat = vdouble; /* { dg-warning "conversion from .double. to .float. may change value" } */
+  ffloat (vlongdouble); /* { dg-warning "conversion from .long double. to .float. may change value" } */
+  vfloat = vlongdouble; /* { dg-warning "conversion from .long double. to .float. may change value" } */
+  fdouble (vlongdouble); /* { dg-warning "conversion from .long double. to .double. may change value" } */
+  vdouble = vlongdouble; /* { dg-warning "conversion from .long double. to .double. may change value" } */
 
-  fsi (3.1f); /* { dg-warning "conversion to 'int' alters 'float' constant value" } */
-  si = 3.1f; /* { dg-warning "conversion to 'int' alters 'float' constant value" } */
-  fsi (3.1);  /* { dg-warning "conversion to 'int' alters 'double' constant value" } */
-  si = 3.1;  /* { dg-warning "conversion to 'int' alters 'double' constant value" } */
-  fsi (d);    /* { dg-warning "conversion to 'int' from 'double' may alter its value" } */
-  si = d;    /* { dg-warning "conversion to 'int' from 'double' may alter its value" } */
-  ffloat (INT_MAX);  /* { dg-warning "conversion to 'float' alters 'int' constant value" } */
-  vfloat = INT_MAX;  /* { dg-warning "conversion to 'float' alters 'int' constant value" } */
-  ffloat (16777217); /* { dg-warning "conversion to 'float' alters 'int' constant value" } */
-  vfloat = 16777217; /* { dg-warning "conversion to 'float' alters 'int' constant value" } */
+  fsi (3.1f); /* { dg-warning "conversion from .float. to .int. changes value" } */
+  si = 3.1f; /* { dg-warning "conversion from .float. to .int. changes value" } */
+  fsi (3.1);  /* { dg-warning "conversion from .double. to .int. changes value" } */
+  si = 3.1;  /* { dg-warning "conversion from .double. to .int. changes value" } */
+  fsi (d);    /* { dg-warning "conversion from .double. to .int. may change value" } */
+  si = d;    /* { dg-warning "conversion from .double. to .int. may change value" } */
+  ffloat (INT_MAX);  /* { dg-warning "conversion from .int. to .float. changes value" } */
+  vfloat = INT_MAX;  /* { dg-warning "conversion from .int. to .float. changes value" } */
+  ffloat (16777217); /* { dg-warning "conversion from .int. to .float. changes value from .16777217." } */
+  vfloat = 16777217; /* { dg-warning "conversion from .int. to .float. changes value from .16777217." } */
 
-  sc = bar != 0 ? 2.1 : 10; /* { dg-warning "conversion to 'signed char' alters 'double' constant value" } */
-  uc = bar != 0 ? 2.1 : 10; /* { dg-warning "conversion to 'unsigned char' alters 'double' constant value" } */
+  sc = bar != 0 ? 2.1 : 10; /* { dg-warning "conversion from .double. to .signed char. changes the value of .2\.1" } */
+  uc = bar != 0 ? 2.1 : 10; /* { dg-warning "conversion from .double. to .unsigned char. changes the value of .2\.1" } */
 }
diff --git a/gcc/testsuite/c-c++-common/dfp/convert-int-saturate.c b/gcc/testsuite/c-c++-common/dfp/convert-int-saturate.c
index c92502d..2d01f99 100644
--- a/gcc/testsuite/c-c++-common/dfp/convert-int-saturate.c
+++ b/gcc/testsuite/c-c++-common/dfp/convert-int-saturate.c
@@ -23,40 +23,40 @@  main ()
 {
 
   /* Unsigned.  */
-  usi = DEC32_MAX;  /* { dg-warning "overflow in implicit constant conversion" } */
+  usi = DEC32_MAX;  /* { dg-warning "overflow in conversion" } */
   if (usi != UINT_MAX)
     FAILURE
 
-  usi = DEC64_MAX;  /* { dg-warning "overflow in implicit constant conversion" } */
+  usi = DEC64_MAX;  /* { dg-warning "overflow in conversion" } */
   if (usi != UINT_MAX)
     FAILURE
 
-  usi = DEC128_MAX; /* { dg-warning "overflow in implicit constant conversion" } */
+  usi = DEC128_MAX; /* { dg-warning "overflow in conversion" } */
   if (usi != UINT_MAX)
     FAILURE
 
   /* Signed.  */
-  si = DEC32_MAX;	/* { dg-warning "overflow in implicit constant conversion" } */
+  si = DEC32_MAX;	/* { dg-warning "overflow in conversion" } */
   if (si != INT_MAX)
     FAILURE
 
-  si = DEC64_MAX;   /* { dg-warning "overflow in implicit constant conversion" } */
+  si = DEC64_MAX;   /* { dg-warning "overflow in conversion" } */
   if (si != INT_MAX)
     FAILURE
 
-  si = DEC128_MAX;  /* { dg-warning "overflow in implicit constant conversion" } */
+  si = DEC128_MAX;  /* { dg-warning "overflow in conversion" } */
   if (si != INT_MAX)
     FAILURE
 
-  si = - DEC32_MAX; /* { dg-warning "overflow in implicit constant conversion" } */
+  si = - DEC32_MAX; /* { dg-warning "overflow in conversion" } */
   if (si != INT_MIN)
     FAILURE
 
-  si = - DEC64_MAX; /* { dg-warning "overflow in implicit constant conversion" } */
+  si = - DEC64_MAX; /* { dg-warning "overflow in conversion" } */
   if (si != INT_MIN)
     FAILURE
 
-  si = - DEC128_MAX; /* { dg-warning "overflow in implicit constant conversion" } */
+  si = - DEC128_MAX; /* { dg-warning "overflow in conversion" } */
   if (si != INT_MIN)
     FAILURE
 
diff --git a/gcc/testsuite/c-c++-common/pr68657-1.c b/gcc/testsuite/c-c++-common/pr68657-1.c
index 84f3e54..33fdf86 100644
--- a/gcc/testsuite/c-c++-common/pr68657-1.c
+++ b/gcc/testsuite/c-c++-common/pr68657-1.c
@@ -5,14 +5,14 @@ 
 void
 f1 (void)
 {
-  unsigned int a = -5;	/* { dg-error "negative integer implicitly converted to unsigned type" } */
+  unsigned int a = -5;	/* { dg-error "unsigned conversion from .int. to .unsigned int. changes value from .-5. to .4294967291." } */
   (void) a;
 }
 
 int
 f2 (void)
 {
-  return 3.1f;	/* { dg-error "conversion to 'int' alters 'float' constant value" } */
+  return 3.1f;	/* { dg-error "conversion from .float. to .int. changes value" } */
 }
 
 int f3 (char *);
diff --git a/gcc/testsuite/g++.dg/ext/utf-cvt.C b/gcc/testsuite/g++.dg/ext/utf-cvt.C
index 366c3d4..929b7c7 100644
--- a/gcc/testsuite/g++.dg/ext/utf-cvt.C
+++ b/gcc/testsuite/g++.dg/ext/utf-cvt.C
@@ -21,9 +21,9 @@  extern void full (unsigned long long);
 
 void m(char16_t c0, char32_t c1)
 {
-    f_c (c0);	/* { dg-warning "alter its value" } */
-    fsc (c0);	/* { dg-warning "alter its value" } */
-    fuc (c0);	/* { dg-warning "alter its value" } */
+    f_c (c0);	/* { dg-warning "conversion from .char16_t. to .char. may change value" } */
+    fsc (c0);	/* { dg-warning "change value" } */
+    fuc (c0);	/* { dg-warning "change value" } */
     f_s (c0);	/* { dg-warning "change the sign" } */
     fss (c0);	/* { dg-warning "change the sign" } */
     fus (c0);
@@ -37,12 +37,12 @@  void m(char16_t c0, char32_t c1)
     fsll (c0);
     full (c0);
 
-    f_c (c1);	/* { dg-warning "alter its value" } */
-    fsc (c1);	/* { dg-warning "alter its value" } */
-    fuc (c1);	/* { dg-warning "alter its value" } */
-    f_s (c1);	/* { dg-warning "alter its value" } */
-    fss (c1);	/* { dg-warning "alter its value" } */
-    fus (c1);	/* { dg-warning "alter its value" } */
+    f_c (c1);	/* { dg-warning "change value" } */
+    fsc (c1);	/* { dg-warning "change value" } */
+    fuc (c1);	/* { dg-warning "change value" } */
+    f_s (c1);	/* { dg-warning "change value" } */
+    fss (c1);	/* { dg-warning "change value" } */
+    fus (c1);	/* { dg-warning "change value" } */
     f_i (c1);	/* { dg-warning "change the sign" } */
     fsi (c1);	/* { dg-warning "change the sign" } */
     fui (c1);
diff --git a/gcc/testsuite/g++.dg/ext/utf16-4.C b/gcc/testsuite/g++.dg/ext/utf16-4.C
index e8d6531..2c4377c 100644
--- a/gcc/testsuite/g++.dg/ext/utf16-4.C
+++ b/gcc/testsuite/g++.dg/ext/utf16-4.C
@@ -10,9 +10,9 @@  const static char16_t	c2 = u'\U00064321';	/* { dg-warning "constant too long" }
 const static char16_t	c3 = 'a';
 const static char16_t	c4 = U'a';
 const static char16_t	c5 = U'\u2029';
-const static char16_t	c6 = U'\U00064321';	/* { dg-warning "implicitly truncated" } */
+const static char16_t	c6 = U'\U00064321';	/* { dg-warning "conversion from .char32_t. to .char16_t. changes value from .410401. to .17185." } */
 const static char16_t	c7 = L'a';
 const static char16_t	c8 = L'\u2029';
-const static char16_t	c9 = L'\U00064321';	/* { dg-warning "implicitly truncated" "" { target { 4byte_wchar_t } } } */
+const static char16_t	c9 = L'\U00064321';	/* { dg-warning "unsigned conversion from .wchar_t. to .char16_t. changes value from .410401. to .17185." "" { target { 4byte_wchar_t } } } */
 						/* { dg-warning "constant too long" "" { target { ! 4byte_wchar_t } } .-1 } */
 int main () {}
diff --git a/gcc/testsuite/g++.dg/warn/Wconversion-real-integer-3.C b/gcc/testsuite/g++.dg/warn/Wconversion-real-integer-3.C
index 775c88c..8b7574d 100644
--- a/gcc/testsuite/g++.dg/warn/Wconversion-real-integer-3.C
+++ b/gcc/testsuite/g++.dg/warn/Wconversion-real-integer-3.C
@@ -16,5 +16,5 @@  void h (void)
     // the locus that inside the source code here, at the relevant
     // line below, even with -ftrack-macro-expansion.  We don't want
     // it to point to the any locus that is inside the system header.
-    vfloat = INT_MAX; // { dg-warning "conversion to .float. alters .int. constant value" }
+    vfloat = INT_MAX; // { dg-warning "conversion from .int. to .float. changes value from .2147483647. to " }
 }
diff --git a/gcc/testsuite/g++.dg/warn/Wconversion-real-integer2.C b/gcc/testsuite/g++.dg/warn/Wconversion-real-integer2.C
index 7e39d5f..7386525 100644
--- a/gcc/testsuite/g++.dg/warn/Wconversion-real-integer2.C
+++ b/gcc/testsuite/g++.dg/warn/Wconversion-real-integer2.C
@@ -23,7 +23,7 @@ 
 //
 // That is more useful.
 
-#define INT_MAX __INT_MAX__ // { dg-warning "17: conversion to .float. alters .int. constant value" }
+#define INT_MAX __INT_MAX__ // { dg-warning "17: conversion from 'int' to 'float' changes value from .2147483647. to " }
 
 float  vfloat;
 
diff --git a/gcc/testsuite/g++.dg/warn/Wconversion3.C b/gcc/testsuite/g++.dg/warn/Wconversion3.C
index 24202b7..71604f9 100644
--- a/gcc/testsuite/g++.dg/warn/Wconversion3.C
+++ b/gcc/testsuite/g++.dg/warn/Wconversion3.C
@@ -19,9 +19,9 @@  void test1 (void)
   unsigned char f = (int) uc;
   signed char g = (int) sc;
   unsigned char h = (unsigned int) (short int) uc;
-  signed char i = (int) (unsigned short int) sc;	// { dg-warning "may alter its value" }
-  unsigned char j = (unsigned int) (short int) us;	// { dg-warning "may alter its value" }
-  signed char k = (int) (unsigned short int) ss;	// { dg-warning "may alter its value" }
+  signed char i = (int) (unsigned short int) sc;	// { dg-warning "may change value" }
+  unsigned char j = (unsigned int) (short int) us;	// { dg-warning "may change value" }
+  signed char k = (int) (unsigned short int) ss;	// { dg-warning "may change value" }
 }
 
 void test2 (void)
diff --git a/gcc/testsuite/g++.dg/warn/Wconversion4.C b/gcc/testsuite/g++.dg/warn/Wconversion4.C
index 83daaa0..d1e0f4a 100644
--- a/gcc/testsuite/g++.dg/warn/Wconversion4.C
+++ b/gcc/testsuite/g++.dg/warn/Wconversion4.C
@@ -7,7 +7,7 @@  class Test
 {
   void eval()
   {
-    foo(bar());  // { dg-warning "may alter its value" }
+    foo(bar());  // { dg-warning "may change value" }
   }
 
   unsigned int bar() const
diff --git a/gcc/testsuite/g++.dg/warn/Wsign-conversion.C b/gcc/testsuite/g++.dg/warn/Wsign-conversion.C
index f6a0ccc..3fa7122 100644
--- a/gcc/testsuite/g++.dg/warn/Wsign-conversion.C
+++ b/gcc/testsuite/g++.dg/warn/Wsign-conversion.C
@@ -40,26 +40,26 @@  void h (int x)
   fuc ('A');
   uc = 'A';
 
-  uc = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  uc = x ? SCHAR_MIN : 1U;  /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  uc = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  uc = x ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = x ? INT_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = ui ? SCHAR_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = 1U * -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = ui + INT_MIN; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = ui ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+  uc = x ? 1U : -1; /* { dg-warning "unsigned conversion" } */
+  uc = x ? SCHAR_MIN : 1U;  /* { dg-warning "unsigned conversion" } */
+  uc = x ? 1 : -1; /* { dg-warning "unsigned conversion" } */
+  uc = x ? SCHAR_MIN : 1; /* { dg-warning "unsigned conversion" } */
+  ui = x ? 1U : -1; /* { dg-warning "unsigned conversion" } */
+  ui = x ? INT_MIN : 1U; /* { dg-warning "unsigned conversion" } */
+  ui = ui ? SCHAR_MIN : 1U; /* { dg-warning "unsigned conversion" } */
+  ui = 1U * -1; /* { dg-warning "unsigned conversion" } */
+  ui = ui + INT_MIN; /* { dg-warning "unsigned conversion" } */
+  ui = x ? 1 : -1; /* { dg-warning "unsigned conversion" } */
+  ui = ui ? SCHAR_MIN : 1; /* { dg-warning "unsigned conversion" } */
 
-  fuc (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  uc = -1;  /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  fui (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  fuc ('\xa0'); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  uc = '\xa0'; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  fui ('\xa0');/* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = '\xa0'; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+  fuc (-1); /* { dg-warning "unsigned conversion" } */
+  uc = -1;  /* { dg-warning "unsigned conversion" } */
+  fui (-1); /* { dg-warning "unsigned conversion" } */
+  ui = -1; /* { dg-warning "unsigned conversion" } */
+  fuc ('\xa0'); /* { dg-warning "unsigned conversion" } */
+  uc = '\xa0'; /* { dg-warning "unsigned conversion" } */
+  fui ('\xa0');/* { dg-warning "unsigned conversion" } */
+  ui = '\xa0'; /* { dg-warning "unsigned conversion" } */
   fsi (0x80000000); /* { dg-warning "conversion" } */
   si = 0x80000000;  /* { dg-warning "conversion" } */
 
@@ -91,5 +91,5 @@  void h (int x)
   ui = sc;  /* { dg-warning "conversion" } */
 }
 
-unsigned fui (unsigned a) { return a + -1; } /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+unsigned fui (unsigned a) { return a + -1; } /* { dg-warning "unsigned conversion" } */
 
diff --git a/gcc/testsuite/g++.dg/warn/overflow-warn-1.C b/gcc/testsuite/g++.dg/warn/overflow-warn-1.C
index 314e351..9177373 100644
--- a/gcc/testsuite/g++.dg/warn/overflow-warn-1.C
+++ b/gcc/testsuite/g++.dg/warn/overflow-warn-1.C
@@ -102,14 +102,14 @@  void
 h2 (void)
 {
   fsc (SCHAR_MAX + 1);
-  fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in implicit constant conversion" } */
+  fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value" } */
   fsc (UCHAR_MAX);
-  fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
+  fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value" } */
   fuc (-1);
-  fuc (UCHAR_MAX + 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+  fuc (UCHAR_MAX + 1); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value" } */
   fuc (SCHAR_MIN);
-  fuc (SCHAR_MIN - 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
-  fuc (-UCHAR_MAX); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+  fuc (SCHAR_MIN - 1); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value" } */
+  fuc (-UCHAR_MAX); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value" } */
 }
 
 void fui (unsigned int);
diff --git a/gcc/testsuite/g++.dg/warn/overflow-warn-3.C b/gcc/testsuite/g++.dg/warn/overflow-warn-3.C
index b319660..91afd01 100644
--- a/gcc/testsuite/g++.dg/warn/overflow-warn-3.C
+++ b/gcc/testsuite/g++.dg/warn/overflow-warn-3.C
@@ -100,15 +100,15 @@  void fsc (signed char);
 void
 h2 (void)
 {
-  fsc (SCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
-  fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in implicit constant conversion" } */
-  fsc (UCHAR_MAX); /* { dg-warning "overflow in implicit constant conversion" } */
-  fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
+  fsc (SCHAR_MAX + 1); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value" } */
+  fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value" } */
+  fsc (UCHAR_MAX); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value" } */
+  fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value" } */
   fuc (-1);
-  fuc (UCHAR_MAX + 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+  fuc (UCHAR_MAX + 1); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value" } */
   fuc (SCHAR_MIN);
-  fuc (SCHAR_MIN - 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
-  fuc (-UCHAR_MAX); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+  fuc (SCHAR_MIN - 1); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value" } */
+  fuc (-UCHAR_MAX); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value" } */
 }
 
 void fui (unsigned int);
diff --git a/gcc/testsuite/g++.dg/warn/overflow-warn-4.C b/gcc/testsuite/g++.dg/warn/overflow-warn-4.C
index dfe8741..3f0bf1f 100644
--- a/gcc/testsuite/g++.dg/warn/overflow-warn-4.C
+++ b/gcc/testsuite/g++.dg/warn/overflow-warn-4.C
@@ -103,15 +103,15 @@  void fsc (signed char);
 void
 h2 (void)
 {
-  fsc (SCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
-  fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in implicit constant conversion" } */
-  fsc (UCHAR_MAX); /* { dg-warning "overflow in implicit constant conversion" } */
-  fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
+  fsc (SCHAR_MAX + 1); /* { dg-warning "overflow in conversion" } */
+  fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in conversion" } */
+  fsc (UCHAR_MAX); /* { dg-warning "overflow in conversion" } */
+  fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in conversion" } */
   fuc (-1);
-  fuc (UCHAR_MAX + 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+  fuc (UCHAR_MAX + 1); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value" } */
   fuc (SCHAR_MIN);
-  fuc (SCHAR_MIN - 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
-  fuc (-UCHAR_MAX); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+  fuc (SCHAR_MIN - 1); /* { dg-warning "unsigned conversion" } */
+  fuc (-UCHAR_MAX); /* { dg-warning "unsigned conversion" } */
 }
 
 void fui (unsigned int);
diff --git a/gcc/testsuite/g++.dg/warn/pr35635.C b/gcc/testsuite/g++.dg/warn/pr35635.C
index 19345c5..628c050 100644
--- a/gcc/testsuite/g++.dg/warn/pr35635.C
+++ b/gcc/testsuite/g++.dg/warn/pr35635.C
@@ -63,7 +63,7 @@  void func3()
      warn.  */
   uchar_x = bar != 0 ? 2.1 : 10; /* { dg-warning "conversion" } */
   uchar_x = bar != 0
-    ? (unsigned char) 1024 /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+    ? (unsigned char) 1024 /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes the value of .-1." } */
     : -1;
 }
 
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/enum1.C b/gcc/testsuite/g++.old-deja/g++.mike/enum1.C
index 35b1df0..2f7a6dd 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/enum1.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/enum1.C
@@ -8,4 +8,4 @@  struct Type {
   void setBTK();
 };
 
-void Type::setBTK() { kind = DTK; } // { dg-warning "truncate" }
+void Type::setBTK() { kind = DTK; } // { dg-warning "conversion from '\[^\n\r]+' to .unsigned char:1. changes value from" }
diff --git a/gcc/testsuite/gcc.dg/Wconversion-3.c b/gcc/testsuite/gcc.dg/Wconversion-3.c
index d45749d..d102d16 100644
--- a/gcc/testsuite/gcc.dg/Wconversion-3.c
+++ b/gcc/testsuite/gcc.dg/Wconversion-3.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
 /* { dg-options "-O2 -Wconversion" } */
 
-unsigned f(unsigned a) { return a + -1; }  /* { dg-warning "negative" } */
+unsigned f(unsigned a) { return a + -1; }  /* { dg-warning "conversion" } */
 
diff --git a/gcc/testsuite/gcc.dg/Wconversion-5.c b/gcc/testsuite/gcc.dg/Wconversion-5.c
index be749a9..e54fe1a 100644
--- a/gcc/testsuite/gcc.dg/Wconversion-5.c
+++ b/gcc/testsuite/gcc.dg/Wconversion-5.c
@@ -19,9 +19,9 @@  void test1 (void)
   unsigned char f = (int) uc;
   signed char g = (int) sc;
   unsigned char h = (unsigned int) (short int) uc;
-  signed char i = (int) (unsigned short int) sc;	/* { dg-warning "may alter its value" "" { target { int32plus } } } */
-  unsigned char j = (unsigned int) (short int) us;	/* { dg-warning "may alter its value" } */
-  signed char k = (int) (unsigned short int) ss;	/* { dg-warning "may alter its value" } */
+  signed char i = (int) (unsigned short int) sc;	/* { dg-warning "conversion from .int. to .signed char. may change value" "" { target { int32plus } } } */
+  unsigned char j = (unsigned int) (short int) us;	/* { dg-warning "may change value" } */
+  signed char k = (int) (unsigned short int) ss;	/* { dg-warning "may change value" } */
 }
 
 void test2 (void)
diff --git a/gcc/testsuite/gcc.dg/Wconversion-complex-c99.c b/gcc/testsuite/gcc.dg/Wconversion-complex-c99.c
index 0e6c390..bc7439d 100644
--- a/gcc/testsuite/gcc.dg/Wconversion-complex-c99.c
+++ b/gcc/testsuite/gcc.dg/Wconversion-complex-c99.c
@@ -63,10 +63,10 @@  var_complex_narrowing (void)
   double _Complex doublec = 0.;
 
   vdoublec = floatc;
-  vfloatc = doublec; /* { dg-warning "float-conversion" } */
+  vfloatc = doublec; /* { dg-warning "conversion from .complex double. to .complex float. may change value" } */
 
   fdoublec (floatc);
-  ffloatc (doublec); /* { dg-warning "float-conversion" } */
+  ffloatc (doublec); /* { dg-warning "conversion from .complex double. to .complex float. may change value" } */
 }
 
 /* Check implicit conversions of complex values to integers.  */
diff --git a/gcc/testsuite/gcc.dg/Wconversion-complex-gnu.c b/gcc/testsuite/gcc.dg/Wconversion-complex-gnu.c
index 3839a39..80990cb 100644
--- a/gcc/testsuite/gcc.dg/Wconversion-complex-gnu.c
+++ b/gcc/testsuite/gcc.dg/Wconversion-complex-gnu.c
@@ -32,11 +32,11 @@  var_float_to_int (void)
 {
   double _Complex doublec = 0.;
 
-  fsic (doublec); /* { dg-warning "float-conversion" } */
-  fuic (doublec); /* { dg-warning "float-conversion" } */
+  fsic (doublec); /* { dg-warning "conversion" } */
+  fuic (doublec); /* { dg-warning "conversion" } */
 
-  vsic = doublec; /* { dg-warning "float-conversion" } */
-  vuic = doublec; /* { dg-warning "float-conversion" } */
+  vsic = doublec; /* { dg-warning "conversion" } */
+  vuic = doublec; /* { dg-warning "conversion" } */
 }
 
 /* Check implicit conversions of integer complex-domain values to integer
@@ -75,9 +75,9 @@  const_float_to_int (void)
   vsic = 1. - 1.i;
   vuic = 1. + 1.i;
 
-  fsic (0.5 + 0.i); /* { dg-warning "float-conversion" } */
-  vsic = 0.5 + 0.i; /* { dg-warning "float-conversion" } */
-  fuic (0.5 + 0.i); /* { dg-warning "float-conversion" } */
+  fsic (0.5 + 0.i); /* { dg-warning "conversion" } */
+  vsic = 0.5 + 0.i; /* { dg-warning "conversion" } */
+  fuic (0.5 + 0.i); /* { dg-warning "conversion" } */
 }
 
 /* Check implicit conversions of integer complex-domain constants to integer
@@ -96,8 +96,8 @@  const_complex_int_to_real_int (void)
   fui (UINT_MAX + 1ull + 0i); /* { dg-warning "conversion" } */
   vui = UINT_MAX + 1ull + 0i; /* { dg-warning "conversion" } */
 
-  ffloat (UINT_MAX + 0i); /* { dg-warning "float-conversion" } */
-  vfloat = UINT_MAX + 0i; /* { dg-warning "float-conversion" } */
+  ffloat (UINT_MAX + 0i); /* { dg-warning "conversion" } */
+  vfloat = UINT_MAX + 0i; /* { dg-warning "conversion" } */
 }
 
 void
@@ -116,12 +116,12 @@  const_complex_int_narrowing (void)
   vuic = (UINT_MAX + 1ull) + 1i; /* { dg-warning "conversion" } */
   vuic = (UINT_MAX + 1ull) + (UINT_MAX + 1ull) * 1i; /* { dg-warning "conversion" } */
 
-  ffloatc (UINT_MAX * 1i); /* { dg-warning "float-conversion" } */
-  ffloatc (UINT_MAX + 1i); /* { dg-warning "float-conversion" } */
-  ffloatc (UINT_MAX + UINT_MAX * 1i); /* { dg-warning "float-conversion" } */
+  ffloatc (UINT_MAX * 1i); /* { dg-warning "conversion" } */
+  ffloatc (UINT_MAX + 1i); /* { dg-warning "conversion" } */
+  ffloatc (UINT_MAX + UINT_MAX * 1i); /* { dg-warning "conversion" } */
 
-  vfloatc = UINT_MAX * 1i; /* { dg-warning "float-conversion" } */
-  vfloatc = UINT_MAX + 1i; /* { dg-warning "float-conversion" } */
-  vfloatc = UINT_MAX + UINT_MAX * 1i; /* { dg-warning "float-conversion" } */
+  vfloatc = UINT_MAX * 1i; /* { dg-warning "conversion" } */
+  vfloatc = UINT_MAX + 1i; /* { dg-warning "conversion" } */
+  vfloatc = UINT_MAX + UINT_MAX * 1i; /* { dg-warning "conversion" } */
 }
 
diff --git a/gcc/testsuite/gcc.dg/Wconversion-integer.c b/gcc/testsuite/gcc.dg/Wconversion-integer.c
index dc13e8f..cf7745c 100644
--- a/gcc/testsuite/gcc.dg/Wconversion-integer.c
+++ b/gcc/testsuite/gcc.dg/Wconversion-integer.c
@@ -40,28 +40,28 @@  void h (int x)
   fuc ('A');
   uc = 'A';
 
-  uc = x ? 1U : -1; /* { dg-warning " conversion" "conversion" } */
-  /* { dg-warning "negative integer implicitly converted to unsigned type" "implicit" { target *-*-* } .-1 } */
-  uc = x ? SCHAR_MIN : 1U; /* { dg-warning " conversion" "conversion" } */
-  /* { dg-warning "negative integer implicitly converted to unsigned type" "implicit" { target *-*-* } .-1 } */
-  uc = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  uc = x ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = x ? INT_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = ui ? SCHAR_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = 1U * -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = ui + INT_MIN; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = ui ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+  uc = x ? 1U : -1; /* { dg-warning "conversion from .unsigned int. to .unsigned char." } */
+  /* { dg-warning "unsigned conversion" "implicit" { target *-*-* } .-1 } */
+  uc = x ? SCHAR_MIN : 1U; /* { dg-warning "unsigned conversion" } */
+  /* { dg-warning "conversion from .unsigned int. to .unsigned char." "implicit" { target *-*-* } .-1 } */
+  uc = x ? 1 : -1; /* { dg-warning "signed conversion" } */
+  uc = x ? SCHAR_MIN : 1; /* { dg-warning "signed conversion" } */
+  ui = x ? 1U : -1; /* { dg-warning "signed conversion" } */
+  ui = x ? INT_MIN : 1U; /* { dg-warning "signed conversion" } */
+  ui = ui ? SCHAR_MIN : 1U; /* { dg-warning "signed conversion" } */
+  ui = 1U * -1; /* { dg-warning "signed conversion" } */
+  ui = ui + INT_MIN; /* { dg-warning "signed conversion" } */
+  ui = x ? 1 : -1; /* { dg-warning "signed conversion" } */
+  ui = ui ? SCHAR_MIN : 1; /* { dg-warning "signed conversion" } */
 
-  fuc (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  uc = -1;  /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  fui (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  fuc ('\xa0'); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  uc = '\xa0'; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  fui ('\xa0');/* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = '\xa0'; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+  fuc (-1); /* { dg-warning "signed conversion" } */
+  uc = -1;  /* { dg-warning "signed conversion" } */
+  fui (-1); /* { dg-warning "signed conversion" } */
+  ui = -1; /* { dg-warning "signed conversion" } */
+  fuc ('\xa0'); /* { dg-warning "signed conversion" } */
+  uc = '\xa0'; /* { dg-warning "signed conversion" } */
+  fui ('\xa0');/* { dg-warning "signed conversion" } */
+  ui = '\xa0'; /* { dg-warning "signed conversion" } */
   fsi (0x80000000); /* { dg-warning "conversion" } */
   si = 0x80000000;  /* { dg-warning "conversion" } */
 
@@ -93,6 +93,6 @@  void h (int x)
   ui = sc;  /* { dg-warning "conversion" } */
 }
 
-unsigned fui (unsigned a) { return a + -1; } /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+unsigned fui (unsigned a) { return a + -1; } /* { dg-warning "signed conversion" } */
 
 
diff --git a/gcc/testsuite/gcc.dg/Wsign-conversion.c b/gcc/testsuite/gcc.dg/Wsign-conversion.c
index 0300850..bda61eb 100644
--- a/gcc/testsuite/gcc.dg/Wsign-conversion.c
+++ b/gcc/testsuite/gcc.dg/Wsign-conversion.c
@@ -40,28 +40,28 @@  void h (int x)
   fuc ('A');
   uc = 'A';
 
-  uc = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  uc = x ? SCHAR_MIN : 1U;  /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  uc = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  uc = x ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = x ? INT_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = ui ? SCHAR_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = 1U * -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = ui + INT_MIN; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = ui ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+  uc = x ? 1U : -1; /* { dg-warning "unsigned conversion from .int. to .unsigned int. changes value from .-1. to .\[0-9\]+." } */
+  uc = x ? SCHAR_MIN : 1U;  /* { dg-warning "unsigned conversion from .int. to .unsigned int. changes value from .-\[0-9\]+. to .\[0-9\]+." } */
+  uc = x ? 1 : -1; /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes the value of .-1." } */
+  uc = x ? SCHAR_MIN : 1; /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes the value of .-\[0-9\]+." } */
+  ui = x ? 1U : -1; /* { dg-warning "unsigned conversion from .int. to .unsigned int. changes value from .-1. to .\[0-9\]+." } */
+  ui = x ? INT_MIN : 1U; /* { dg-warning "unsigned conversion from .int. to .unsigned int. changes value from .-\[0-9\]+. to .\[0-9\]+." } */
+  ui = ui ? SCHAR_MIN : 1U; /* { dg-warning "unsigned conversion from .int. to .unsigned int. changes value " } */
+  ui = 1U * -1; /* { dg-warning "unsigned conversion from .int. to .unsigned int. changes value " } */
+  ui = ui + INT_MIN; /* { dg-warning "unsigned conversion from .int. to .unsigned int. changes value " } */
+  ui = x ? 1 : -1; /* { dg-warning "unsigned conversion from .int. to .unsigned int. changes the value of .-1." } */
+  ui = ui ? SCHAR_MIN : 1; /* { dg-warning "unsigned conversion from .int. to .unsigned int. changes the value of " } */
 
-  fuc (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  uc = -1;  /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  fui (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  fuc ('\xa0'); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  uc = '\xa0'; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  fui ('\xa0');/* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  ui = '\xa0'; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
-  fsi (0x80000000); /* { dg-warning "conversion" } */
-  si = 0x80000000;  /* { dg-warning "conversion" } */
+  fuc (-1); /* { dg-warning "unsigned conversion" } */
+  uc = -1;  /* { dg-warning "unsigned conversion" } */
+  fui (-1); /* { dg-warning "unsigned conversion" } */
+  ui = -1; /* { dg-warning "unsigned conversion" } */
+  fuc ('\xa0'); /* { dg-warning "unsigned conversion" } */
+  uc = '\xa0'; /* { dg-warning "unsigned conversion" } */
+  fui ('\xa0');/* { dg-warning "unsigned conversion" } */
+  ui = '\xa0'; /* { dg-warning "unsigned conversion" } */
+  fsi (0x80000000); /* { dg-warning "signed conversion" } */
+  si = 0x80000000;  /* { dg-warning "signed conversion" } */
 
 
   fsi (UINT_MAX - 1);  /* { dg-warning "conversion" } */
@@ -85,12 +85,12 @@  void h (int x)
   uc = sc;  /* { dg-warning "conversion" } */
   fsi (ui); /* { dg-warning "conversion" } */
   si = ui;  /* { dg-warning "conversion" } */
-  fui (si); /* { dg-warning "conversion" } */ 
-  ui = si;  /* { dg-warning "conversion" } */ 
+  fui (si); /* { dg-warning "conversion" } */
+  ui = si;  /* { dg-warning "conversion" } */
   fui (sc); /* { dg-warning "conversion" } */
   ui = sc;  /* { dg-warning "conversion" } */
 }
 
-unsigned fui (unsigned a) { return a + -1; } /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+unsigned fui (unsigned a) { return a + -1; } /* { dg-warning "unsigned conversion from .int. to .unsigned int. changes value" } */
 
 
diff --git a/gcc/testsuite/gcc.dg/bitfld-2.c b/gcc/testsuite/gcc.dg/bitfld-2.c
index e3f5f1b..92cf2f6 100644
--- a/gcc/testsuite/gcc.dg/bitfld-2.c
+++ b/gcc/testsuite/gcc.dg/bitfld-2.c
@@ -11,13 +11,13 @@  struct bf
   int b: 2;
 };
 
-struct bf p = {4, 0};		/* { dg-warning "truncated" } */
-struct bf q = {0, 2};		/* { dg-warning "overflow" } */
-struct bf r = {3, -2};		/* { dg-bogus "(truncated|overflow)" } */
+struct bf p = {4, 0};		/* { dg-warning "unsigned conversion from .int. to 'unsigned char:2' changes value from .4. to .0." } */
+struct bf q = {0, 2};		/* { dg-warning "overflow in conversion from .int. to .signed char:2. changes value from .2. to .-2." } */
+struct bf r = {3, -2};		/* { dg-bogus "(trunc|overflow)" } */
 
 void foo ()
 {
-  p.a = 4, p.b = 0;		/* { dg-warning "truncated" } */
-  q.a = 0, q.b = 2;		/* { dg-warning "overflow" } */
-  r.a = 3, r.b = -2;		/* { dg-bogus "(truncated|overflow)" } */
+  p.a = 4, p.b = 0;		/* { dg-warning "unsigned conversion from .int. to .unsigned char:2. changes value from .4. to .0." } */
+  q.a = 0, q.b = 2;		/* { dg-warning "overflow in conversion from .int. to .signed char:2. changes value from .2. to .-2." } */
+  r.a = 3, r.b = -2;		/* { dg-bogus "(trunc|overflow)" } */
 }
diff --git a/gcc/testsuite/gcc.dg/c90-const-expr-11.c b/gcc/testsuite/gcc.dg/c90-const-expr-11.c
index 5cd704a..e4f2aff 100644
--- a/gcc/testsuite/gcc.dg/c90-const-expr-11.c
+++ b/gcc/testsuite/gcc.dg/c90-const-expr-11.c
@@ -20,7 +20,7 @@  f (void)
   /* Overflow.  */
   struct t b = { INT_MAX + 1 }; /* { dg-warning "integer overflow in expression" } */
   /* { dg-error "overflow in constant expression" "constant" { target *-*-* } .-1 } */
-  struct t c = { DBL_MAX }; /* { dg-warning "overflow in implicit constant conversion" } */
+  struct t c = { DBL_MAX }; /* { dg-warning "overflow in conversion from .double. to .int. chages value " } */
   /* { dg-error "overflow in constant expression" "constant" { target *-*-* } .-1 } */
   /* Bad operator outside sizeof.  */
   struct s d = { 1 ? 1.0 : atan (a.d) }; /* { dg-error "is not a constant expression|near initialization" } */
diff --git a/gcc/testsuite/gcc.dg/c90-const-expr-7.c b/gcc/testsuite/gcc.dg/c90-const-expr-7.c
index 56a1478..f423b00 100644
--- a/gcc/testsuite/gcc.dg/c90-const-expr-7.c
+++ b/gcc/testsuite/gcc.dg/c90-const-expr-7.c
@@ -6,10 +6,10 @@ 
 
 #include <float.h>
 
-int a = DBL_MAX; /* { dg-warning "overflow in implicit constant conversion" } */
+int a = DBL_MAX; /* { dg-warning "overflow in conversion" } */
 /* { dg-error "overflow in constant expression" "constant" { target *-*-* } .-1 } */
 int b = (int) DBL_MAX; /* { dg-error "overflow" } */
-unsigned int c = -1.0; /* { dg-warning "overflow in implicit constant conversion" } */
+unsigned int c = -1.0; /* { dg-warning "overflow in conversion" } */
 /* { dg-error "overflow in constant expression" "constant" { target *-*-* } .-1 } */
 unsigned int d = (unsigned)-1.0; /* { dg-error "overflow" } */
 
@@ -31,5 +31,5 @@  int h1 = (0 ? 0 >> -1: 0);
 
 int i = -1 << 0;
 
-int j[1] = { DBL_MAX }; /* { dg-warning "overflow in implicit constant conversion" } */
+int j[1] = { DBL_MAX }; /* { dg-warning "overflow in conversion" } */
 /* { dg-error "overflow in constant expression" "constant" { target *-*-* } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-7.c b/gcc/testsuite/gcc.dg/c99-const-expr-7.c
index c663723..bf23a4a 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-7.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-7.c
@@ -7,10 +7,10 @@ 
 #include <float.h>
 #include <limits.h>
 
-int a = DBL_MAX; /* { dg-warning "overflow in implicit constant conversion" } */
+int a = DBL_MAX; /* { dg-warning "overflow in conversion" } */
 /* { dg-error "overflow in constant expression" "constant" { target *-*-* } .-1 } */
 int b = (int) DBL_MAX; /* { dg-error "overflow" } */
-unsigned int c = -1.0; /* { dg-warning "overflow in implicit constant conversion" } */
+unsigned int c = -1.0; /* { dg-warning "overflow in conversion" } */
 /* { dg-error "overflow in constant expression" "constant" { target *-*-* } .-1 } */
 unsigned int d = (unsigned)-1.0; /* { dg-error "overflow" } */
 
@@ -33,7 +33,7 @@  int h1 = (0 ? 0 >> -1: 0);
 int i = -1 << 0;
 /* { dg-error "constant" "constant" { target *-*-* } .-1 } */
 
-int j[1] = { DBL_MAX }; /* { dg-warning "overflow in implicit constant conversion" } */
+int j[1] = { DBL_MAX }; /* { dg-warning "overflow in conversion" } */
 /* { dg-error "overflow in constant expression" "constant" { target *-*-* } .-1 } */
 
 int array[2] = { [0 * (INT_MAX + 1)] = 0 }; /* { dg-warning "integer overflow in expression" } */
diff --git a/gcc/testsuite/gcc.dg/overflow-warn-1.c b/gcc/testsuite/gcc.dg/overflow-warn-1.c
index 48185e9..8eb3225 100644
--- a/gcc/testsuite/gcc.dg/overflow-warn-1.c
+++ b/gcc/testsuite/gcc.dg/overflow-warn-1.c
@@ -85,14 +85,14 @@  void
 h2 (void)
 {
   fsc (SCHAR_MAX + 1);
-  fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in implicit constant conversion" } */
+  fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value " } */
   fsc (UCHAR_MAX);
-  fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
+  fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value from " } */
   fuc (-1);
-  fuc (UCHAR_MAX + 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+  fuc (UCHAR_MAX + 1); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value " } */
   fuc (SCHAR_MIN);
-  fuc (SCHAR_MIN - 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
-  fuc (-UCHAR_MAX); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+  fuc (SCHAR_MIN - 1); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value " } */
+  fuc (-UCHAR_MAX); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value " } */
 }
 
 void fui (unsigned int);
diff --git a/gcc/testsuite/gcc.dg/overflow-warn-2.c b/gcc/testsuite/gcc.dg/overflow-warn-2.c
index f77c20f..f048d6d 100644
--- a/gcc/testsuite/gcc.dg/overflow-warn-2.c
+++ b/gcc/testsuite/gcc.dg/overflow-warn-2.c
@@ -86,21 +86,21 @@  h2 (void)
 {
   fsc (SCHAR_MAX + 1);
   /* { dg-warning "passing argument 1 of 'fsc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } .-1 } */
-  fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in implicit constant conversion" } */
+  fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value" } */
   /* { dg-warning "passing argument 1 of 'fsc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } .-1 } */
   fsc (UCHAR_MAX);
   /* { dg-warning "passing argument 1 of 'fsc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } .-1 } */
-  fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
+  fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in conversion from 'int' to 'signed char' changes value " } */
   /* { dg-warning "passing argument 1 of 'fsc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } .-1 } */
   fuc (-1);
   /* { dg-warning "passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } .-1 } */
-  fuc (UCHAR_MAX + 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+  fuc (UCHAR_MAX + 1); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value " } */
   /* { dg-warning "passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } .-1 } */
   fuc (SCHAR_MIN);
   /* { dg-warning "passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } .-1 } */
-  fuc (SCHAR_MIN - 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+  fuc (SCHAR_MIN - 1); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value " } */
   /* { dg-warning "passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } .-1 } */
-  fuc (-UCHAR_MAX); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+  fuc (-UCHAR_MAX); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value" } */
   /* { dg-warning "passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } .-1 } */
 }
 
diff --git a/gcc/testsuite/gcc.dg/overflow-warn-3.c b/gcc/testsuite/gcc.dg/overflow-warn-3.c
index 8bd190e..664011e4 100644
--- a/gcc/testsuite/gcc.dg/overflow-warn-3.c
+++ b/gcc/testsuite/gcc.dg/overflow-warn-3.c
@@ -91,15 +91,15 @@  void fsc (signed char);
 void
 h2 (void)
 {
-  fsc (SCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
-  fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in implicit constant conversion" } */
-  fsc (UCHAR_MAX); /* { dg-warning "overflow in implicit constant conversion" } */
-  fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
+  fsc (SCHAR_MAX + 1); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value" } */
+  fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value" } */
+  fsc (UCHAR_MAX); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value" } */
+  fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value " } */
   fuc (-1);
-  fuc (UCHAR_MAX + 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+  fuc (UCHAR_MAX + 1); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value" } */
   fuc (SCHAR_MIN);
-  fuc (SCHAR_MIN - 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
-  fuc (-UCHAR_MAX); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+  fuc (SCHAR_MIN - 1); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value" } */
+  fuc (-UCHAR_MAX); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value" } */
 }
 
 void fui (unsigned int);
diff --git a/gcc/testsuite/gcc.dg/overflow-warn-4.c b/gcc/testsuite/gcc.dg/overflow-warn-4.c
index a28cb56..52677ce 100644
--- a/gcc/testsuite/gcc.dg/overflow-warn-4.c
+++ b/gcc/testsuite/gcc.dg/overflow-warn-4.c
@@ -21,7 +21,7 @@  enum e {
   E5 = INT_MAX + 1, /* { dg-warning "integer overflow in expression" } */
   /* { dg-error "overflow in constant expression" "constant" { target *-*-* } .-1 } */
   /* Again, overflow in evaluated subexpression.  */
-  E6 = 0 * (INT_MAX + 1), /* { dg-warning "integer overflow in expression" } */
+  E6 = 0 * (INT_MAX + 1), /* { dg-warning "integer overflow in expression of type .int. results in .-\[0-9\]+." } */
   /* { dg-error "overflow in constant expression" "constant" { target *-*-* } .-1 } */
   /* A cast does not constitute overflow in conversion.  */
   E7 = (char) INT_MAX
@@ -91,15 +91,15 @@  void fsc (signed char);
 void
 h2 (void)
 {
-  fsc (SCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
-  fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in implicit constant conversion" } */
-  fsc (UCHAR_MAX); /* { dg-warning "overflow in implicit constant conversion" } */
-  fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
+  fsc (SCHAR_MAX + 1); /* { dg-warning "overflow in conversion from .int. to .signed char. changes value" } */
+  fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in conversion" } */
+  fsc (UCHAR_MAX); /* { dg-warning "overflow in conversion" } */
+  fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in conversion" } */
   fuc (-1);
-  fuc (UCHAR_MAX + 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+  fuc (UCHAR_MAX + 1); /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value" } */
   fuc (SCHAR_MIN);
-  fuc (SCHAR_MIN - 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
-  fuc (-UCHAR_MAX); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+  fuc (SCHAR_MIN - 1); /* { dg-warning "unsigned conversion" } */
+  fuc (-UCHAR_MAX); /* { dg-warning "unsigned conversion" } */
 }
 
 void fui (unsigned int);
diff --git a/gcc/testsuite/gcc.dg/overflow-warn-5.c b/gcc/testsuite/gcc.dg/overflow-warn-5.c
index 472d4a7..b2c8dc3 100644
--- a/gcc/testsuite/gcc.dg/overflow-warn-5.c
+++ b/gcc/testsuite/gcc.dg/overflow-warn-5.c
@@ -3,5 +3,5 @@ 
 /* { dg-options "-Woverflow" } */
 
 unsigned char rx_async(unsigned char p) {
-    return p & 512; /* { dg-warning "overflow in implicit constant conversion" } */
+    return p & 512; /* { dg-warning "overflow in conversion from .int. to .unsigned char. chages value" } */
 }
diff --git a/gcc/testsuite/gcc.dg/overflow-warn-8.c b/gcc/testsuite/gcc.dg/overflow-warn-8.c
index 43ecda0..ace6055 100644
--- a/gcc/testsuite/gcc.dg/overflow-warn-8.c
+++ b/gcc/testsuite/gcc.dg/overflow-warn-8.c
@@ -7,7 +7,7 @@  void foo (int j)
   int i3 = 1 + INT_MAX; /* { dg-warning "integer overflow" } */
   int i4 = +1 + INT_MAX; /* { dg-warning "integer overflow" } */
   int i5 = (int)((double)1.0 + INT_MAX);
-  int i6 = (double)1.0 + INT_MAX; /* { dg-warning "overflow in implicit constant" } */
+  int i6 = (double)1.0 + INT_MAX; /* { dg-warning "overflow in conversion from .double. to .int. chages value" } */
   int i7 = 0 ? (int)(double)1.0 + INT_MAX : 1;
   int i8 = 1 ? 1 : (int)(double)1.0 + INT_MAX;
   int i9 = j ? (int)(double)1.0 + INT_MAX : 1; /* { dg-warning "integer overflow" } */
diff --git a/gcc/testsuite/gcc.dg/overflow-warn-9.c b/gcc/testsuite/gcc.dg/overflow-warn-9.c
new file mode 100644
index 0000000..969d319
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/overflow-warn-9.c
@@ -0,0 +1,64 @@ 
+/* PR c/80731 - poor -Woverflow warnings, missing detail
+   { dg-do compile }
+   { dg-options "-Wconversion -Woverflow -Wno-override-init -std=c99" }
+   { dg-require-effective-target int32plus } */
+
+#include <limits.h>
+
+struct Types
+{
+  signed char sc;
+  unsigned char uc;
+  signed short ss;
+  unsigned short us;
+  signed int si;
+  unsigned int ui;
+  signed long sl;
+  unsigned long ul;
+  signed long long sll;
+  unsigned long long ull;
+};
+
+const struct Types t1 = {
+  /* According to 6.3.1.3 of C11:
+     -2-  Otherwise, if the new type is unsigned, the value is converted
+          by repeatedly adding or subtracting one more than the maximum
+	  value that can be represented in the new type until the value
+	  is in the range of the new type.
+
+     These conversions are diagnosed by -Wsign-conversion and -Wconversion,
+     respectively, by mentioning "unsigned conversion" if the conversion
+     results in sign change, and just "conversion" otherwise, as follows:  */
+
+  .uc = SCHAR_MIN,          /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value from .-128. to .128." } */
+  .uc = -1,                 /* { dg-warning "unsigned conversion from .int. to .unsigned char. changes value from .-1. to .255." } */
+
+  .uc = UCHAR_MAX + 1,      /* { dg-warning "conversion from 'int' to 'unsigned char' changes value from .256. to .0." } */
+  .uc = UCHAR_MAX * 2,      /* { dg-warning "conversion from 'int' to 'unsigned char' changes value from .510. to .254." } */
+
+  /* According to 6.3.1.3 of C11:
+     -3-  Otherwise, the new type is signed and the value cannot be
+          represented in it; either the result is implementation-defined
+	  or an implementation-defined signal is raised.
+
+     In GCC such conversios wrap and diagnosed by mentioning "overflow"
+     if the absolut value of the operand is in excess of the maximum of
+     the destination of type, and "conversion" otherwise, as follows:  */
+
+  .sc = SCHAR_MAX + 1,      /* { dg-warning "conversion from .int. to .signed char. changes value from .128. to .-128." } */
+  .sc = SCHAR_MAX + 2,      /* { dg-warning "conversion from .int. to .signed char. changes value from .129. to .-127." } */
+  .sc = SCHAR_MAX * 2,      /* { dg-warning "conversion from .int. to .signed char. changes value from .254. to .-2." } */
+  .sc = SCHAR_MAX * 2 + 3,  /* { dg-warning "conversion from .int. to .signed char. changes value from .257. to .1." } */
+  .sc = SCHAR_MAX * 3 + 3,  /* { dg-warning "conversion from .int. to .signed char. changes value from .384. to .-128." } */
+
+
+  .ss = SHRT_MAX + 1,       /* { dg-warning "conversion from 'int' to 'short int' changes value from .32768. to .-32768." } */
+  .us = USHRT_MAX + 1,      /* { dg-warning "unsigned conversion from .int. to .short unsigned int. changes value from .65536. to .0." } */
+
+  .si = INT_MAX + 1LU,      /* { dg-warning "signed conversion from 'long unsigned int. to 'int' changes value from .2147483648. to .-2147483648." } */
+  .ui = UINT_MAX + 1L,      /* { dg-warning "signed conversion from .long int. to .unsigned int. changes value from .4294967296. to .0." } */
+  .ui = UINT_MAX + 1LU,     /* { dg-warning "conversion from .long unsigned int. to .unsigned int. changes value from .4294967296. to .0." } */
+
+  .sl = LONG_MAX + 1LU,     /* { dg-warning "signed conversion from .long unsigned int. to .long int. changes value from .9223372036854775808. to .-9223372036854775808." } */
+  .ul = ULONG_MAX + 1LU     /* there should be some warning here */
+};
diff --git a/gcc/testsuite/gcc.dg/pr35635.c b/gcc/testsuite/gcc.dg/pr35635.c
index 86612d5..b52354f 100644
--- a/gcc/testsuite/gcc.dg/pr35635.c
+++ b/gcc/testsuite/gcc.dg/pr35635.c
@@ -32,7 +32,7 @@  void func1()
   /* At least one branch of ? does not fit in the destination, thus
      warn.  */
   unsigned_bit.x = bar != 0 ? 2 : 0; /* { dg-warning "conversion" } */
-  unsigned_bit.x = bar != 0 ? 0 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+  unsigned_bit.x = bar != 0 ? 0 : -1; /* { dg-warning "-Wsign-conversion" } */
 }
 
 void func2()
@@ -62,7 +62,7 @@  void func3()
   /* At least one branch of ? does not fit in the destination, thus
      warn.  */
   uchar_x = bar != 0 ? 2.1 : 10; /* { dg-warning "conversion" } */
-  uchar_x = bar != 0  /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+  uchar_x = bar != 0  /* { dg-warning "-Wsign-conversion" } */
     ? (unsigned char) 1024 
     : -1;
 }
diff --git a/gcc/testsuite/gcc.dg/pr59940.c b/gcc/testsuite/gcc.dg/pr59940.c
index 6dba8c7..cec8d07 100644
--- a/gcc/testsuite/gcc.dg/pr59940.c
+++ b/gcc/testsuite/gcc.dg/pr59940.c
@@ -9,13 +9,13 @@  int
 g (void)
 {
   sitype si = 12;
-  unsigned int ui = -1; /* { dg-warning "21:negative integer implicitly converted to unsigned type" } */
+  unsigned int ui = -1; /* { dg-warning "21:-Wsign-conversion" } */
   unsigned char uc;
   ui = si; /* { dg-warning "8:conversion" } */
-  si = 0x80000000; /* { dg-warning "8:conversion of unsigned constant value to negative integer" } */
+  si = 0x80000000; /* { dg-warning "8:-Wsign-conversion" } */
   si = 3.2f; /* { dg-warning "8:conversion" } */
-  uc = 256; /* { dg-warning "8:large integer implicitly truncated to unsigned type" } */
-  si = 0x800000000; /* { dg-warning "8:overflow in implicit constant conversion" } */
+  uc = 256; /* { dg-warning "8:-Woverflow" } */
+  si = 0x800000000; /* { dg-warning "8:-Woverflow" } */
   return f (si) /* { dg-warning "13:conversion" } */
          + f (si); /* { dg-warning "15:conversion" } */
 }
diff --git a/gcc/testsuite/gcc.dg/pr59963-2.c b/gcc/testsuite/gcc.dg/pr59963-2.c
index 8eb1a79..27e013c 100644
--- a/gcc/testsuite/gcc.dg/pr59963-2.c
+++ b/gcc/testsuite/gcc.dg/pr59963-2.c
@@ -1,7 +1,6 @@ 
 /* PR c/59963 */
 /* { dg-do compile } */
 /* { dg-options "-Woverflow -Wconversion" } */
-/* { dg-require-effective-target int32plus } */
 
 extern void bar (unsigned char);
 extern void bar8 (unsigned char, unsigned char, unsigned char, unsigned char,
@@ -13,25 +12,25 @@  extern int f (short a, short b);
 int
 g (void)
 {
-  return f (0xffffffffL, /* { dg-warning "13:overflow in implicit constant conversion" } */
-            0xffffffffL) /* { dg-warning "13:overflow in implicit constant conversion" } */
-	 && f (0xffffffffL, /* { dg-warning "9:overflow in implicit constant conversion" } */
-	       0xffffffffL); /* { dg-warning "9:overflow in implicit constant conversion" } */
+  return f (0xffffffffL, /* { dg-warning "13:-Woverflow" } */
+            0xffffffffL) /* { dg-warning "13:-Woverflow" } */
+	 && f (0xffffffffL, /* { dg-warning "9:-Woverflow" } */
+	       0xffffffffL); /* { dg-warning "9:-Woverflow" } */
 }
 
 void
 foo (int i)
 {
-  bar (256); /* { dg-warning "8:large integer implicitly truncated to unsigned type" } */
+  bar (256); /* { dg-warning "8:-Woverflow" } */
   bar (6.66f); /* { dg-warning "8:conversion" } */
-  bar8 (-1, /* { dg-warning "9:negative integer implicitly converted to unsigned type" } */
-	 -2, /* { dg-warning "3:negative integer implicitly converted to unsigned type" } */
-	  -3, /* { dg-warning "4:negative integer implicitly converted to unsigned type" } */
-	   -4, /* { dg-warning "5:negative integer implicitly converted to unsigned type" } */
-	    -5, /* { dg-warning "6:negative integer implicitly converted to unsigned type" } */
-	     -6, /* { dg-warning "7:negative integer implicitly converted to unsigned type" } */
-	      -7, /* { dg-warning "8:negative integer implicitly converted to unsigned type" } */
-	       -8); /* { dg-warning "9:negative integer implicitly converted to unsigned type" } */
+  bar8 (-1, /* { dg-warning "9:-Wsign-conversion" } */
+	 -2, /* { dg-warning "3:-Wsign-conversion" } */
+	  -3, /* { dg-warning "4:-Wsign-conversion" } */
+	   -4, /* { dg-warning "5:-Wsign-conversion" } */
+	    -5, /* { dg-warning "6:-Wsign-conversion" } */
+	     -6, /* { dg-warning "7:-Wsign-conversion" } */
+	      -7, /* { dg-warning "8:-Wsign-conversion" } */
+	       -8); /* { dg-warning "9:-Wsign-conversion" } */
   bazu (i, i); /* { dg-warning "9:conversion" } */
-  bazi (0x8, 0x80000000); /* { dg-warning "14:conversion of unsigned constant value to negative integer" "" { xfail int16 } } */
+  bazi (0x8, 0x80000000); /* { dg-warning "14:-Wsign-conversion" "" { xfail int16 } } */
 }
diff --git a/gcc/testsuite/gcc.dg/pr60114.c b/gcc/testsuite/gcc.dg/pr60114.c
index a2db9c9..3b4917a 100644
--- a/gcc/testsuite/gcc.dg/pr60114.c
+++ b/gcc/testsuite/gcc.dg/pr60114.c
@@ -5,28 +5,28 @@ 
 
 struct S { int n, u[2]; };
 const signed char z[] = {
-  [0] = 0x100, /* { dg-warning "9:overflow in implicit constant conversion" } */
-  [2] = 0x101, /* { dg-warning "9:overflow in implicit constant conversion" } */
+  [0] = 0x100, /* { dg-warning "9:-Woverflow" } */
+  [2] = 0x101, /* { dg-warning "9:-Woverflow" } */
 };
 int A[] = {
-            0, 0x80000000, /* { dg-warning "16:conversion of unsigned constant value to negative integer" } */
-            0xA, 0x80000000, /* { dg-warning "18:conversion of unsigned constant value to negative integer" } */
-            0xA, 0xA, 0x80000000 /* { dg-warning "23:conversion of unsigned constant value to negative integer" } */
+            0, 0x80000000, /* { dg-warning "16:-Wsign-conversion" } */
+            0xA, 0x80000000, /* { dg-warning "18:-Wsign-conversion" } */
+            0xA, 0xA, 0x80000000 /* { dg-warning "23:-Wsign-conversion" } */
           };
-int *p = (int []) { 0x80000000 }; /* { dg-warning "21:conversion of unsigned constant value to negative integer" } */
-union { int k; } u = { .k = 0x80000000 }; /* { dg-warning "29:conversion of unsigned constant value to negative integer" } */
+int *p = (int []) { 0x80000000 }; /* { dg-warning "21:-Wsign-conversion" } */
+union { int k; } u = { .k = 0x80000000 }; /* { dg-warning "29:-Wsign-conversion" } */
 typedef int H[];
 void
 foo (void)
 {
-  signed char a[][3] = { { 0x100, /* { dg-warning "28:overflow in implicit constant conversion" } */
-                    1, 0x100 }, /* { dg-warning "24:overflow in implicit constant conversion" } */
-                  { '\0', 0x100, '\0' } /* { dg-warning "27:overflow in implicit constant conversion" } */
+  signed char a[][3] = { { 0x100, /* { dg-warning "28:-Woverflow" } */
+                    1, 0x100 }, /* { dg-warning "24:-Woverflow" } */
+                  { '\0', 0x100, '\0' } /* { dg-warning "27:-Woverflow" } */
                 };
-  (const signed char []) { 0x100 }; /* { dg-warning "28:overflow in implicit constant conversion" } */
+  (const signed char []) { 0x100 }; /* { dg-warning "28:-Woverflow" } */
   (const float []) { 1e0, 1e1, 1e100 }; /* { dg-warning "32:conversion" } */
-  struct S s1 = { 0x80000000 }; /* { dg-warning "19:conversion of unsigned constant value to negative integer" } */
-  struct S s2 = { .n = 0x80000000 }; /* { dg-warning "24:conversion of unsigned constant value to negative integer" } */
-  struct S s3 = { .u[1] = 0x80000000 }; /* { dg-warning "27:conversion of unsigned constant value to negative integer" } */
-  H h = { 1, 2, 0x80000000 }; /* { dg-warning "17:conversion of unsigned constant value to negative integer" } */
+  struct S s1 = { 0x80000000 }; /* { dg-warning "19:-Wsign-conversion" } */
+  struct S s2 = { .n = 0x80000000 }; /* { dg-warning "24:-Wsign-conversion" } */
+  struct S s3 = { .u[1] = 0x80000000 }; /* { dg-warning "27:-Wsign-conversion" } */
+  H h = { 1, 2, 0x80000000 }; /* { dg-warning "17:-Wsign-conversion" } */
 }
diff --git a/gcc/testsuite/gcc.dg/switch-warn-2.c b/gcc/testsuite/gcc.dg/switch-warn-2.c
index 7778b66..76fd982 100644
--- a/gcc/testsuite/gcc.dg/switch-warn-2.c
+++ b/gcc/testsuite/gcc.dg/switch-warn-2.c
@@ -10,7 +10,7 @@  foo (unsigned int i)
 {
   switch (i)
   {
-    case 123456123456ULL: /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+    case 123456123456ULL: /* { dg-warning "conversion from .long long unsigned int. to .unsigned int. changes value" } */
       return 0;
     default:
       return 3;
diff --git a/gcc/testsuite/gcc.dg/utf-cvt.c b/gcc/testsuite/gcc.dg/utf-cvt.c
index d6f18ee..d992782 100644
--- a/gcc/testsuite/gcc.dg/utf-cvt.c
+++ b/gcc/testsuite/gcc.dg/utf-cvt.c
@@ -25,9 +25,9 @@  extern void full (unsigned long long);
 
 void m (char16_t c0, char32_t c1)
 {
-    f_c (c0);	/* { dg-warning "alter its value" } */
-    fsc (c0);	/* { dg-warning "alter its value" } */
-    fuc (c0);	/* { dg-warning "alter its value" } */
+    f_c (c0);	/* { dg-warning "conversion from .char16_t\[^\n\r\]*. to .char. may change value" } */
+    fsc (c0);	/* { dg-warning "may change value" } */
+    fuc (c0);	/* { dg-warning "may change value" } */
     f_s (c0);	/* { dg-warning "change the sign" } */
     fss (c0);	/* { dg-warning "change the sign" } */
     fus (c0);
@@ -41,12 +41,12 @@  void m (char16_t c0, char32_t c1)
     fsll (c0);
     full (c0);
 
-    f_c (c1);	/* { dg-warning "alter its value" } */
-    fsc (c1);	/* { dg-warning "alter its value" } */
-    fuc (c1);	/* { dg-warning "alter its value" } */
-    f_s (c1);	/* { dg-warning "alter its value" } */
-    fss (c1);	/* { dg-warning "alter its value" } */
-    fus (c1);	/* { dg-warning "alter its value" } */
+    f_c (c1);	/* { dg-warning "may change value" } */
+    fsc (c1);	/* { dg-warning "may change value" } */
+    fuc (c1);	/* { dg-warning "may change value" } */
+    f_s (c1);	/* { dg-warning "may change value" } */
+    fss (c1);	/* { dg-warning "may change value" } */
+    fus (c1);	/* { dg-warning "may change value" } */
     f_i (c1);	/* { dg-warning "change the sign" "" { target { ! int16 } } } */
     fsi (c1);	/* { dg-warning "change the sign" "" { target { ! int16 } } } */
     fui (c1);
diff --git a/gcc/testsuite/gcc.dg/utf16-4.c b/gcc/testsuite/gcc.dg/utf16-4.c
index 6ef4ae3..f9ebd61 100644
--- a/gcc/testsuite/gcc.dg/utf16-4.c
+++ b/gcc/testsuite/gcc.dg/utf16-4.c
@@ -12,10 +12,10 @@  char16_t	c2 = u'\U00064321';	/* { dg-warning "constant too long" } */
 char16_t	c3 = 'a';
 char16_t	c4 = U'a';
 char16_t	c5 = U'\u2029';
-char16_t	c6 = U'\U00064321';	/* { dg-warning "implicitly truncated" } */
+char16_t	c6 = U'\U00064321';	/* { dg-warning "conversion from .unsigned int. to .char16_t {aka short unsigned int}. changes value from .410401. to .17185." } */
 char16_t	c7 = L'a';
 char16_t	c8 = L'\u2029';
-char16_t 	c9 = L'\U00064321';	/* { dg-warning "implicitly truncated" "" { target { 4byte_wchar_t } } } */
+char16_t 	c9 = L'\U00064321';	/* { dg-warning "conversion" "" { target { 4byte_wchar_t } } } */
 					/* { dg-warning "constant too long" "" { target { ! 4byte_wchar_t } } .-1 } */
 
 int main () {}