This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/26630] [4.0 Regression] Incorrect result when subtracting, casting to short and back to int, adding and multiplying
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Mar 2006 13:53:03 -0000
- Subject: [Bug middle-end/26630] [4.0 Regression] Incorrect result when subtracting, casting to short and back to int, adding and multiplying
- References: <bug-26630-12336@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from rguenth at gcc dot gnu dot org 2006-03-10 13:53 -------
shorter testcase:
extern void abort(void);
int main()
{
int a1 = 40000;
int c1 = ( ((int)(short)(a1-10000)) + 10000)*2;
if (c1 != 80000)
abort();
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26630