This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/36300] New: Incorrect type used for inlined expression
- From: "acarmeli at mathworks dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 May 2008 14:39:37 -0000
- Subject: [Bug c/36300] New: Incorrect type used for inlined expression
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
System: Debian 2.6.22.8-mw017
GCC: gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
In the expression below:
- VALUE has type uint32_T
- Y gets a wrong result.
- If VALUE is assigned to an int32_T variable, and the variable is used instead
of VALUE, Y gets the correct result.
See attached file missing_downcast.c for more details and reproduction steps
-----------------
#define VALUE ((int32_T)((int64_T)U1 * (int64_T)3 >> 2) + 2)
Y = (int32_T)( (int64_T)(VALUE * VALUE)
*
(int64_T)954437177
>>
29
);
--
Summary: Incorrect type used for inlined expression
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: acarmeli at mathworks dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36300