public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/108121] New: Failing tests on x86_64-linux-gnu
@ 2022-12-15  9:13 marxin at gcc dot gnu.org
  2022-12-15  9:14 ` [Bug modula2/108121] " marxin at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-12-15  9:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108121
           Summary: Failing tests on x86_64-linux-gnu
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-linux-gnu

I noticed the following 2 tests fail:

gm2.log: FAIL: gm2/pim/pass/TestLong4.mod,  -g  
gm2.log: FAIL: gm2/pim/pass/TestLong4.mod,  -O  
gm2.log: FAIL: gm2/pim/pass/TestLong4.mod,  -O -g  
gm2.log: FAIL: gm2/pim/pass/TestLong4.mod,  -Os  
gm2.log: FAIL: gm2/pim/pass/TestLong4.mod,  -O3 -fomit-frame-pointer  
gm2.log: FAIL: gm2/pim/pass/TestLong4.mod,  -O3 -fomit-frame-pointer
-finline-functions  
gm2.log: FAIL: gm2/pim/pass/arraybool.mod,  -g   (internal compiler error:
Aborted)
gm2.log: FAIL: gm2/pim/pass/arraybool.mod,  -O   (internal compiler error:
Aborted)
gm2.log: FAIL: gm2/pim/pass/arraybool.mod,  -O -g   (internal compiler error:
Aborted)
gm2.log: FAIL: gm2/pim/pass/arraybool.mod,  -Os   (internal compiler error:
Aborted)
gm2.log: FAIL: gm2/pim/pass/arraybool.mod,  -O3 -fomit-frame-pointer  
(internal compiler error: Aborted)
gm2.log: FAIL: gm2/pim/pass/arraybool.mod,  -O3 -fomit-frame-pointer
-finline-functions   (internal compiler error: Aborted)


/dev/shm/objdir/gcc/gm2 -B/dev/shm/objdir/gcc
-I/dev/shm/objdir/x86_64-pc-linux-gnu/./libgm2/libm2log:/home/marxin/Programming/gcc/gcc/testsuite/../m2/gm2-libs-pim
-I/dev/shm/objdir/x86_64-pc-linux-gnu/./libgm2/libm2pim:/home/marxin/Programming/gcc/gcc/testsuite/../m2/gm2-libs
-I/dev/shm/objdir/x86_64-pc-linux-gnu/./libgm2/libm2iso:/home/marxin/Programming/gcc/gcc/testsuite/../m2/gm2-libs-iso
-I/home/marxin/Programming/gcc/gcc/testsuite/gm2/pim/pass:/home/marxin/Programming/gcc/gcc/testsuite/../m2/gm2-compiler:/home/marxin/Programming/gcc/gcc/testsuite/../m2/gm2-gcc
-fpim -L/dev/shm/objdir/x86_64-pc-linux-gnu/./libgm2/libm2log/.libs
-L/dev/shm/objdir/x86_64-pc-linux-gnu/./libgm2/libm2pim/.libs
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnostics-color=never -fdiagnostics-plain-output -O3 -fomit-frame-pointer
-finline-functions -c -o /dev/shm/objdir/gcc/testsuite/gm211/arraybool.o
/home/marxin/Programming/gcc/gcc/testsuite/gm2/pim/pass/arraybool.mod
terminate called after throwing an instance of 'unsigned int'
*** WARNING *** there are active plugins, do not report this as a bug unless
you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_FINISH                    | m2rte
cc1gm2: internal compiler error: Aborted
0x214082f crash_signal
        /home/marxin/Programming/gcc/gcc/toplev.cc:314
0x27b7e1d __gnu_cxx::__verbose_terminate_handler()
        ../../../../libstdc++-v3/libsupc++/vterminate.cc:95
0x27b70fb __cxxabiv1::__terminate(void (*)())
        ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:48
0x27b7166 std::terminate()
        ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:58
0x27b72c7 __cxa_throw
        ../../../../libstdc++-v3/libsupc++/eh_throw.cc:98
0x1011deb InvokeHandler
        m2/gm2-libs-boot/RTExceptions.c:483
0x1011deb RTExceptions_Raise
        m2/gm2-libs-boot/RTExceptions.c:943
0xf89fcf M2LexBuf_MakeVirtualTok
        m2/gm2-compiler-boot/M2LexBuf.c:1357
0xf9daba BuildStaticArray
        m2/gm2-compiler-boot/M2Quads.c:13084
0xf9daba M2Quads_BuildDesignatorArray
        m2/gm2-compiler-boot/M2Quads.c:18617
0xfe017a ArrayExpList
        m2/gm2-compiler-boot/P3Build.c:6533
0xfe017a SubDesignator
        m2/gm2-compiler-boot/P3Build.c:6496
0xfde222 SimpleDes
        m2/gm2-compiler-boot/P3Build.c:6867
0xfde222 SetOrDesignatorOrFunction
        m2/gm2-compiler-boot/P3Build.c:6824
0xfde222 Factor
        m2/gm2-compiler-boot/P3Build.c:6739
0xfde2b3 Term
        m2/gm2-compiler-boot/P3Build.c:6702
0xfde39c UnaryOrTerm
        m2/gm2-compiler-boot/P3Build.c:6680
0xfde39c SimpleExpression
        m2/gm2-compiler-boot/P3Build.c:6633
0xfde59d Expression
        m2/gm2-compiler-boot/P3Build.c:6608
0xfe08f5 IfStatement
        m2/gm2-compiler-boot/P3Build.c:7200
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

spawn -ignore SIGHUP /dev/shm/objdir/gcc/gm2 -B/dev/shm/objdir/gcc
-I/dev/shm/objdir/x86_64-pc-linux-gnu/./libgm2/libm2log:/home/marxin/Programming/gcc/gcc/testsuite/../m2/gm2-libs-pim
-I/dev/shm/objdir/x86_64-pc-linux-gnu/./libgm2/libm2pim:/home/marxin/Programming/gcc/gcc/testsuite/../m2/gm2-libs
-I/dev/shm/objdir/x86_64-pc-linux-gnu/./libgm2/libm2iso:/home/marxin/Programming/gcc/gcc/testsuite/../m2/gm2-libs-iso
-I/home/marxin/Programming/gcc/gcc/testsuite/gm2/pim/pass:/home/marxin/Programming/gcc/gcc/testsuite/../m2/gm2-compiler:/home/marxin/Programming/gcc/gcc/testsuite/../m2/gm2-gcc
-fpim -L/dev/shm/objdir/x86_64-pc-linux-gnu/./libgm2/libm2log/.libs
-L/dev/shm/objdir/x86_64-pc-linux-gnu/./libgm2/libm2pim/.libs
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnostics-color=never -fdiagnostics-plain-output -O3 -fomit-frame-pointer
-c -o /dev/shm/objdir/gcc/testsuite/gm212/TestLong4.o
/home/marxin/Programming/gcc/gcc/testsuite/gm2/pim/pass/TestLong4.mod
/home/marxin/Programming/gcc/gcc/testsuite/gm2/pim/pass/TestLong4.mod:26:6:
warning: attempting to assign a value ‘9223372036854775808’ to a designator ‘l’
which will exceed the range of type ‘LONGCARD’
FAIL: gm2/pim/pass/TestLong4.mod,  -O3 -fomit-frame-pointer

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

* [Bug modula2/108121] Failing tests on x86_64-linux-gnu
  2022-12-15  9:13 [Bug modula2/108121] New: Failing tests on x86_64-linux-gnu marxin at gcc dot gnu.org
@ 2022-12-15  9:14 ` marxin at gcc dot gnu.org
  2022-12-15  9:14 ` marxin at gcc dot gnu.org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-12-15  9:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
The first fails due to the following valgrind issue:

==2990== Conditional jump or move depends on uninitialised value(s)
==2990==    at 0xF94BF4: GenQuadO(unsigned int, M2Quads_QuadOperator, unsigned
int, unsigned int, unsigned int, unsigned int) [clone .part.0]
(M2Quads.c:13971)
==2990==    by 0xF99E15: GenQuadO (M2Quads.c:13960)
==2990==    by 0xF99E15: doBuildAssignment(unsigned int, unsigned int, unsigned
int) (M2Quads.c:6859)
==2990==    by 0xF9EA3D: BuildAssignmentWithoutBounds (M2Quads.c:6671)
==2990==    by 0xF9EA3D: ConvertBooleanToVariable(unsigned int, unsigned int)
(M2Quads.c:13684)
==2990==    by 0xFE0175: ArrayExpList (P3Build.c:6532)
==2990==    by 0xFE0175: SubDesignator(unsigned int, unsigned int, unsigned
int) (P3Build.c:6496)
==2990==    by 0xFDE222: SimpleDes (P3Build.c:6867)
==2990==    by 0xFDE222: SetOrDesignatorOrFunction (P3Build.c:6824)
==2990==    by 0xFDE222: Factor(unsigned int, unsigned int, unsigned int)
(P3Build.c:6739)
==2990==    by 0xFDE2B3: Term(unsigned int, unsigned int, unsigned int)
(P3Build.c:6702)
==2990==    by 0xFDE39C: UnaryOrTerm (P3Build.c:6680)
==2990==    by 0xFDE39C: SimpleExpression(unsigned int, unsigned int, unsigned
int) (P3Build.c:6633)
==2990==    by 0xFDE59D: Expression(unsigned int, unsigned int, unsigned int)
(P3Build.c:6608)
==2990==    by 0xFE08F5: IfStatement (P3Build.c:7200)
==2990==    by 0xFE08F5: Statement(unsigned int, unsigned int, unsigned int)
(P3Build.c:6989)
==2990==    by 0xFE142D: StatementSequence(unsigned int, unsigned int, unsigned
int) (P3Build.c:7158)
==2990==    by 0xFE166F: NormalPart (P3Build.c:8018)
==2990==    by 0xFE166F: InitialBlockBody (P3Build.c:7947)
==2990==    by 0xFE166F: InitialBlock (P3Build.c:7907)
==2990==    by 0xFE166F: Block(unsigned int, unsigned int, unsigned int)
(P3Build.c:7882)
==2990==    by 0xFE2C5D: ProgramModule (P3Build.c:3936)
==2990==    by 0xFE2C5D: ImplementationOrProgramModule (P3Build.c:4048)
==2990==    by 0xFE2C5D: FileUnit (P3Build.c:3863)
==2990==    by 0xFE2C5D: P3Build_CompilationUnit (P3Build.c:9362)

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

* [Bug modula2/108121] Failing tests on x86_64-linux-gnu
  2022-12-15  9:13 [Bug modula2/108121] New: Failing tests on x86_64-linux-gnu marxin at gcc dot gnu.org
  2022-12-15  9:14 ` [Bug modula2/108121] " marxin at gcc dot gnu.org
