I am using GCC 4.4.0 20080829 (experimental). $ cat u.c void f(unsigned long x); void g(long x) { f((unsigned long)(-1-x)+1); } $ gcc -c u.c u.c: In function 'g': u.c:4: error: non-trivial conversion at assignment D.2087 x D.2087 = -x; u.c:4: internal compiler error: verify_gimple failed Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
Confirmed on powerpc-linux-gnu also. -- Pinski
I have a patch. t.i: In function 'g': t.i:4: error: non-trivial conversion at assignment long unsigned int long int D.1235 = -x;
Subject: Bug 37289 Author: rguenth Date: Sun Aug 31 13:39:26 2008 New Revision: 139831 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139831 Log: 2008-08-31 Richard Guenther <rguenther@suse.de> PR middle-end/37289 * fold-const.c (fold_binary): Retain conversions in folding ~A + 1 to -A. * gcc.dg/pr37289.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/pr37289.c Modified: trunk/gcc/ChangeLog trunk/gcc/fold-const.c trunk/gcc/testsuite/ChangeLog
Fixed.
*** Bug 37366 has been marked as a duplicate of this bug. ***