public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/107844] error: argument is not a field access for __builtin_preserve_field_info
Date: Wed, 18 Jan 2023 20:19:29 +0000	[thread overview]
Message-ID: <bug-107844-4-Kez7eqajne@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107844-4@http.gcc.gnu.org/bugzilla/>

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-01-18

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to David Faust from comment #3)
> Thanks for the info Andrew. I'll look at __builtin_offsetof.
> 
> As for the implementation in clang, I can point to some bits relevant to
> the builtin itself:
> llvm-project/clang/lib/CodeGen/CGBuiltin.cpp
>   CodeGenFunction::EmitBPFBuiltinExpr ()
> 
> llvm-project/llvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp
>   BPFAbstractMemberAccess::GetFieldInfo ()
> 
> But I am less familiar with the surrounding machinery such as their
> parsing and type systems..

So I looked (First off I am shocked they don't have target functions to handle
the builtins and every target builtin is handled in that file seems wrong), and
you are handed the AST before folding. This is different from GCC where it is
you are handed it after folding.

So I think we need some special handling in the c (and C++) parser to handle
this. I suspect we want to do the full handling of the builtin
(bpf_core_field_exists) in the parser rather than the macro expanded view of it
too. Similar to how offsetof is handled ...
Of course this will need some modifications to the bpf headers too. And that
solves some other issues too.

  parent reply	other threads:[~2023-01-18 20:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 17:41 [Bug target/107844] New: " james.hilliard1 at gmail dot com
2023-01-18 18:47 ` [Bug target/107844] " david.faust at oracle dot com
2023-01-18 18:58 ` pinskia at gcc dot gnu.org
2023-01-18 19:44 ` david.faust at oracle dot com
2023-01-18 20:19 ` pinskia at gcc dot gnu.org [this message]
2023-01-18 21:16 ` david.faust at oracle dot com
2023-04-19 16:33 ` jemarch at gcc dot gnu.org
2023-08-03 18:50 ` cvs-commit at gcc dot gnu.org
2023-11-27  6:40 ` jemarch at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107844-4-Kez7eqajne@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).