@ 2022-12-15  9:14 ` marxin at gcc dot gnu.org
  2022-12-15  9:23 ` marxin at gcc dot gnu.org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-12-15  9:14 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

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

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

* [Bug modula2/108121] Failing tests on x86_64-linux-gnu
  2022-12-15  9:13 [Bug modula2/108121] New: Failing tests on x86_64-linux-gnu marxin at gcc dot gnu.org
  2022-12-15  9:14 ` [Bug modula2/108121] " marxin at gcc dot gnu.org
  2022-12-15  9:14 ` marxin at gcc dot gnu.org
@ 2022-12-15  9:23 ` marxin at gcc dot gnu.org
  2022-12-20 14:26 ` jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-12-15  9:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
> gm2.log: FAIL: gm2/pim/pass/TestLong4.mod,  -g  

And this one fails due to UBSAN (signed integer overflow):

/dev/shm/objdir/gcc/gm2 -B/dev/shm/objdir2/gcc
/home/marxin/Programming/gcc/gcc/testsuite/gm2/pim/pass/TestLong4.mod -c
/home/marxin/Programming/gcc/gcc/m2/gm2-gcc/m2expr.cc:4037:13: runtime error:
signed integer overflow: 1717986918 + 429496730 cannot be represented in type
'int'
    #0 0x4db49f6 in append_m2_digit
