public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/113848] New: modula2 doesn't build with clang
@ 2024-02-09 10:35 fkastl at suse dot cz
  2024-02-09 11:11 ` [Bug modula2/113848] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: fkastl at suse dot cz @ 2024-02-09 10:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113848
           Summary: modula2 doesn't build with clang
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: fkastl at suse dot cz
  Target Milestone: ---
              Host: x86_64-linux
            Target: x86_64-linux

Building GCC using clang with modula2 language enabled raises this error.

m2/gm2-libs-boot/SArgs.c:93:90: error: arithmetic on a pointer to void
   93 |       ppc = static_cast<SArgs_PtrToPtrToChar> ((void *) (((void *)
(UnixArgs_GetArgV ()))+(n*sizeof (SArgs_PtrToChar))));
      |                                                         
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

This started happening between

g:fbb569315a291d2d5b32ad0fdaf0c42da9f5e93b and
g:260a22de4fa3d4ad3bb0d3ef2cd45d7f03eb3160

The only commit touching ./gcc/m2/gm2-libs/Sargs.{def,mod} is

g:64b0130bb6702c67a13caefaae9facef23d6ac60

so I suppose that's the culprit commit.


The build is configured using
--disable-multilib --disable-libsanitizer --disable-bootstrap
--with-system-zlib --enable-languages=c,c++,fortran,go,jit,lto,rust,m2
--enable-host-shared

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

* [Bug modula2/113848] modula2 doesn't build with clang
  2024-02-09 10:35 [Bug modula2/113848] New: modula2 doesn't build with clang fkastl at suse dot cz
@ 2024-02-09 11:11 ` rguenth at gcc dot gnu.org
  2024-02-10  1:50 ` gaius at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-02-09 11:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
void * arithmetic is a GCC extension, I suggest to change that to char *

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

* [Bug modula2/113848] modula2 doesn't build with clang
  2024-02-09 10:35 [Bug modula2/113848] New: modula2 doesn't build with clang fkastl at suse dot cz
  2024-02-09 11:11 ` [Bug modula2/113848] " rguenth at gcc dot gnu.org
@ 2024-02-10  1:50 ` gaius at gcc dot gnu.org
  2024-02-10  1:50 ` gaius at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-02-10  1:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 57375
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57375&action=edit
Proposed fix

Many thanks for the bug report and hint.  Here is the proposed patch (currently
being bootstrap tested).

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

* [Bug modula2/113848] modula2 doesn't build with clang
  2024-02-09 10:35 [Bug modula2/113848] New: modula2 doesn't build with clang fkastl at suse dot cz
  2024-02-09 11:11 ` [Bug modula2/113848] " rguenth at gcc dot gnu.org
  2024-02-10  1:50 ` gaius at gcc dot gnu.org
@ 2024-02-10  1:50 ` gaius at gcc dot gnu.org
  2024-02-10  2:19 ` cvs-commit at gcc dot gnu.org
  2024-02-10  2:20 ` gaius at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-02-10  1:50 UTC (permalink / raw)
  To: gcc-bugs

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

Gaius Mulley <gaius at gcc dot gnu.org> changed:

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

--- Comment #3 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Confirmed.

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

* [Bug modula2/113848] modula2 doesn't build with clang
  2024-02-09 10:35 [Bug modula2/113848] New: modula2 doesn't build with clang fkastl at suse dot cz
                   ` (2 preceding siblings ...)
  2024-02-10  1:50 ` gaius at gcc dot gnu.org
@ 2024-02-10  2:19 ` cvs-commit at gcc dot gnu.org
  2024-02-10  2:20 ` gaius at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-02-10  2:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Gaius Mulley <gaius@gcc.gnu.org>:

https://gcc.gnu.org/g:863202684dff775ae4a3e576f77044474384d41f

commit r14-8906-g863202684dff775ae4a3e576f77044474384d41f
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Sat Feb 10 02:18:54 2024 +0000

    PR modula2/113848 modula2 does not build with clang

    Re-write address arithmetic in gm2-libs/SArgs.mod:GetArg
    to avoid (void *) computation.  mc treats ADDRESS as (char *)
    but does not cast user type (PtrToChar) to (char *) when
    performing address arithmetic.

    gcc/m2/ChangeLog:

            PR modula2/113848
            * gm2-libs/SArgs.mod (GetArg): Re-write address arithmetic
            to avoid (void *) computation.

    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

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

* [Bug modula2/113848] modula2 doesn't build with clang
  2024-02-09 10:35 [Bug modula2/113848] New: modula2 doesn't build with clang fkastl at suse dot cz
                   ` (3 preceding siblings ...)
  2024-02-10  2:19 ` cvs-commit at gcc dot gnu.org
@ 2024-02-10  2:20 ` gaius at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-02-10  2:20 UTC (permalink / raw)
  To: gcc-bugs

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

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #5 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Closing now the patch has been applied.

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

end of thread, other threads:[~2024-02-10  2:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-09 10:35 [Bug modula2/113848] New: modula2 doesn't build with clang fkastl at suse dot cz
2024-02-09 11:11 ` [Bug modula2/113848] " rguenth at gcc dot gnu.org
2024-02-10  1:50 ` gaius at gcc dot gnu.org
2024-02-10  1:50 ` gaius at gcc dot gnu.org
2024-02-10  2:19 ` cvs-commit at gcc dot gnu.org
2024-02-10  2:20 ` gaius 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).