public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/105388] New: [12 regression] Conflicting trunc decls in mc-boot/Gdecl.c etc. on Solaris
@ 2022-04-26  9:53 ro at gcc dot gnu.org
  2022-04-26  9:54 ` [Bug modula2/105388] " ro at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: ro at gcc dot gnu.org @ 2022-04-26  9:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105388
           Summary: [12 regression] Conflicting trunc decls in
                    mc-boot/Gdecl.c etc. on Solaris
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
  Target Milestone: ---
            Target: *-*-solaris2.11

When building the devel/modula-2 branch as of

commit 6ac8c270eda44fc51104f450f35f91f2705e0c9f
Author: Gaius Mulley <gaius.mulley@southwales.ac.uk>
Date:   Sat Apr 23 12:43:18 2022 +0100

    PR-102342 - fixes to allow gm2 testsuite to work with multilib and extra
gcc objects.

on Solaris (SPARC and x86), compilation failed like this:

/vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot/Gdecl.c:270:764: error: 'trunc'
conflicts with a previous declaration
  270 | typedef enum {explist, funccall, exit_, return_, stmtseq, comment,
halt, new_, dispose, inc, dec, incl, excl, length, nil, true_, false_, address,
loc, byte, word, csizet, cssizet, char_, cardinal, longcard, shortcard,
integer, longint, shortint, real, longreal, shortreal, bitset, boolean, proc,
ztype, rtype, complex_, longcomplex, shortcomplex, type, record, varient, var,
enumeration, subrange, array, subscript, string, const_, literal, varparam,
param, varargs, optarg_, pointer, recordfield, varientfield, enumerationfield,
set, proctype, procedure, def, imp, module, loop, while_, for_, repeat, case_,
caselabellist, caselist, range, assignment, if_, elsif, constexp, neg, cast,
val, plus, sub, div_, mod, mult, divide, in, adr, size, tsize, ord, float_,
trunc, chr, abs_, cap, high, throw_, unreachable, cmplx, re, im, min, max,
componentref, pointerref, arrayref, deref, equal, notequal, less, greater,
greequal, lessequal, lsl, lsr, lor, land, lnot, lxor, and_, or_, not_,
identlist, vardecl, setvalue} nodeT;
      |                                                                        
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                   ^~~~~
In file included from
/var/gcc/gcc-12.0.1-20220424/11.4-gm2/prev-gcc/include-fixed/math.h:25,
                 from
/var/gcc/gcc-12.0.1-20220424/11.4-gm2/prev-sparc-sun-solaris2.11/libstdc++-v3/include/bits/std_abs.h:40,
                 from
/var/gcc/gcc-12.0.1-20220424/11.4-gm2/prev-sparc-sun-solaris2.11/libstdc++-v3/include/cstdlib:77,
                 from
/var/gcc/gcc-12.0.1-20220424/11.4-gm2/prev-sparc-sun-solaris2.11/libstdc++-v3/include/stdlib.h:36,
                 from /vol/gcc/src/hg/master/modula-2/gcc/system.h:265,
                 from
/vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot/Gdecl.c:24:
/usr/include/iso/math_c99.h:492:15: note: previous declaration 'namespace std {
}::trunc'
  492 | extern double trunc __P((double));
      |               ^~~~~
/vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot/Gdecl.c: In function 'void
setUnary(decl_node, nodeT, decl_node, decl_node)':
/vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot/Gdecl.c:7040:12: error: cannot
resolve overloaded function 'trunc' based on conversion to type 'int'
 7040 |       case trunc:
      |            ^~~~~
[...]
/vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot/Gdecl.c: In function
'nameKey_Name decl_getSymName(decl_node)':
/vol/gcc/src/hg/master/modula-2/gcc/m2/mc-boot/Gdecl.c:24345:12: error: cannot
resolve overloaded function 'trunc' based on conversion to type 'int'
24345 |       case trunc:
      |            ^~~~~

I used the same approach as was already applied for several other cases in the
same file of renaming trunc to trunc_.  However, Gdecl.c is generated, but
I couldn't find where to apply this change in the actual source.

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

* [Bug modula2/105388] [12 regression] Conflicting trunc decls in mc-boot/Gdecl.c etc. on Solaris
  2022-04-26  9:53 [Bug modula2/105388] New: [12 regression] Conflicting trunc decls in mc-boot/Gdecl.c etc. on Solaris ro at gcc dot gnu.org
@ 2022-04-26  9:54 ` ro at gcc dot gnu.org
  2022-04-26  9:55 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: ro at gcc dot gnu.org @ 2022-04-26  9:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Rainer Orth <ro at gcc dot gnu.org> ---