/home/marxin/Programming/gcc/gcc/m2/gm2-gcc/m2expr.cc:4037
    #1 0x4db52c0 in m2expr_interpret_m2_integer
/home/marxin/Programming/gcc/gcc/m2/gm2-gcc/m2expr.cc:4106
    #2 0x4da403c in m2decl_DetermineSizeOfConstant
/home/marxin/Programming/gcc/gcc/m2/gm2-gcc/m2decl.cc:296
    #3 0x4f8879e in GetConstLitType(unsigned int, unsigned int)
(/dev/shm/objdir2/gcc/cc1gm2+0x4f8879e)
    #4 0x4f9d0e3 in SymbolTable_MakeConstLit
(/dev/shm/objdir2/gcc/cc1gm2+0x4f9d0e3)
    #5 0x4f633a8 in P2SymBuild_BuildNumber
(/dev/shm/objdir2/gcc/cc1gm2+0x4f633a8)
    #6 0x4fe4572 in Integer(unsigned int, unsigned int, unsigned int)
(/dev/shm/objdir2/gcc/cc1gm2+0x4fe4572)
    #7 0x4fe5076 in Number(unsigned int, unsigned int, unsigned int)
(/dev/shm/objdir2/gcc/cc1gm2+0x4fe5076)
    #8 0x4feea69 in Factor(unsigned int, unsigned int, unsigned int)
