Optimizer is putting result of a log into the wrong reg

Jeffrey A Law law@cygnus.com
Tue Oct 5 14:20:00 GMT 1999


  In message <199909221848.OAA28388@gromit.jany.gs.com>you write:
  > 
  > I am enclosing a little source file which does call to log and gets a
  > NaN when this is clearly wrong. Upon looking at the disassembly it
  > looks like the optimizer is putting the result in the wrong
  > register. I am enclosing the source file and here is the output:
  > 
  > gromit:singhki$ gcc -v
  > Reading specs from /local/packages/gcc-2.95/lib/gcc-lib/i686-pc-linux-gnu/2
  > .95/specs
  > gcc version 2.95 19990728 (release)
  > gromit:singhki$ gcc -O foo.c -o foo -lm
  > gromit:singhki$ ./foo
  > Arghhhhhh!
  > 
  > gromit:singhki$ gcc -v
  > Reading specs from /local/packages/gcc-2.95/lib/gcc-lib/i686-pc-linux-gnu/2
  > .95/specs
  > gcc version 2.95 19990728 (release)
  > gromit:singhki$ gcc foo.c -o foo -lm
  > 
  > Notice that it doesn't print out Arghhhhhh! if it is compiled without
  > optimization.
I just tried this with the gcc-2.95.2 prerelease sources and it seems to
be working fine now.

jeff


More information about the Gcc-bugs mailing list