public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/111908] New: Port CheriBSD-specific compiler warnings to GCC
@ 2023-10-21 12:06 egallager at gcc dot gnu.org
  2023-10-21 21:17 ` [Bug target/111908] " jrtc27 at jrtc27 dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: egallager at gcc dot gnu.org @ 2023-10-21 12:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111908
           Summary: Port CheriBSD-specific compiler warnings to GCC
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: build, diagnostic
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: egallager at gcc dot gnu.org
                CC: jrtc27 at jrtc27 dot com
            Blocks: 44756, 87403
  Target Milestone: ---
            Target: CheriBSD

The GCC compile farm has a CheriBSD machine, cfarm240, where the C/C++ memory
rules are stricter than normal. CheriBSD modifications to C/C++ are described
in the CHERI C/C++ Programming Guide:
https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-947.pdf
The document outlines a number of warnings that their compiler has for code
that will break on CheriBSD, specifically:

- -Wcheri-prototypes (kinda like -Wstrict-prototypes)
- -Wcheri-capability-misuse (kinda like -Wint-to-pointer-cast and
-Wpointer-to-int-cast; says something like "warning: cast from provenance-free
integer type to pointer type will give pointer that can not be dereferenced")
- -Wcheri-provenance (says something like "warning: binary expression on
capability types; it is not clear which should be used as the source of
provenance")

Note that some of these warnings will show up in a build of GCC itself, and
will cause the build to fail if configured with --enable-werror
--enable-werror-always.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44756
[Bug 44756] [meta-bug] --enable-werror-always issues
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87403
[Bug 87403] [Meta-bug] Issues that suggest a new warning

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

* [Bug target/111908] Port CheriBSD-specific compiler warnings to GCC
  2023-10-21 12:06 [Bug target/111908] New: Port CheriBSD-specific compiler warnings to GCC egallager at gcc dot gnu.org
@ 2023-10-21 21:17 ` jrtc27 at jrtc27 dot com
  2023-10-23  9:58 ` acoplan at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jrtc27 at jrtc27 dot com @ 2023-10-21 21:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jessica Clarke <jrtc27 at jrtc27 dot com> ---
NB: Arm have a vendor branch for Morello (intended to be generic across CHERI
with a Morello-specific backend, rather than overly tied to the Morello
prototype) at refs/vendors/ARM/heads/morello. I have no experience of it, and
it's less mature than our decade-old Clang/LLVM, but it purports to both add
CHERI C diagnostics and introduce Morello code generation. They are tied
together, as they are in our Clang/LLVM, but there's no reason one couldn't
port some of the diagnostics to non-CHERI and warn people that they're doing
things outside of ISO (or even GNU) C, even if they happen to work on those
architectures, though disambiguating intptr_t vs ((un)signed) long (long) (or
even int on ILP32) may not be feasible given that *is* very much OK on
ILP32/LP64/LLP64.

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

* [Bug target/111908] Port CheriBSD-specific compiler warnings to GCC
  2023-10-21 12:06 [Bug target/111908] New: Port CheriBSD-specific compiler warnings to GCC egallager at gcc dot gnu.org
  2023-10-21 21:17 ` [Bug target/111908] " jrtc27 at jrtc27 dot com
@ 2023-10-23  9:58 ` acoplan at gcc dot gnu.org
  2023-10-24  8:22 ` egallager at gcc dot gnu.org
  2023-10-24  9:58 ` acoplan at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: acoplan at gcc dot gnu.org @ 2023-10-23  9:58 UTC (permalink / raw)
  To: gcc-bugs

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

Alex Coplan <acoplan at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |acoplan at gcc dot gnu.org

--- Comment #2 from Alex Coplan <acoplan at gcc dot gnu.org> ---
Indeed, you can see an example of the CHERI warnings in the Morello GCC port
here: https://godbolt.org/z/eWPfqYYYo

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

* [Bug target/111908] Port CheriBSD-specific compiler warnings to GCC
  2023-10-21 12:06 [Bug target/111908] New: Port CheriBSD-specific compiler warnings to GCC egallager at gcc dot gnu.org
  2023-10-21 21:17 ` [Bug target/111908] " jrtc27 at jrtc27 dot com
  2023-10-23  9:58 ` acoplan at gcc dot gnu.org
@ 2023-10-24  8:22 ` egallager at gcc dot gnu.org
  2023-10-24  9:58 ` acoplan at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: egallager at gcc dot gnu.org @ 2023-10-24  8:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Alex Coplan from comment #2)
> Indeed, you can see an example of the CHERI warnings in the Morello GCC port
> here: https://godbolt.org/z/eWPfqYYYo

Where do the sources for the Morello GCC port currently live? If they haven't
been upstreamed yet, are there plans to do so?

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

* [Bug target/111908] Port CheriBSD-specific compiler warnings to GCC
  2023-10-21 12:06 [Bug target/111908] New: Port CheriBSD-specific compiler warnings to GCC egallager at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-10-24  8:22 ` egallager at gcc dot gnu.org
@ 2023-10-24  9:58 ` acoplan at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: acoplan at gcc dot gnu.org @ 2023-10-24  9:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Alex Coplan <acoplan at gcc dot gnu.org> ---
(In reply to Eric Gallager from comment #3)
> (In reply to Alex Coplan from comment #2)
> > Indeed, you can see an example of the CHERI warnings in the Morello GCC port
> > here: https://godbolt.org/z/eWPfqYYYo
> 
> Where do the sources for the Morello GCC port currently live? If they
> haven't been upstreamed yet, are there plans to do so?

The sources are in the ARM/morello vendor branch as Jessica mentioned (see
https://gcc.gnu.org/gitwrite.html#vendor for info on vendor branches, you can
see the branch here:
https://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/vendors/ARM/heads/morello).

There aren't any plans to upstream the changes at present since Morello is a
prototype/research architecture only.

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

end of thread, other threads:[~2023-10-24  9:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-21 12:06 [Bug target/111908] New: Port CheriBSD-specific compiler warnings to GCC egallager at gcc dot gnu.org
2023-10-21 21:17 ` [Bug target/111908] " jrtc27 at jrtc27 dot com
2023-10-23  9:58 ` acoplan at gcc dot gnu.org
2023-10-24  8:22 ` egallager at gcc dot gnu.org
2023-10-24  9:58 ` acoplan 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).