(/dev/shm/objdir2/gcc/cc1gm2+0x4feea69)

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

* [Bug modula2/108121] Failing tests on x86_64-linux-gnu
  2022-12-15  9:13 [Bug modula2/108121] New: Failing tests on x86_64-linux-gnu marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-12-15  9:23 ` marxin at gcc dot gnu.org
@ 2022-12-20 14:26 ` jakub at gcc dot gnu.org
  2023-01-15 13:22 ` gaius at gcc dot gnu.org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-12-20 14:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #2)
> > gm2.log: FAIL: gm2/pim/pass/TestLong4.mod,  -g  
> 
> And this one fails due to UBSAN (signed integer overflow):
> 
> /dev/shm/objdir/gcc/gm2 -B/dev/shm/objdir2/gcc
> /home/marxin/Programming/gcc/gcc/testsuite/gm2/pim/pass/TestLong4.mod -c
> /home/marxin/Programming/gcc/gcc/m2/gm2-gcc/m2expr.cc:4037:13: runtime
> error: signed integer overflow: 1717986918 + 429496730 cannot be represented
> in type 'int'
>     #0 0x4db49f6 in append_m2_digit
> /home/marxin/Programming/gcc/gcc/m2/gm2-gcc/m2expr.cc:4037
>     #1 0x4db52c0 in m2expr_interpret_m2_integer
> /home/marxin/Programming/gcc/gcc/m2/gm2-gcc/m2expr.cc:4106
>     #2 0x4da403c in m2decl_DetermineSizeOfConstant
> /home/marxin/Programming/gcc/gcc/m2/gm2-gcc/m2decl.cc:296
>     #3 0x4f8879e in GetConstLitType(unsigned int, unsigned int)
> (/dev/shm/objdir2/gcc/cc1gm2+0x4f8879e)
>     #4 0x4f9d0e3 in SymbolTable_MakeConstLit
> (/dev/shm/objdir2/gcc/cc1gm2+0x4f9d0e3)
>     #5 0x4f633a8 in P2SymBuild_BuildNumber
> (/dev/shm/objdir2/gcc/cc1gm2+0x4f633a8)
>     #6 0x4fe4572 in Integer(unsigned int, unsigned int, unsigned int)
> (/dev/shm/objdir2/gcc/cc1gm2+0x4fe4572)
>     #7 0x4fe5076 in Number(unsigned int, unsigned int, unsigned int)
> (/dev/shm/objdir2/gcc/cc1gm2+0x4fe5076)
>     #8 0x4feea69 in Factor(unsigned int, unsigned int, unsigned int)
> (/dev/shm/objdir2/gcc/cc1gm2+0x4feea69)

The integer overflow is just one thing and could be easily worked around with
performing the
  test_high = res_high + add_high;
addition in append_m2_digit in unsigned and test_high = res_high + add_high; in
append_digit in unsigned HOST_WIDE_INT type, like:
  test_high = (unsigned) res_high + add_high;
or so.
I must say I'm quite puzzled on the uses of INT_TYPE_SIZE in these functions
though,
I would have expected it would want instead HOST_BITS_PER_INT and
HOST_BITS_PER_WIDE_INT, as that is number of bits on the host that can fit, and
perhaps then depending on INT_TYPE_SIZE decide into which target type it fits.
But say if HOST_BITS_PER_WIDE_INT is larger than INT_TYPE_SIZE (pretty much
always), then I can't convince myself the routines will do the right thing.

That said, I think the error on the test happens much later, LONGCARD on x86_64
seems to be unsigned 64-bit type, so 9223372036854775808 constant certainly
fits there, but then:
#4  0x0000000001856de7 in make_int_cst (len=1, ext_len=1) at
../../gcc/tree.cc:2727
#5  0x000000000185268e in build_new_int_cst (type=<integer_type
0x7fffea15a540>, cst=...) at ../../gcc/tree.cc:1456
#6  0x0000000001852c9a in force_fit_type (type=<integer_type 0x7fffea15a540>,
cst=..., overflowable=1, overflowed=false) at ../../gcc/tree.cc:1570
#7  0x0000000000f13238 in fold_convert_const_int_from_int (type=<integer_type
0x7fffea15a540>, arg1=<integer_cst 0x7fffea12d9a0>) at
../../gcc/fold-const.cc:2045
#8  0x0000000000f151ec in fold_convert_const (code=NOP_EXPR, type=<integer_type
0x7fffea15a540>, arg1=<integer_cst 0x7fffea12d9a0>) at
../../gcc/fold-const.cc:2329
#9  0x0000000000f12418 in const_unop (code=NOP_EXPR, type=<integer_type
0x7fffea15a540>, arg0=<integer_cst 0x7fffea12d9a0>) at
../../gcc/fold-const.cc:1786
#10 0x0000000000f32cc1 in fold_unary_loc (loc=0, code=NOP_EXPR,
type=<integer_type 0x7fffea15a540>, op0=<integer_cst 0x7fffea12d9a0>) at
../../gcc/fold-const.cc:9322
#11 0x0000000000f482f6 in fold_build1_loc (loc=0, code=NOP_EXPR,
type=<integer_type 0x7fffea15a540>, op0=<integer_cst 0x7fffea12d9a0>) at
../../gcc/fold-const.cc:13767
#12 0x0000000000dad298 in convert_to_integer_1 (type=<integer_type
0x7fffea15a540>, expr=<integer_cst 0x7fffea12d9a0>, dofold=true) at
../../gcc/convert.cc:688
#13 0x0000000000dae8d9 in convert_to_integer (type=<integer_type
0x7fffea15a540>, expr=<integer_cst 0x7fffea12d9a0>) at ../../gcc/convert.cc:964
#14 0x0000000000b91f78 in convert_loc (location=2147483650, type=<integer_type
0x7fffea15a540>, expr=<integer_cst 0x7fffea12d9a0>) at
../../gcc/m2/gm2-lang.cc:735
#15 0x0000000000bba6e3 in convert_and_check (loc=2147483650, type=<integer_type
0x7fffea15a540>, expr=<integer_cst 0x7fffea12d9a0>) at
../../gcc/m2/gm2-gcc/m2convert.cc:316
#16 0x0000000000bbae25 in m2convert_BuildConvert (location=2147483650,
type=<integer_type 0x7fffea15a540>, value=<integer_cst 0x7fffea12d9a0>,
checkOverflow=1)
    at ../../gcc/m2/gm2-gcc/m2convert.cc:479
#17 0x0000000000bfde58 in TryDeclareConst (tokenno=1975, sym=1003) at
m2/gm2-compiler-boot/M2GCCDeclare.c:6875
#18 0x0000000000c0613f in M2GCCDeclare_TryDeclareConstant (tokenno=1975,
sym=1003) at m2/gm2-compiler-boot/M2GCCDeclare.c:11574
#19 0x0000000000c3ae9c in FoldAssignment (tokenno=1172, q=56, r=17) at
m2/gm2-compiler-boot/M2Range.c:1603
#20 0x0000000000c40bbb in M2Range_FoldRangeCheck (tokenno=1172, q=56, r=17) at
m2/gm2-compiler-boot/M2Range.c:4352
#21 0x0000000000c0774c in FoldRange (tokenno=1172, quad=56, rangeno=17) at
m2/gm2-compiler-boot/M2GenGCC.c:2225
#22 0x0000000000c1555d in M2GenGCC_ResolveConstantExpressions (p=..., start=53,
end=61) at m2/gm2-compiler-boot/M2GenGCC.c:8633
#23 0x0000000000bff0b2 in DeclareTypesConstantsProceduresInRange (start=53,
end=61) at m2/gm2-compiler-boot/M2GCCDeclare.c:7548
#24 0x0000000000c44347 in M2Scope_ForeachScopeBlockDo (sb=0x3fd37b0, p=...) at
m2/gm2-compiler-boot/M2Scope.c:660
#25 0x0000000000bff254 in DeclareTypesConstantsProcedures (scope=155) at
m2/gm2-compiler-boot/M2GCCDeclare.c:7631
#26 0x0000000000bff451 in StartDeclareModuleScopeSeparate (scope=155) at
m2/gm2-compiler-boot/M2GCCDeclare.c:7721
#27 0x0000000000bff65a in StartDeclareModuleScope (scope=155) at
m2/gm2-compiler-boot/M2GCCDeclare.c:7799
#28 0x0000000000c05e30 in M2GCCDeclare_StartDeclareScope (scope=155) at
m2/gm2-compiler-boot/M2GCCDeclare.c:11442
#29 0x0000000000bf70dd in DoModuleDeclare () at
m2/gm2-compiler-boot/M2Code.c:256
#30 0x0000000000bf7605 in M2Code_Code () at m2/gm2-compiler-boot/M2Code.c:470
#31 0x0000000000bf7a00 in Compile (s=0x3f20230) at
m2/gm2-compiler-boot/M2Comp.c:211
#32 0x0000000000bf86a1 in M2Comp_compile (filename=0x7fffffffe1b6) at
m2/gm2-compiler-boot/M2Comp.c:760
converts it into signed 64-bit type and so it becomes
-9223372036854775808 and later on FoldAssignment decides it is out of range and
reports:
1608              /* avoid gcc warning by using compound statement even if not
strictly necessary.  */
1609              if (OutOfRange (tokenno, min, p->expr, max,
p->desLowestType))
1610                {
1611                  M2MetaError_MetaErrorT2 (p->tokenNo, (const char *)
"attempting to assign a value {%2Wa} to a designator {%1a} which will exceed
the range of type {%1tad}", 101, p->des, p->expr);
1612                  M2Quads_PutQuad (q, M2Quads_ErrorOp, SymbolTable_NulSym,
SymbolTable_NulSym, r);
1613                }

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

* [Bug modula2/108121] Failing tests on x86_64-linux-gnu
  2022-12-15  9:13 [Bug modula2/108121] New: Failing tests on x86_64-linux-gnu marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-12-20 14:26 ` jakub at gcc dot gnu.org
