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

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-10-04
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #1 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
For this, per my understanding, the Analyzer (a) needs to know that, for
example, 'acc_malloc' returns a "device" pointer (vs. 'malloc' returning a
"host" pointer), and then (b) accordingly track that state for variable 'a'
here (also across function boundaries, etc.), and eventually (c) diagnose that
'free' takes a "host" pointer but here receives a "device" pointer.

David, re (b), "host" vs. "device" pointer is an orthogonal concept to the
existing Analyzer pointer states -- these effectively all need to be duplicated
for "device" pointer, or probably rather some flag or-ed in; how do you suggest
this to be done?

David, re (a) and (c), do we teach directly the Analyzer about specific
functions (like 'acc_malloc', 'acc_free' if '-fopenacc' is enabled), or do we
add GCC function attributes to designate return value and formal parameters as
"device" instead of "host" pointer, or something else?

Reply via email to