public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/114215] New: GCC makes wrong decision for inline with -Os or -Oz to deal with trivial functions
@ 2024-03-03  2:53 unlvsur at live dot com
  2024-03-03  3:06 ` [Bug ipa/114215] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: unlvsur at live dot com @ 2024-03-03  2:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114215
           Summary: GCC makes wrong decision for inline with -Os or -Oz to
                    deal with trivial functions
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: unlvsur at live dot com
  Target Milestone: ---

This is a very common example for implementing a bounds checking vecotr index.
GCC makes the wrong decision. This even increases the code size but not
decreases the size compared to -O3.

GCC with -Oz
https://godbolt.org/z/sa9YYqnYY
GCC with -Ofast
https://godbolt.org/z/b6jahvh6s

clang with -Oz
https://godbolt.org/z/GxPaxP66b

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

end of thread, other threads:[~2024-03-06  2:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-03  2:53 [Bug rtl-optimization/114215] New: GCC makes wrong decision for inline with -Os or -Oz to deal with trivial functions unlvsur at live dot com
2024-03-03  3:06 ` [Bug ipa/114215] " pinskia at gcc dot gnu.org
2024-03-03  3:18 ` pinskia at gcc dot gnu.org
2024-03-03  3:27 ` unlvsur at live dot com
2024-03-03  3:30 ` unlvsur at live dot com
2024-03-03  3:36 ` pinskia at gcc dot gnu.org
2024-03-03  3:44 ` [Bug ipa/114215] -Os or -Oz inlining seems wrong for vague linkage functions unlvsur at live dot com
2024-03-03  3:45 ` unlvsur at live dot com
2024-03-06  2:23 ` unlvsur at live dot com

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