public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/63440] New: -Og does enable -fmerge-constants too
@ 2014-10-02  9:24 rdiezmail-gcc at yahoo dot de
  2014-10-06 12:06 ` [Bug other/63440] " rguenth at gcc dot gnu.org
  2014-10-06 13:36 ` rdiezmail-gcc at yahoo dot de
  0 siblings, 2 replies; 3+ messages in thread
From: rdiezmail-gcc at yahoo dot de @ 2014-10-02  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 63440
           Summary: -Og does enable -fmerge-constants too
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rdiezmail-gcc at yahoo dot de

The documentation for -fmerge-constants does not mention that the new
optimization level -Og does enable -fmerge-constants too. Or at least it seems
to do, judging by the generated code size in  my tests.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug other/63440] -Og does enable -fmerge-constants too
  2014-10-02  9:24 [Bug other/63440] New: -Og does enable -fmerge-constants too rdiezmail-gcc at yahoo dot de
@ 2014-10-06 12:06 ` rguenth at gcc dot gnu.org
  2014-10-06 13:36 ` rdiezmail-gcc at yahoo dot de
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-10-06 12:06 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-10-06
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  Do you think it is ok to enable -fmerge-constants with -Og?  Note
that the various "Enabled at levels ..." were not updated for -Og.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug other/63440] -Og does enable -fmerge-constants too
  2014-10-02  9:24 [Bug other/63440] New: -Og does enable -fmerge-constants too rdiezmail-gcc at yahoo dot de
  2014-10-06 12:06 ` [Bug other/63440] " rguenth at gcc dot gnu.org
@ 2014-10-06 13:36 ` rdiezmail-gcc at yahoo dot de
  1 sibling, 0 replies; 3+ messages in thread
From: rdiezmail-gcc at yahoo dot de @ 2014-10-06 13:36 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-06 13:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-02  9:24 [Bug other/63440] New: -Og does enable -fmerge-constants too rdiezmail-gcc at yahoo dot de
2014-10-06 12:06 ` [Bug other/63440] " rguenth at gcc dot gnu.org
2014-10-06 13:36 ` rdiezmail-gcc at yahoo dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).