@ 2023-01-15 13:22 ` gaius at gcc dot gnu.org
  2023-01-15 13:28 ` gaius at gcc dot gnu.org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-01-15 13:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Gaius Mulley <gaius at gcc dot gnu.org> ---
I believe the bug exposed by arraybool.mod has been fixed.
M2Quads BuildNot resulted in an uninitialized tokenpos.

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

* [Bug modula2/108121] Failing tests on x86_64-linux-gnu
  2022-12-15  9:13 [Bug modula2/108121] New: Failing tests on x86_64-linux-gnu marxin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-01-15 13:22 ` gaius at gcc dot gnu.org
@ 2023-01-15 13:28 ` gaius at gcc dot gnu.org
  2023-04-26  0:28 ` gaius at gcc dot gnu.org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-01-15 13:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 54274
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54274&action=edit
Bugfix for arraybool

For what it is worth here is the bugfix for the bug exposed by arraybool.mod.

Bootstrapped on x86_64 and ppcle64

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

* [Bug modula2/108121] Failing tests on x86_64-linux-gnu
  2022-12-15  9:13 [Bug modula2/108121] New: Failing tests on x86_64-linux-gnu marxin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-01-15 13:28 ` gaius at gcc dot gnu.org
@ 2023-04-26  0:28 ` gaius at gcc dot gnu.org
  2023-04-26  1:24 ` gaius at gcc dot gnu.org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-04-26  0:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 54920
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54920&action=edit
Proposed fix for TestLong4.mod (ZTYPE fix)

