This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
sizetype overflow?
- To: kenner at vlsi1 dot ultra dot nyu dot edu
- Subject: sizetype overflow?
- From: Richard Henderson <rth at redhat dot com>
- Date: Mon, 13 Nov 2000 16:05:27 -0800
- Cc: gcc-bugs at gcc dot gnu dot org
What is the purpose of the following patch?
Fri Oct 20 13:33:16 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* fold-const.c (force_fit_type): Unsigned values can overflow
if they are sizetype.
As far as I can tell, all it does is break the following test:
$ cat zz.c
unsigned long foo(void)
{
return ~(sizeof(long)-1);
}
$ ./cc1 -quiet -W zz.c
zz.c: In function `foo':
zz.c:3: warning: large integer implicitly truncated to unsigned type
Which is caused by force_fit_type returning
<integer_cst type <integer_type long unsigned int>
constant -8>
instead of
<integer_cst type <integer_type long unsigned int>
constant 18446744073709551608>
r~