public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/36300]  New: Incorrect type used for inlined expression
@ 2008-05-22 14:40 acarmeli at mathworks dot com
  2008-05-22 14:44 ` [Bug c/36300] " acarmeli at mathworks dot com
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: acarmeli at mathworks dot com @ 2008-05-22 14:40 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2009-03-31 15:39 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-22 14:40 [Bug c/36300] New: Incorrect type used for inlined expression acarmeli at mathworks dot com
2008-05-22 14:44 ` [Bug c/36300] " acarmeli at mathworks dot com
2008-05-22 16:11 ` rguenth at gcc dot gnu dot org
2008-05-22 16:12 ` [Bug middle-end/36300] " rguenth at gcc dot gnu dot org
2008-05-26  9:28 ` rguenth at gcc dot gnu dot org
2008-05-26 10:13 ` rguenth at gcc dot gnu dot org
2008-05-26 12:39 ` rguenth at gcc dot gnu dot org
2008-05-26 12:40 ` rguenth at gcc dot gnu dot org
2008-05-27 12:51 ` acarmeli at mathworks dot com
2008-05-27 12:53 ` rguenther at suse dot de
2008-05-28 11:22 ` acarmeli at mathworks dot com
2008-05-28 11:31 ` acarmeli at mathworks dot com
2008-05-28 11:49 ` rguenth at gcc dot gnu dot org
2008-05-28 12:12 ` rguenth at gcc dot gnu dot org
2008-05-28 12:26 ` acarmeli at mathworks dot com
2008-05-28 12:58 ` rguenther at suse dot de
2008-05-28 13:46 ` [Bug middle-end/36300] [4.1/4.2/4.3 Regression] " rguenth at gcc dot gnu dot org
2008-05-28 13:47 ` rguenth at gcc dot gnu dot org
2008-05-28 13:48 ` rguenth at gcc dot gnu dot org
2008-05-28 22:11 ` [Bug middle-end/36300] [4.1/4.2 " rguenth at gcc dot gnu dot org
2008-07-04 23:04 ` [Bug middle-end/36300] [4.2 " jsm28 at gcc dot gnu dot org
2009-03-31 15:39 ` jsm28 at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).