Here is a proposed patch to allow testLong4.mod to compile without warning.
The ZTYPE is changed to int128 (or int64) if int128 is unavailable and
constant literals are built from widest_int.  The widest_int is converted into
the tree type and checked for overflow.

m2expr_interpret_integer and append_m2_digit are removed.

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

* [Bug modula2/108121] Failing tests on x86_64-linux-gnu
  2022-12-15  9:13 [Bug modula2/108121] New: Failing tests on x86_64-linux-gnu marxin at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-04-26  0:28 ` gaius at gcc dot gnu.org
@ 2023-04-26  1:24 ` gaius at gcc dot gnu.org
  2023-04-26  1:57 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-04-26  1:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #7 from Gaius Mulley <gaius at gcc dot gnu.org> ---
I've bootstrapped the previous patch on the master branch (gcc-14) on x86_64
and aarch64.  Bootstrapping is continuing on armv7l and ppc64le.  All tests now
pass on x86_64 and aarch64 (gcc-14).

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

* [Bug modula2/108121] Failing tests on x86_64-linux-gnu
  2022-12-15  9:13 [Bug modula2/108121] New: Failing tests on x86_64-linux-gnu marxin at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-04-26  1:24 ` gaius at gcc dot gnu.org
@ 2023-04-26  1:57 ` cvs-commit at gcc dot gnu.org
  2023-04-26  6:57 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-26  1:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS 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:68201409bc2867da45791331e385198826fa4576

