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 target/24743] NaN or correct result after divrp with 3 FPU registers



------- Comment #3 from sraa at kse dot nl  2005-11-12 12:07 -------
We found out that the stackpointer was unbalanced at a given point. Via a small
program in assembly wich reads the stackpointer that I placed at suspicious
points in the code I found a function that didn't restore the stackpointer
correctly.

This function was of type float and returned a float but this result was not
assigned to any variable... So this has to be it. I know this for sure on
monday since the production has stopped now and I cannot test it.

Example of the false code:

   partijlocmut_kg(geleverd1);              /* returns a float ..... */

Instead of:

   geleverd1 = partijlocmut_kg(geleverd1);

So a Sun hadn't this problem because the stack is managed differently and the
floating point calculations are done by the software instead of a FPU with
using of the stack registers. Or has something smart or by coincidence to
return the float to a register anyhow. I think it returned the value to the
parameter with which the function was called. Otherwise the software wouldn't
have worked.

If our software was written, in ANSI-C, with correct prototyping of functions,
the compiler would have been able to signal the error. Unfortunalely it isn't.
But now we know how to seatch or what we have to do.....

The cause for my problems was not a buggy OS or compiler but just bad written
code.


-- 

sraa at kse dot nl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24743


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