[Bug 273773] PNVI-ae-udi memory model non-compliance

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 14 Sep 2023 08:26:16 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273773

            Bug ID: 273773
           Summary: PNVI-ae-udi memory model non-compliance
           Product: Base System
           Version: 13.2-RELEASE
          Hardware: arm64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: arm
          Assignee: freebsd-arm@FreeBSD.org
          Reporter: pkk@spth.de
 Attachment #244826 text/plain
         mime type:

Created attachment 244826
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=244826&action=edit
Some sample C source to reproduce the issue

I discovered this issue using the SDCC regression test suite on a Raspi 4
running FreeBSD 13.0, 13.1 and 13.2. I do not know if it affects other FreeBSD
systems.

The C standard does not specify a memory model, and there are ambiguities and
different interpretations. Years ago, this became to be seen as a problem, and
WG14 created the memory model study group. By now, there is mostly a consensus
that the memory model called "PNVI-ae-udi" makes the most sense. While it will
not be put into the C standard immediately, it will be a technical
specification (TS 6010).

FreeBSD 13 on aarch64 currently fails three of the testcases for the
PNVI-ae-udi memory model (I have not seen similar problem on GNU/Linux with
recent clang and GCC).

Reproduce e.g. via:

philipp@raspi-aulnay:~ $ clang -Wall -pedantic -O2 test2.c
test2.c:35:13: warning: unused variable 'j' [-Wunused-variable]
  uintptr_t j = (uintptr_t)q;
            ^
1 warning generated.
philipp@raspi-aulnay:~ $ ./a.out
Assertion failed: (y == 11), function testMM, file test2.c, line 39.
Abort trap (core dumped)

-- 
You are receiving this mail because:
You are the assignee for the bug.