public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/105392] New: SEGV compiling gm2-libs-pim/BitBlockOps.mod on SPARC
@ 2022-04-26 11:30 ro at gcc dot gnu.org
  2022-11-10 13:06 ` [Bug modula2/105392] " ro at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ro at gcc dot gnu.org @ 2022-04-26 11:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105392
           Summary: SEGV compiling gm2-libs-pim/BitBlockOps.mod on SPARC
           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: sparc-sun-solaris2.11

With the fixes/hacks for PRs 105388 and 105390 in place, current devel/modula-2
branch can build the compiler on Solaris/SPARC.  However, I get a couple of
SEGVs
building libgm2:

/var/gcc/gcc-12.0.1-20220424/11.4-gm2/./gcc/gm2
-B/var/gcc/gcc-12.0.1-20220424/11.4-gm2/./gcc/ -c -g -O2 -g -O2 -I../libm2pim
-I/vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-libs-pim
-I/vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-libs
-I/vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-libs-iso
/vol/gcc/src/hg/master/modula-2/libgm2/libm2log/../../gcc/m2/gm2-libs-pim/BitBlockOps.mod
 -fPIC -DPIC -o .libs/BitBlockOps.o

Using a debug build to get more information, I get

Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0xffbfd7f4 in ?? ()
(gdb) where
#0  0xffbfd7f4 in ?? ()
#1  0x00c786f0 in m2statement_BuildUnaryForeachWordDo (location=3586091,
type=<type_decl 0xfa820630 BITSET>, op1=<var_decl 0xfa868840 _T89>,
op2=<var_decl 0xfa8687e8 _T88>, unop=0xffbfd7f4, is_op1lvalue=0,
is_op2lvalue=1, is_op1const=0, is_op2const=0) at
/vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-gcc/m2statement.cc:603
#2  0x00cfed6c in CodeUnarySet (unop=..., doOp=..., quad=287, result=2943,
expr=2942) at m2/gm2-compiler-boot/M2GenGCC.c:5909
#3  0x00d008c8 in CodeNegateChecked (quad=287, op1=2943, op3=2942) at
m2/gm2-compiler-boot/M2GenGCC.c:6446
#4  0x00cf26a4 in CodeStatement (q=287) at m2/gm2-compiler-boot/M2GenGCC.c:1792
#5  0x00d07ff8 in M2GenGCC_ConvertQuadsToTree (Start=287, End=331) at
m2/gm2-compiler-boot/M2GenGCC.c:8344
#6  0x00d380dc in M2Scope_ForeachScopeBlockDo (sb=0x36c7c28, p=...) at
m2/gm2-compiler-boot/M2Scope.c:638
#7  0x00cf1cf4 in M2Code_CodeBlock (scope=473) at
m2/gm2-compiler-boot/M2Code.c:511
#8  0x00d32fc4 in Lists_ForeachItemInListDo (l=0x35473a0, P=...) at
m2/gm2-compiler-boot/Lists.c:393
#9  0x00ce352c in SymbolTable_ForeachProcedureDo (Sym=155, P=...) at
m2/gm2-compiler-boot/SymbolTable.c:13316
#10 0x00cf1ef8 in M2Code_CodeBlock (scope=155) at
m2/gm2-compiler-boot/M2Code.c:543
#11 0x00cf1274 in DoCodeBlock () at m2/gm2-compiler-boot/M2Code.c:274
#12 0x00cf1b34 in M2Code_Code () at m2/gm2-compiler-boot/M2Code.c:474
#13 0x00cc5eb8 in Compile (s=0x3540de8) at m2/gm2-compiler-boot/M2Comp.c:211
#14 0x00cc7194 in M2Comp_compile (filename=0xffbfe72d) at
m2/gm2-compiler-boot/M2Comp.c:727
#15 0x00c858e0 in init_PerCompilationInit (filename=0xffbfe72d
"/vol/gcc/src/hg/master/modula-2/libgm2/libm2log/../../gcc/m2/gm2-libs-pim/BitBlockOps.mod")
at /vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-gcc/init.cc:195
#16 0x00c2d64c in gm2_parse_input_files (filenames=0x34ff2a8, filename_count=1)
at /vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-lang.cc:470
#17 0x00c2d6a8 in gm2_langhook_parse_file () at
/vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-lang.cc:476
#18 0x018448ec in compile_file () at
/vol/gcc/src/hg/master/modula-2/gcc/toplev.cc:452
#19 0x018498c0 in do_compile (no_backend=false) at
/vol/gcc/src/hg/master/modula-2/gcc/toplev.cc:2168
#20 0x01849e88 in toplev::main (this=0xffbfe012, argc=41, argv=0xffbfe07c) at
/vol/gcc/src/hg/master/modula-2/gcc/toplev.cc:2320
#21 0x02c11d2c in main (argc=41, argv=0xffbfe07c) at
/vol/gcc/src/hg/master/modula-2/gcc/main.cc:39

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

* [Bug modula2/105392] SEGV compiling gm2-libs-pim/BitBlockOps.mod on SPARC
  2022-04-26 11:30 [Bug modula2/105392] New: SEGV compiling gm2-libs-pim/BitBlockOps.mod on SPARC ro at gcc dot gnu.org
@ 2022-11-10 13:06 ` ro at gcc dot gnu.org
  2022-11-10 13:07 ` ro at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ro at gcc dot gnu.org @ 2022-11-10 13:06 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

* [Bug modula2/105392] SEGV compiling gm2-libs-pim/BitBlockOps.mod on SPARC
  2022-04-26 11:30 [Bug modula2/105392] New: SEGV compiling gm2-libs-pim/BitBlockOps.mod on SPARC ro at gcc dot gnu.org
  2022-11-10 13:06 ` [Bug modula2/105392] " ro at gcc dot gnu.org
