- Subject: Re: [slang-users] slang 2.3.2 build problem by GCC v8 on Linux/i586
- From: Alastair McKinstry <alastair.mckinstry@xxxxxxxx>
- Date: Wed, 17 Apr 2019 10:00:26 +0100
On 07/04/2019 20:12, John E. Davis wrote:
Sergey <a_s_y@xxxxxxx> wrote:
I attempt to build slang 2.3.2 by GCC v8 on Linux/i586. Building is
fine but some tests isn't passed:
...
Testing array functions ...Unable to create a multi-dimensional array of the desired size
./array.sl:166:<top-level>:Invalid Parameter
Testing array functions [UTF-8 mode] ...Unable to create a multi-dimensional array of the desired size
./array.sl:166:<top-level>:Invalid Parameter
...
It seems like an optimizer bug. Does this patch to slarray.c help?
--- slarray.c~ 2018-03-04 14:25:32.339928982 -0500
+++ slarray.c 2019-04-07 15:07:07.125037903 -0400
@@ -369,7 +369,9 @@
SLindex_Type new_num_elements;
at->dims[i] = dims[i];
new_num_elements = dims[i] * num_elements;
- if (dims[i] && (new_num_elements/dims[i] != num_elements))
+ if (dims[i]
+ && ((new_num_elements/dims[i] != num_elements)
+ || (new_num_elements < 0)))
{
throw_size_error (SL_Index_Error);
free_array (at);
Thanks,
--John
To note: Yes, I've tested on gcc-9 on i386.
(1) The bug is still present in the optimiser and -O0 is needed;
(2) The patch presented above works (no -O0 needed).
regards
Alastair
_______________________________________________
For list information, visit <http://jedsoft.org/slang/mailinglists.html>.
--
Alastair McKinstry, email: alastair@xxxxxxxx, matrix: @alastair:sceal.ie
Commander Vimes didn’t like the phrase “The innocent have nothing to fear,”
believing the innocent had everything to fear, mostly from the guilty but in the longer term
even more from those who say things like “The innocent have nothing to fear.”
- T. Pratchett, Snuff
[2019 date index]
[2019 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]