This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug other/63440] -Og does enable -fmerge-constants too


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63440

--- Comment #2 from R. Diez <rdiezmail-gcc at yahoo dot de> ---
Yes, I would enable -fmerge-constants with -Og.

I would do it even for -O0. Merging constants should be safe, and it saves
precious program space when generating debug builds for small embedded targets.

Besides, in my opinion, it does not make sense that the addresses of some
literal strings suddenly change when you enable optimisations, because they get
collapsed. Any bugs because of such shared addresses should be apparent in
debug builds too.

Note that GCC already seems to apply some optimisations when building with -O0.
Specifically, I believe that at least some dead code elimination does occur.
That would make sense, as you do not want to bloat your debug builds
unnecessary.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]