@ 2022-11-10 13:07 ` ro at gcc dot gnu.org
  2022-11-10 13:07 ` ro at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ro at gcc dot gnu.org @ 2022-11-10 13:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Rainer Orth <ro at gcc dot gnu.org> ---
With PR modula2/101392 fixed, I ran into this one again.  As it turns out, it's
another instance of the same issue:

$ cc1gm2 -iplugindir=/var/gcc/modula-2/11.4-gcc-g3/./gcc/plugin -quiet -mcpu=v9
-g -O2 -fPIC -fplugin=m2rte -c -I ../libm2pim -I
/vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-libs-pim -I
/vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-libs -I
/vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-libs-iso
/vol/gcc/src/hg/master/modula-2/libgm2/libm2log/../../gcc/m2/gm2-libs-pim/BitBlockOps.mod
-o BitBlockOps.s

Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0xffbfde4c in ?? ()
(gdb) bt
#0  0xffbfde4c in ?? ()
#1  0x00d2d40c in m2statement_BuildUnaryForeachWordDo (location=3659819,
type=<type_decl 0xfa820630 BITSET>, op1=<var_decl 0xfa86c840 _T97>,
op2=<var_decl 0xfa86c7e8 _T96>, unop=0xffbfde4c, is_op1lvalue=0,
is_op2lvalue=1, is_op1const=0, is_op2const=0) at
/vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-gcc/m2statement.cc:543
#2  0x00d95e4c in CodeUnarySet (unop=..., constop=..., quad=338, result=2319,
expr=2318) at m2/gm2-compiler-boot/M2GenGCC.c:6017
#3  0x00d979a8 in CodeNegateChecked (quad=338, op1=2319, op3=2318) at
m2/gm2-compiler-boot/M2GenGCC.c:6554
#4  0x00d893dc in CodeStatement (q=338) at m2/gm2-compiler-boot/M2GenGCC.c:1815
#5  0x00d9f104 in M2GenGCC_ConvertQuadsToTree (Start=338, End=382) at
m2/gm2-compiler-boot/M2GenGCC.c:8454
#6  0x00de2f28 in M2Scope_ForeachScopeBlockDo (sb=0x38efa90, p=...) at
m2/gm2-compiler-boot/M2Scope.c:651
#7  0x00d720e0 in M2Code_CodeBlock (scope=304) at
m2/gm2-compiler-boot/M2Code.c:511
#8  0x00d54c70 in Lists_ForeachItemInListDo (l=0x3773c48, P=...) at
m2/gm2-compiler-boot/Lists.c:393
#9  0x00e0bb38 in SymbolTable_ForeachProcedureDo (Sym=155, P=...) at
m2/gm2-compiler-boot/SymbolTable.c:14044
#10 0x00d722e4 in M2Code_CodeBlock (scope=155) at
m2/gm2-compiler-boot/M2Code.c:543
#11 0x00d71660 in DoCodeBlock () at m2/gm2-compiler-boot/M2Code.c:274
#12 0x00d71f20 in M2Code_Code () at m2/gm2-compiler-boot/M2Code.c:474
#13 0x00d72574 in Compile (s=0x376d628) at m2/gm2-compiler-boot/M2Comp.c:211
#14 0x00d73a84 in M2Comp_compile (filename=0xffbfe9df) at
m2/gm2-compiler-boot/M2Comp.c:768
#15 0x00d3a638 in init_PerCompilationInit (filename=0xffbfe9df
"/vol/gcc/src/hg/master/modula-2/libgm2/libm2log/../../gcc/m2/gm2-libs-pim/BitBlockOps.mod")
at /vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-gcc/init.cc:198
#16 0x00ce1c0c in gm2_parse_input_files (filenames=0x372d6a8, filename_count=1)
at /vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-lang.cc:461
#17 0x00ce1c68 in gm2_langhook_parse_file () at
/vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-lang.cc:468
#18 0x0190637c in compile_file () at
/vol/gcc/src/hg/master/modula-2/gcc/toplev.cc:444
#19 0x0190b1bc in do_compile (no_backend=false) at
/vol/gcc/src/hg/master/modula-2/gcc/toplev.cc:2125
#20 0x0190b784 in toplev::main (this=0xffbfe66a, argc=20, argv=0xffbfe6d4) at
/vol/gcc/src/hg/master/modula-2/gcc/toplev.cc:2277
#21 0x02e05328 in main (argc=20, argv=0xffbfe6d4) at
/vol/gcc/src/hg/master/modula-2/gcc/main.cc:39
(gdb) up
#1  0x00d2d40c in m2statement_BuildUnaryForeachWordDo (location=3659819,
type=<type_decl 0xfa820630 BITSET>, op1=<var_decl 0xfa86c840 _T97>,
op2=<var_decl 0xfa86c7e8 _T96>, unop=0xffbfde4c, is_op1lvalue=0,
is_op2lvalue=1, is_op1const=0, is_op2const=0) at
/vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-gcc/m2statement.cc:543
543         m2statement_BuildAssignmentTree (

    /* Small set size <= TSIZE(WORD).  */
    m2statement_BuildAssignmentTree (
        location, m2treelib_get_rvalue (location, op1, type, is_op1lvalue),
        (*unop) (location,
                 m2treelib_get_rvalue (location, op2, type, is_op2lvalue),
                 FALSE));

(gdb) x/5i unop
   0xffbfde4c:  unknown
   0xffbfde50:  unknown
   0xffbfde54:  unknown
   0xffbfde58:  fbne  0xfff004f8
   0xffbfde5c:  illtrap  0xfff7d82b
(gdb) ptype unop
type = union tree_node {
[...]
} *(*)(location_t, tree, int)
(gdb) up
#2  0x00d95e4c in CodeUnarySet (unop=..., constop=..., quad=338, result=2319,
expr=2318) at m2/gm2-compiler-boot/M2GenGCC.c:6017
6017          m2statement_BuildUnaryForeachWordDo (location,
SymbolConversion_Mod2Gcc (SymbolTable_GetType (result)),
SymbolConversion_Mod2Gcc (result), SymbolConversion_Mod2Gcc (expr), unop,
(SymbolTable_GetMode (result)) == SymbolTable_LeftValue, (SymbolTable_GetMode
(expr)) == SymbolTable_LeftValue, SymbolTable_IsConst (result),
SymbolTable_IsConst (expr));
(gdb) ptype unop
type = struct m2expr_BuildUnarySetFunction_p {
    m2expr_BuildUnarySetFunction_t proc;
}

