* [Bug c/16223] Optimiser bug in gcc-3.4.0 (also in 3.4.1 20040625 prerelease)
2004-06-27 4:31 [Bug c/16223] New: Optimiser bug in gcc-3.4.0 (also in 3.4.1 20040625 prerelease) gcc-erikd at mega-nerd dot com
@ 2004-06-27 4:57 ` gcc-erikd at mega-nerd dot com
2004-06-27 6:30 ` gcc-erikd at mega-nerd dot com
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: gcc-erikd at mega-nerd dot com @ 2004-06-27 4:57 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gcc-erikd at mega-nerd dot com 2004-06-27 04:31 -------
Created an attachment (id=6634)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6634&action=view)
Preprocessor output of the code wich fails when compiled with gcc-3.4.0
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16223
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/16223] Optimiser bug in gcc-3.4.0 (also in 3.4.1 20040625 prerelease)
2004-06-27 4:31 [Bug c/16223] New: Optimiser bug in gcc-3.4.0 (also in 3.4.1 20040625 prerelease) gcc-erikd at mega-nerd dot com
2004-06-27 4:57 ` [Bug c/16223] " gcc-erikd at mega-nerd dot com
@ 2004-06-27 6:30 ` gcc-erikd at mega-nerd dot com
2004-06-27 8:39 ` [Bug rtl-optimization/16223] [3.4 Regression] " pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: gcc-erikd at mega-nerd dot com @ 2004-06-27 6:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gcc-erikd at mega-nerd dot com 2004-06-27 04:57 -------
Interesting extra data.
In the function calc_output in the preprocessor file term_test.i :
inline double
calc_output (float * buffer)
{ double fraction, left, right, icoeff ;
int f_index, increment = 3 ;
f_index = 2 * increment + 2 ;
left = right = 0.0 ;
do
{ fraction = f_index / 2.0 ;
icoeff = coeffs [0] + fraction * coeffs [1] ;
left += icoeff * buffer [0] ;
f_index -= increment ;
}
while (f_index >= 0) ;
return (left + right) ;
}
Its pretty obvious that the variable right contains 0.0 at the return
statement. If the return statment just returns left instead of left + right,
the test case passes.
This is probably the strongest evidence that something is really screwy.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16223
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/16223] [3.4 Regression] Optimiser bug in gcc-3.4.0 (also in 3.4.1 20040625 prerelease)
2004-06-27 4:31 [Bug c/16223] New: Optimiser bug in gcc-3.4.0 (also in 3.4.1 20040625 prerelease) gcc-erikd at mega-nerd dot com
2004-06-27 4:57 ` [Bug c/16223] " gcc-erikd at mega-nerd dot com
2004-06-27 6:30 ` gcc-erikd at mega-nerd dot com
@ 2004-06-27 8:39 ` pinskia at gcc dot gnu dot org
2004-06-27 11:21 ` belyshev at lubercy dot com
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-27 8:39 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-27 08:37 -------
I should note that unit-at-a-time is just inlining static functions, Note I can reproduce it with -O1
-finline-functions.
--
What |Removed |Added
----------------------------------------------------------------------------
Component|c |rtl-optimization
Keywords| |wrong-code
Known to fail| |3.4.0
Known to work| |3.5.0
Summary|Optimiser bug in gcc-3.4.0 |[3.4 Regression] Optimiser
|(also in 3.4.1 20040625 |bug in gcc-3.4.0 (also in
|prerelease) |3.4.1 20040625 prerelease)
Target Milestone|--- |3.4.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16223
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/16223] [3.4 Regression] Optimiser bug in gcc-3.4.0 (also in 3.4.1 20040625 prerelease)
2004-06-27 4:31 [Bug c/16223] New: Optimiser bug in gcc-3.4.0 (also in 3.4.1 20040625 prerelease) gcc-erikd at mega-nerd dot com
` (2 preceding siblings ...)
2004-06-27 8:39 ` [Bug rtl-optimization/16223] [3.4 Regression] " pinskia at gcc dot gnu dot org
@ 2004-06-27 11:21 ` belyshev at lubercy dot com
2004-06-27 17:59 ` [Bug rtl-optimization/16223] " pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: belyshev at lubercy dot com @ 2004-06-27 11:21 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From belyshev at lubercy dot com 2004-06-27 11:18 -------
There are bugs in your code:
input_index += 1.0 / src_ratio ;
filter->b_current = (filter->b_current + lrint (floor (input_index))) %
filter->b_len ;
^^^^^ this should be 'round'
input_index -= floor (input_index) ;
^^^^^ same here.
Suppose src_ratio = 0.1 then floor (1.0 / src_ratio) can be either 9.0 or 10.0
depending on internal precision.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16223
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/16223] Optimiser bug in gcc-3.4.0 (also in 3.4.1 20040625 prerelease)
2004-06-27 4:31 [Bug c/16223] New: Optimiser bug in gcc-3.4.0 (also in 3.4.1 20040625 prerelease) gcc-erikd at mega-nerd dot com
` (3 preceding siblings ...)
2004-06-27 11:21 ` belyshev at lubercy dot com
@ 2004-06-27 17:59 ` pinskia at gcc dot gnu dot org
2004-06-27 18:09 ` [Bug rtl-optimization/16223] Wrong-code due to more inlining pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-27 17:59 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-27 17:59 -------
Reopening for now, I will note that it fails on 3.3.3, 3.2.3, and 3.0.4 with -O1 -finline-functions also so
this is not a regression at all, just more inlining causes something else to happen.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Known to fail|3.4.0 |3.4.0 3.3.3 3.2.3 3.0.4
Resolution|INVALID |
Summary|[3.4 Regression] Optimiser |Optimiser bug in gcc-3.4.0
|bug in gcc-3.4.0 (also in |(also in 3.4.1 20040625
|3.4.1 20040625 prerelease) |prerelease)
Target Milestone|3.4.2 |---
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16223
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/16223] Wrong-code due to more inlining
2004-06-27 4:31 [Bug c/16223] New: Optimiser bug in gcc-3.4.0 (also in 3.4.1 20040625 prerelease) gcc-erikd at mega-nerd dot com
` (4 preceding siblings ...)
2004-06-27 17:59 ` [Bug rtl-optimization/16223] " pinskia at gcc dot gnu dot org
@ 2004-06-27 18:09 ` pinskia at gcc dot gnu dot org
2004-06-27 19:34 ` belyshev at lubercy dot com
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-27 18:09 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|Optimiser bug in gcc-3.4.0 |Wrong-code due to more
|(also in 3.4.1 20040625 |inlining
|prerelease) |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16223
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/16223] Wrong-code due to more inlining
2004-06-27 4:31 [Bug c/16223] New: Optimiser bug in gcc-3.4.0 (also in 3.4.1 20040625 prerelease) gcc-erikd at mega-nerd dot com
` (5 preceding siblings ...)
2004-06-27 18:09 ` [Bug rtl-optimization/16223] Wrong-code due to more inlining pinskia at gcc dot gnu dot org
@ 2004-06-27 19:34 ` belyshev at lubercy dot com
2004-06-27 19:46 ` pinskia at gcc dot gnu dot org
2004-06-27 19:46 ` belyshev at lubercy dot com
8 siblings, 0 replies; 10+ messages in thread
From: belyshev at lubercy dot com @ 2004-06-27 19:34 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From belyshev at lubercy dot com 2004-06-27 19:33 -------
Tescase uses floor() written in inline assembly, so 'inlining problem' is
basically lacking of rounding argument to floor() from 80 (long double,
precision of x86 fp registers) to 64 bits (plain double) when floor() gets
inlined. This is why floor(1.0/src_ratio) magically becomes 9.0 when src_ratio
= 0.1 but you expected 10.0. Keep in mind that 0.1 and other 'round' values
cannot be represented exactly in binary form. So result of (1.0/0.1) depends on
rounding mode. Insert "printf ("%i \n", filter->b_current);" at end of loop in
sinc_process () and see what happens when you compile this with different
options/different compilers. Testcase is wrong. wrong. wrong.
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |3.4.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16223
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/16223] Wrong-code due to more inlining
2004-06-27 4:31 [Bug c/16223] New: Optimiser bug in gcc-3.4.0 (also in 3.4.1 20040625 prerelease) gcc-erikd at mega-nerd dot com
` (6 preceding siblings ...)
2004-06-27 19:34 ` belyshev at lubercy dot com
@ 2004-06-27 19:46 ` pinskia at gcc dot gnu dot org
2004-06-27 19:46 ` belyshev at lubercy dot com
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-27 19:46 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-27 19:46 -------
So this is just the case of excussive precission, aka PR 323 and nothing else.
*** This bug has been marked as a duplicate of 323 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16223
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/16223] Wrong-code due to more inlining
2004-06-27 4:31 [Bug c/16223] New: Optimiser bug in gcc-3.4.0 (also in 3.4.1 20040625 prerelease) gcc-erikd at mega-nerd dot com
` (7 preceding siblings ...)
2004-06-27 19:46 ` pinskia at gcc dot gnu dot org
@ 2004-06-27 19:46 ` belyshev at lubercy dot com
8 siblings, 0 replies; 10+ messages in thread
From: belyshev at lubercy dot com @ 2004-06-27 19:46 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.4.2 |---
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16223
^ permalink raw reply [flat|nested] 10+ messages in thread