Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Mon, 22 May 2023 12:48:42 -0400
From: Rich Felker <>
Subject: Dropping -Os

It's been known for a long time now that -Os is bad, mainly because it
imposes a few really ugly pessimizations without their own switches,
like forcing use of div instructions for div-by-constant instead of
allowing strength reduction to a mul (because the mul takes a couple
more bytes of .text O_o).

The attached proposed change switches over to starting with -O2 and
patching it up with the actually-desirable parts of -Os.

AIUI, at least with GCC this has other side effects, because the -O3
used with OPTIMIZE_GLOBS (--enable-optimize for particular components)
will not override explicit -f options. So there might be more work
that should be done splitting out the size/speed CFLAGS into separate
variables and only applying one to each file, rather than putting -O3
on top like we do now. Or it might not matter.

It's also perhaps worth considering whether this breakdown still makes
sense, or if there are unified options that would have low size cost
but achieve the bulk of the benefit of -O3.


View attachment "0001-configure-replace-Os-with-equivalent-based-on-O2.patch" of type "text/plain" (1932 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.