Bug 37289 - [4.4 Regression] ICE after non-trivial conversion at assignment
Summary: [4.4 Regression] ICE after non-trivial conversion at assignment
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Richard Biener
URL:
Keywords: ice-on-valid-code
: 37366 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-08-30 16:05 UTC by Richard B. Kreckel
Modified: 2008-09-04 09:51 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-08-31 11:22:59


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard B. Kreckel 2008-08-30 16:05:43 UTC
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.
Comment 1 Andrew Pinski 2008-08-30 22:25:16 UTC
Confirmed on powerpc-linux-gnu also.

--  Pinski
Comment 2 Richard Biener 2008-08-31 11:22:59 UTC
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;

Comment 3 Richard Biener 2008-08-31 13:40:53 UTC
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

Comment 4 Richard Biener 2008-08-31 14:21:05 UTC
Fixed.
Comment 5 Richard Biener 2008-09-04 09:51:21 UTC
*** Bug 37366 has been marked as a duplicate of this bug. ***