commit r14-232-g68201409bc2867da45791331e385198826fa4576
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Wed Apr 26 02:55:59 2023 +0100

    PR modula2/108121 Re-implement overflow detection for constant literals

    This patch fixes the overflow detection for constant literals.
    The ZTYPE is changed to int128 (or int64) if int128 is unavailable and
    constant literals are built from widest_int.  The widest_int is converted
    into the tree type and checked for overflow.
    m2expr_interpret_integer and append_m2_digit are removed.

    gcc/m2/ChangeLog:

            PR modula2/108121
            * gm2-compiler/M2ALU.mod (Less): Reformatted.
            * gm2-compiler/SymbolTable.mod (DetermineSizeOfConstant): Remove
            from import.
            (ConstantStringExceedsZType): Import.
            (GetConstLitType): Re-implement using ConstantStringExceedsZType.
            * gm2-gcc/m2decl.cc (m2decl_DetermineSizeOfConstant): Remove.
            (m2decl_ConstantStringExceedsZType): New function.
            (m2decl_BuildConstLiteralNumber): Re-implement.
            * gm2-gcc/m2decl.def (DetermineSizeOfConstant): Remove.
            (ConstantStringExceedsZType): New function.
            * gm2-gcc/m2decl.h (m2decl_DetermineSizeOfConstant): Remove.
            (m2decl_ConstantStringExceedsZType): New function.
            * gm2-gcc/m2expr.cc (append_digit): Remove.
            (m2expr_interpret_integer): Remove.
            (append_m2_digit): Remove.
            (m2expr_StrToWideInt): New function.
            (m2expr_interpret_m2_integer): Remove.
            * gm2-gcc/m2expr.def (CheckConstStrZtypeRange): New function.
            * gm2-gcc/m2expr.h (m2expr_StrToWideInt): New function.
            * gm2-gcc/m2type.cc (build_m2_word64_type_node): New function.
            (build_m2_ztype_node): New function.
            (m2type_InitBaseTypes): Call build_m2_ztype_node.
            * gm2-lang.cc (gm2_type_for_size): Re-write using early returns.

    gcc/testsuite/ChangeLog:

            PR modula2/108121
            * gm2/pim/fail/largeconst.mod: Increased constant value test
            to fail now that cc1gm2 uses widest_int to represent a ZTYPE.
            * gm2/pim/fail/largeconst2.mod: New test.

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

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

* [Bug modula2/108121] Failing tests on x86_64-linux-gnu
  2022-12-15  9:13 [Bug modula2/108121] New: Failing tests on x86_64-linux-gnu marxin at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-04-26  1:57 ` cvs-commit at gcc dot gnu.org
@ 2023-04-26  6:57 ` rguenth at gcc dot gnu.org
  2023-07-27  9:24 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-26  6:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|13.0                        |13.2

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 13.1 is being released, retargeting bugs to GCC 13.2.

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

* [Bug modula2/108121] Failing tests on x86_64-linux-gnu
  2022-12-15  9:13 [Bug modula2/108121] New: Failing tests on x86_64-linux-gnu marxin at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2023-04-26  6:57 ` rguenth at gcc dot gnu.org
@ 2023-07-27  9:24 ` rguenth at gcc dot gnu.org
  2023-07-28  2:10 ` cvs-commit at gcc dot gnu.org
  2023-07-28  2:28 ` gaius at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-27  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|13.2                        |13.3

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 13.2 is being released, retargeting bugs to GCC 13.3.

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

