enabling optimizations (-Og) with --enable-debug

Luke Deller luke at deller.id.au
Thu Jan 15 04:47:20 PST 2015


Hi,

I saw that gcc-4.8 introduced a new optimization level -Og which enables 
optimizations that do not interfere with debugging.

Yesterday I floated the idea on IRC of using this with --enable-debug 
rather than -O0 if available, and some feedback was that it enables gcc 
to report extra warnings which would be a good thing.

I tried it out and can see that it does indeed break the build if 
--enable-werror is enabled, eg:

/home/deller/build/libo/vcl/unx/glxtest.cxx: In function ‘void glxtest()’:
/home/deller/build/libo/vcl/unx/glxtest.cxx:236:44: error: ignoring 
return value of ‘ssize_t write(int, const void*, size_t)’, declared with 
attribute warn_unused_result [-Werror=unused-result]
    write(write_end_of_the_pipe, buf, length);

So I guess this means we couldn't incorporate -Og until all these new 
warnings are fixed right?

Any other thoughts on whether this is a good idea to pursue?  One fear 
was that it might slow down compilation, but it doesn't actually seem to 
slow down "make clean && make" much at all for me.  I'll get some proper 
timing measurements.

(A draft patch is attached to enable -Og if available)

Regards,
Luke.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DRAFT-enable-debug-optimization.patch
Type: text/x-patch
Size: 2876 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20150115/7cef6e50/attachment.bin>


More information about the LibreOffice mailing list