https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109125
Bug ID: 109125
Summary: [13 regression] SIGBUS in m2pim_ldtoa_ldtoa
Product: gcc
Version: 13.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: ---
Host: sparc-sun-solaris2.11
Target: sparc-sun-solaris2.11
Build: sparc-sun-solaris2.11
Between 20230310 (2eb0191aa104badf3cab127f7f87d371c0fef92b) and 20230313
(7ef44579787af646d5bae13a91a49ef5d2048f5c),
a large number of gm2 tests began to FAIL on Solaris/SPARC (both 32 and
64-bit):
+FAIL: gm2/extensions/run/pass/real32.mod execution, -O
+FAIL: gm2/extensions/run/pass/real32.mod execution, -O -g
+FAIL: gm2/extensions/run/pass/real32.mod execution, -O3 -fomit-frame-pointer
+FAIL: gm2/extensions/run/pass/real32.mod execution, -O3 -fomit-frame-pointer
-finline-functions
+FAIL: gm2/extensions/run/pass/real32.mod execution, -Os
+FAIL: gm2/extensions/run/pass/real32.mod execution, -g
and many more.
The last failure reports
RTExceptions.mod:649:35: In invalidloc
RTExceptions.mod:649:35:invalid address referenced
and gdb shows
Thread 2 received signal SIGBUS, Bus error.
[Switching to Thread 1 (LWP 1)]
0x00027f8c in m2pim_ldtoa_ldtoa (d=<optimized out>, mode=1, ndigits=100,
decpt=0xffbfe7ec, sign=0xffbfe7eb)
at /vol/gcc/src/hg/master/local/libgm2/libm2pim/ldtoa.cc:162
162 *sign = IMPORT(dtoa,calcsign) (p, MAX_FP_DIGITS + 20);
(gdb) bt
#0 0x00027f8c in m2pim_ldtoa_ldtoa (d=<optimized out>, mode=1, ndigits=100,
decpt=0xffbfe7ec, sign=0xffbfe7eb)
at /vol/gcc/src/hg/master/local/libgm2/libm2pim/ldtoa.cc:162
#1 0x00025abc in m2pim_StringConvert_LongrealToString (x=<optimized out>,
TotalWidth=9, FractionWidth=8)
at
/vol/gcc/src/hg/master/local/libgm2/libm2pim/../../gcc/m2/gm2-libs/StringConvert.mod:758
#2 0x0001a0f8 in _M2_real32_init (argc=1, argv=0xffbfea64, envp=0xffbfea6c)
at
/vol/gcc/src/hg/master/local/gcc/testsuite/gm2/extensions/run/pass/real32.mod:32
#3 0x0001cfc8 in m2pim_M2Dependent_ConstructModules (
applicationmodule=<optimized out>, libname=<optimized out>, argc=1,
argv=0xffbfea64, envp=0xffbfea6c)
at
/vol/gcc/src/hg/master/local/libgm2/libm2pim/../../gcc/m2/gm2-libs/M2Dependent.mod:813
#4 0x0001a7c8 in _M2_init (argc=1, argv=0xffbfea64, envp=0xffbfea6c)
at
/vol/gcc/src/hg/master/local/gcc/testsuite/gm2/extensions/run/pass/real32.mod:18
#5 0x0001a840 in main (argc=1, argv=0xffbfea64, envp=0xffbfea6c)
at
/vol/gcc/src/hg/master/local/gcc/testsuite/gm2/extensions/run/pass/real32.mod:18
(gdb) display/i $pc
1: x/i $pc
=> 0x27f8c <m2pim_ldtoa_ldtoa(long double, int, int, int*, int*)+124>:
st %o0, [ %i4 ]
(gdb) p/x $o0
$1 = 0x0
(gdb) p/x $i4
$2 = 0xffbfe7eb
Storing a 32-bit variable into an non-32-bit aligned destination is a no-no
on strict-alignment targets like SPARC.
This is no doubt due to
commit 431c06691dcbb84c7d999d91202537442e6a60f0
Author: Gaius Mulley <[email protected]>
Date: Sun Mar 12 13:27:23 2023 +0000
[PR modula2/109089] implementation of boolean should be C++/C bool