* [Bug modula2/108121] Failing tests on x86_64-linux-gnu
  2022-12-15  9:13 [Bug modula2/108121] New: Failing tests on x86_64-linux-gnu marxin at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2023-07-27  9:24 ` rguenth at gcc dot gnu.org
@ 2023-07-28  2:10 ` cvs-commit at gcc dot gnu.org
  2023-07-28  2:28 ` gaius at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-07-28  2:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Gaius Mulley
<gaius@gcc.gnu.org>:

https://gcc.gnu.org/g:50fc6ce0cb8edf927ae6117a5484e4d8d52e393e

commit r13-7619-g50fc6ce0cb8edf927ae6117a5484e4d8d52e393e
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Fri Jul 28 03:10:01 2023 +0100

    PR modula2/108121 Re-implement overflow detection for constant literals

    This patch fixes the overflow detection for constant literals.
    The ZTYPE is changed to int128 (or int64) if int128 is unavailable and
    constant literals are built from widest_int.  The widest_int is converted
    into the tree type and checked for overflow.
    m2expr_interpret_integer and append_m2_digit are removed.

    gcc/m2/ChangeLog:

            PR modula2/108121
            * gm2-compiler/M2ALU.mod (Less): Reformatted.
            * gm2-compiler/SymbolTable.mod (DetermineSizeOfConstant): Remove
            from import.
            (ConstantStringExceedsZType): Import.
            (GetConstLitType): Re-implement using ConstantStringExceedsZType.
            * gm2-gcc/m2decl.cc (m2decl_DetermineSizeOfConstant): Remove.
            (m2decl_ConstantStringExceedsZType): New function.
            (m2decl_BuildConstLiteralNumber): Re-implement.
            * gm2-gcc/m2decl.def (DetermineSizeOfConstant): Remove.
            (ConstantStringExceedsZType): New function.
            * gm2-gcc/m2decl.h (m2decl_DetermineSizeOfConstant): Remove.
            (m2decl_ConstantStringExceedsZType): New function.
            * gm2-gcc/m2expr.cc (append_digit): Remove.
            (m2expr_interpret_integer): Remove.
            (append_m2_digit): Remove.
            (m2expr_StrToWideInt): New function.
            (m2expr_interpret_m2_integer): Remove.
            * gm2-gcc/m2expr.def (CheckConstStrZtypeRange): New function.
            * gm2-gcc/m2expr.h (m2expr_StrToWideInt): New function.
            * gm2-gcc/m2type.cc (build_m2_word64_type_node): New function.
            (build_m2_ztype_node): New function.
            (m2type_InitBaseTypes): Call build_m2_ztype_node.
            * gm2-lang.cc (gm2_type_for_size): Re-write using early returns.

    gcc/testsuite/ChangeLog:

            PR modula2/108121
            * gm2/pim/fail/largeconst.mod: Increased constant value test
            to fail now that cc1gm2 uses widest_int to represent a ZTYPE.
            * gm2/pim/fail/largeconst2.mod: New test.

    (cherry picked from commit 68201409bc2867da45791331e385198826fa4576)

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

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

* [Bug modula2/108121] Failing tests on x86_64-linux-gnu
  2022-12-15  9:13 [Bug modula2/108121] New: Failing tests on x86_64-linux-gnu marxin at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2023-07-28  2:10 ` cvs-commit at gcc dot gnu.org
@ 2023-07-28  2:28 ` gaius at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-07-28  2:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #12 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Closing now that the patch has been applied on the gcc-13 branch.

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

end of thread, other threads:[~2023-07-28  2:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-15  9:13 [Bug modula2/108121] New: Failing tests on x86_64-linux-gnu marxin at gcc dot gnu.org
2022-12-15  9:14 ` [Bug modula2/108121] " marxin at gcc dot gnu.org
2022-12-15  9:14 ` marxin at gcc dot gnu.org
2022-12-15  9:23 ` marxin at gcc dot gnu.org
2022-12-20 14:26 ` jakub at gcc dot gnu.org
2023-01-15 13:22 ` gaius at gcc dot gnu.org
2023-01-15 13:28 ` gaius at gcc dot gnu.org
2023-04-26  0:28 ` gaius at gcc dot gnu.org
2023-04-26  1:24 ` gaius at gcc dot gnu.org
2023-04-26  1:57 ` cvs-commit at gcc dot gnu.org
2023-04-26  6:57 ` rguenth at gcc dot gnu.org
2023-07-27  9:24 ` rguenth at gcc dot gnu.org
2023-07-28  2:10 ` cvs-commit at gcc dot gnu.org
2023-07-28  2:28 ` 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).