With the attached patch, I got the build to complete.

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

* [Bug modula2/105392] SEGV compiling gm2-libs-pim/BitBlockOps.mod on SPARC
  2022-04-26 11:30 [Bug modula2/105392] New: SEGV compiling gm2-libs-pim/BitBlockOps.mod on SPARC ro at gcc dot gnu.org
  2022-11-10 13:06 ` [Bug modula2/105392] " ro at gcc dot gnu.org
  2022-11-10 13:07 ` ro at gcc dot gnu.org
@ 2022-11-10 13:07 ` ro at gcc dot gnu.org
  2022-11-23 14:55 ` gaius at gcc dot gnu.org
  2022-11-23 15:11 ` gaius at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ro at gcc dot gnu.org @ 2022-11-10 13:07 UTC (permalink / raw)
  To: gcc-bugs

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

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-11-10
   Target Milestone|---                         |13.0
     Ever confirmed|0                           |1

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

* [Bug modula2/105392] SEGV compiling gm2-libs-pim/BitBlockOps.mod on SPARC
  2022-04-26 11:30 [Bug modula2/105392] New: SEGV compiling gm2-libs-pim/BitBlockOps.mod on SPARC ro at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-11-10 13:07 ` ro at gcc dot gnu.org
@ 2022-11-23 14:55 ` gaius at gcc dot gnu.org
  2022-11-23 15:11 ` gaius at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: gaius at gcc dot gnu.org @ 2022-11-23 14:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Many thanks!  I've changed all definition modules in gcc/m2/gm2-gcc for
consistency.

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

* [Bug modula2/105392] SEGV compiling gm2-libs-pim/BitBlockOps.mod on SPARC
  2022-04-26 11:30 [Bug modula2/105392] New: SEGV compiling gm2-libs-pim/BitBlockOps.mod on SPARC ro at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-11-23 14:55 ` gaius at gcc dot gnu.org
@ 2022-11-23 15:11 ` gaius at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: gaius at gcc dot gnu.org @ 2022-11-23 15:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Gaius Mulley <gaius at gcc dot gnu.org> ---
seen it build and regression tests run - so closing this PR.

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

end of thread, other threads:[~2022-11-23 15:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 11:30 [Bug modula2/105392] New: SEGV compiling gm2-libs-pim/BitBlockOps.mod on SPARC ro at gcc dot gnu.org
2022-11-10 13:06 ` [Bug modula2/105392] " ro at gcc dot gnu.org
2022-11-10 13:07 ` ro at gcc dot gnu.org
2022-11-10 13:07 ` ro at gcc dot gnu.org
2022-11-23 14:55 ` gaius at gcc dot gnu.org
2022-11-23 15:11 ` 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).