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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

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

--- Comment #10 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Created attachment 37181
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37181&action=edit
simplified, instrumented test case

The problem happens in passing the array bounds.

The somewhat simplified (integer only) and instrumented test case shows the
following output:

 Sorting ...
 array on input
    5     1     4     3     2  
 array after pretreatment
    2     1     3     4     5  
 array recursively passed to quicksort
    2     1     3  
 array on input
    1     3     4  

.... and this is off by one. The array slice passed should be
[ 2 1 3] and ends up as [1 3 4] in the called subroutine.

Well, I'm off to bed.  I'm sure this can be simplified further.



 array after pretreatment
    1     3     4  
 array on input
    1     3  
 array after pretreatment
    1     3

Reply via email to