[Bug middle-end/49543] Cast move causes incorrect code and numerical results

2011-06-27 Thread acarmeli at mathworks dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49543 --- Comment #5 from Alexander Carmeli 2011-06-27 20:15:37 UTC --- That's a good point. I removed the const and g++ fails as well. Therefore, the bug is in the C++ compiler too. Consts can be promoted as well. Why promote the non-const expressio

[Bug middle-end/49543] Cast move causes incorrect code and numerical results

2011-06-27 Thread acarmeli at mathworks dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49543 --- Comment #3 from Alexander Carmeli 2011-06-27 18:40:25 UTC --- Andrew, You are correct about the standard not defining the result. Similar behavior was fixed before (see bug 36300 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36300) I think t

[Bug middle-end/49543] Cast move causes incorrect code and numerical results

2011-06-27 Thread acarmeli at mathworks dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49543 --- Comment #1 from Alexander Carmeli 2011-06-27 12:36:20 UTC --- Created attachment 24607 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24607 Assembly code demonstrating incorrect cltq instruction placement

[Bug middle-end/49543] New: Cast move causes incorrect code and numerical results

2011-06-27 Thread acarmeli at mathworks dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49543 Summary: Cast move causes incorrect code and numerical results Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: middle-end Assi

[Bug c/8068] [3.2/3.3 regression] exceedingly high (infinite) memory usage

2008-05-28 Thread acarmeli at mathworks dot com
--- Comment #6 from acarmeli at mathworks dot com 2008-05-28 12:37 --- Richard, This is the root cause of the problem: I agree with you that an overflow can occur and there is no way to guarantee the resulting value. However, it must be a 32-bit value. It cannot all of a sudden

[Bug middle-end/36300] Incorrect type used for inlined expression

2008-05-28 Thread acarmeli at mathworks dot com
--- Comment #14 from acarmeli at mathworks dot com 2008-05-28 12:25 --- You are correct. But step 6 did not reveal that, and provided a correct s64 result. This result should have been carried over to step 7 to lead to a correct result. Otherwise, it will not be possible to get the

[Bug middle-end/36300] Incorrect type used for inlined expression

2008-05-28 Thread acarmeli at mathworks dot com
--- Comment #11 from acarmeli at mathworks dot com 2008-05-28 11:30 --- I believe there is still a violation of the C standard when expression folding folds this. The attached file demonstrates this. In step 7, we perform 4*3 in 32-bit and expect to get a 12 in a 64-bit. It should be

[Bug middle-end/36300] Incorrect type used for inlined expression

2008-05-28 Thread acarmeli at mathworks dot com
--- Comment #10 from acarmeli at mathworks dot com 2008-05-28 11:21 --- Created an attachment (id=15691) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15691&action=view) Steps to reach numerically incorrect/impossible result Compile: gcc bad_numeric.c Builds up expressio

[Bug c/36300] Incorrect type used for inlined expression

2008-05-22 Thread acarmeli at mathworks dot com
--- Comment #1 from acarmeli at mathworks dot com 2008-05-22 14:43 --- Created an attachment (id=15671) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15671&action=view) Wrong result if expression is inlined At the bottom of the file there are: - Instructions on how to

[Bug c/36300] New: Incorrect type used for inlined expression

2008-05-22 Thread acarmeli at mathworks dot com
gnu dot org ReportedBy: acarmeli at mathworks dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36300