This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/16223] Optimiser bug in gcc-3.4.0 (also in 3.4.1 20040625 prerelease)


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]