Created attachment 52881
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52881&action=edit
Hacky patch

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

* [Bug modula2/105388] [12 regression] Conflicting trunc decls in mc-boot/Gdecl.c etc. on Solaris
  2022-04-26  9:53 [Bug modula2/105388] New: [12 regression] Conflicting trunc decls in mc-boot/Gdecl.c etc. on Solaris ro at gcc dot gnu.org
  2022-04-26  9:54 ` [Bug modula2/105388] " ro at gcc dot gnu.org
@ 2022-04-26  9:55 ` rguenth at gcc dot gnu.org
  2022-04-26  9:58 ` jakub at gcc dot gnu.org
  2022-04-28 17:56 ` [Bug modula2/105388] [12/13 " gaius at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-26  9:55 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

* [Bug modula2/105388] [12 regression] Conflicting trunc decls in mc-boot/Gdecl.c etc. on Solaris
  2022-04-26  9:53 [Bug modula2/105388] New: [12 regression] Conflicting trunc decls in mc-boot/Gdecl.c etc. on Solaris ro at gcc dot gnu.org
  2022-04-26  9:54 ` [Bug modula2/105388] " ro at gcc dot gnu.org
  2022-04-26  9:55 ` rguenth at gcc dot gnu.org
@ 2022-04-26  9:58 ` jakub at gcc dot gnu.org
  2022-04-28 17:56 ` [Bug modula2/105388] [12/13 " gaius at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-04-26  9:58 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
                 CC|                            |jakub at gcc dot gnu.org

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

* [Bug modula2/105388] [12/13 regression] Conflicting trunc decls in mc-boot/Gdecl.c etc. on Solaris
  2022-04-26  9:53 [Bug modula2/105388] New: [12 regression] Conflicting trunc decls in mc-boot/Gdecl.c etc. on Solaris ro at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-04-26  9:58 ` jakub at gcc dot gnu.org
@ 2022-04-28 17:56 ` gaius at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: gaius at gcc dot gnu.org @ 2022-04-28 17:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Thanks for the patch - ah yes the list of C functions/macros/reserved words to
be avoided needed to be extended.

The list of reserved words/functions/macros to be avoided in mc are contained
in:
gcc/m2/mc/keyc.mod


diff --git a/gcc/m2/mc/keyc.mod b/gcc/m2/mc/keyc.mod
index 2cf06790d93..a6584f49a9f 100644
--- a/gcc/m2/mc/keyc.mod
+++ b/gcc/m2/mc/keyc.mod
@@ -1033,6 +1033,7 @@ BEGIN
    add (macros, 'cos') ;
    add (macros, 'tan') ;
    add (macros, 'log10') ;
+   add (macros, 'trunc') ;
    add (macros, 'I') ;
    add (macros, 'csqrt') ;
    add (macros, 'strlen') ;

to recreate the C version of mc - which updates the C version of mc in the
source tree you can perform:

cd build-devel-modula2-enabled    # your build directory
cd gcc
export PATH=$HOME/opt/bin:$PATH   # the install bin for the current gm2
make mc-help
make mc-maintainer                # builds a new C version of mc (checking
                                  # that the C and m2 versions produce the
                                  # same output.
make mc-verify                    # and double check that the new version from 
                                  # the source tree builds
                                  # cleanly and produces the same output.


I've added the patch above, remade mc on the gcc-12 branch and re-tested
building gcc from bootstrap on amd64.

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

end of thread, other threads:[~2022-04-28 17:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26  9:53 [Bug modula2/105388] New: [12 regression] Conflicting trunc decls in mc-boot/Gdecl.c etc. on Solaris ro at gcc dot gnu.org
2022-04-26  9:54 ` [Bug modula2/105388] " ro at gcc dot gnu.org
2022-04-26  9:55 ` rguenth at gcc dot gnu.org
2022-04-26  9:58 ` jakub at gcc dot gnu.org
2022-04-28 17:56 ` [Bug modula2/105388] [12/13 " 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).