public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/94146] New: Merging functions with same bodies stopped working
@ 2020-03-11 16:11 antoshkka at gmail dot com
  2020-03-11 17:48 ` [Bug middle-end/94146] [10 Regression] " jakub at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: antoshkka at gmail dot com @ 2020-03-11 16:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94146
           Summary: Merging functions with same bodies stopped working
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: antoshkka at gmail dot com
  Target Milestone: ---

Consider the example:

extern int x , y;

int ternary(int i) { return i > 0 ? x : y; }
int ternary2(int i) { return i > 0 ? x : y; }


GCC9 was merging the functions with -O2:

ternary2(int):
        jmp     ternary(int)


With GCC10 merging at -O2 is missing and function bodies are duplicated even
for very big functions: https://godbolt.org/z/2kH8VR

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

end of thread, other threads:[~2020-03-12 10:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11 16:11 [Bug middle-end/94146] New: Merging functions with same bodies stopped working antoshkka at gmail dot com
2020-03-11 17:48 ` [Bug middle-end/94146] [10 Regression] " jakub at gcc dot gnu.org
2020-03-11 17:54 ` jakub at gcc dot gnu.org
2020-03-11 17:57 ` jakub at gcc dot gnu.org
2020-03-12  8:57 ` rguenth at gcc dot gnu.org
2020-03-12  9:07 ` jakub at gcc dot gnu.org
2020-03-12  9:18 ` marxin at gcc dot gnu.org
2020-03-12 10:38 ` pinskia at gcc dot gnu.org

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).