public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/58689] New: Enhance returns_nonnull
@ 2013-10-11 12:19 glisse at gcc dot gnu.org
  2013-10-11 16:50 ` [Bug tree-optimization/58689] " jakub at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-10-11 12:19 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58689

            Bug ID: 58689
           Summary: Enhance returns_nonnull
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: diagnostic, missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org
        Depends on: 21856, 24825

For PR 20318, we added an attribute "returns_nonnull". For now, it is quite
basic and only used by fold-const and VRP to assert in callers that the return
value is != 0. However, there are many other things that could be done with it,
see this conversation for details:

http://gcc.gnu.org/ml/gcc-patches/2013-10/msg00498.html
http://gcc.gnu.org/ml/gcc-patches/2013-10/msg00501.html
http://gcc.gnu.org/ml/gcc-patches/2013-10/msg00509.html

This includes in particular:
1) warn if a returns_nonnull function returns null (both using static analysis
and runtime tests);
2) optimize the callee, back-propagating this non-null property and marking as
unreachable the paths that would return 0;
3) preserve the nonnull property when inlining the function (assert_expr?);
4) mark a number of gcc functions with this attribute.

A number of these changes could be shared with the nonnull attribute and
pointer dereferencing.


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

end of thread, other threads:[~2024-06-18  6:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-11 12:19 [Bug tree-optimization/58689] New: Enhance returns_nonnull glisse at gcc dot gnu.org
2013-10-11 16:50 ` [Bug tree-optimization/58689] " jakub at gcc dot gnu.org
2013-10-11 17:23 ` glisse at gcc dot gnu.org
2013-10-29 13:15 ` glisse at gcc dot gnu.org
2014-04-24 20:27 ` eduardo.abinader at openbossa dot org
2014-04-24 20:47 ` glisse at gcc dot gnu.org
2014-04-24 21:05 ` eduardo.abinader at openbossa dot org
2024-06-18  6:21 ` [Bug tree-optimization/58689] [meta-bug] __attribute__((returns_nonnull)) enhancements sjames 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).