[hatari-devel] gcc warnings during compilation

Eero Tamminen eerot at users.berlios.de
Tue Mar 16 19:51:02 CET 2010


Hi,

On Tuesday 16 March 2010, Vincent Rivière wrote:
> Beware, when you compile with -O3 GCC does as much inlining as possible,
> and normally this warning occurs when GCC is really generating some
> useful code to access an array out of range.

I get the same warnings also with -O2 if I set read_memory() as inline,
good thing we don't do that. :-)


> However, it seems there are several GCC bugs related to this warning.
> Especially this report, fixed in future version 4.5:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36902

That bug sounded like gcc would be giving warnings about things that are
actually dead code/branches also in future and that the v4.5 fix would be
only about pushing the warnings slightly further along the optimization
passes (after one that checks constants), not general support for
(re-)checking them after all optimization passes have been done.

But I'm not even completely sure from the commit whether this fixes our
constant comparison case, or just constants in switch cases:
	http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36902#c34


	- Eero



More information about the hatari-devel mailing list