[SOLVED] wich switches in options.init_settings does the -Os set? lazarus / 64-FPC development ---------------------------------------------------------------------- Key-Real · 2024-10-02 13:45 I'm trying to optimize for size. With the -Os option the produced executable is segnificant smaller, but don't runs. Have to trace out a switch dodn't work! Pls provide all the setting -Os do ---------------------------------------------------------------------- Key-Real · 2024-10-02 15:34 ah, ok, it containts level1 and 2 and so on.... and a bunch of others ---------------------------------------------------------------------- TRon · 2024-10-02 16:01 Quote from: Key-Real on October 02, 2024, 03:45:39 pmWith the -Os option the produced executable is segnificant smaller, but don't runs. The different optimization levels might cause the compiler to produce code that doesn't run which is especially true for processors that do not get (too) much attention. You would have to do this on a case by case base and try to determine what kind of code produces 'faulty' code. So you might want to have a closer look at the produces assembler code and decipher that in order to learn why it fails. If you are able to determine the cause then it is possible to file a (complete) report so that a devs is able to address it (or perhaps you are able to figure out yourself what the compiler is doing wrong and suggest/create a patch). ---------------------------------------------------------------------- ccrause · 2024-10-02 16:43 -Os includes cs_opt_size in optimizerswitches.  Searching for cs_opt_size in the compiler source should show all the relevant code.