This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add experimental::sample and experimental::shuffle from N4531


On Wed, 4 Jul 2018 at 18:56, Jonathan Wakely <jwakely@redhat.com> wrote:
>
> On 29/06/18 10:45 +0100, Jonathan Wakely wrote:
> >On 29/06/18 09:39 +0200, Christophe Lyon wrote:
> >>On Fri, 29 Jun 2018 at 09:21, Jonathan Wakely <jwakely@redhat.com> wrote:
> >>>
> >>>On 29/06/18 08:55 +0200, Christophe Lyon wrote:
> >>>>On Mon, 25 Jun 2018 at 18:23, Jonathan Wakely <jwakely@redhat.com> wrote:
> >>>>>
> >>>>> The additions to <experimental/random> were added in 2015 but the new
> >>>>> algorithms in <experimental/algorithm> were not. This adds them.
> >>>>>
> >>>>>         * include/experimental/algorithm (sample, shuffle): Add new overloads
> >>>>>         using per-thread random number engine.
> >>>>>         * testsuite/experimental/algorithm/sample.cc: Simpify and reduce
> >>>>>         dependencies by using __gnu_test::test_container.
> >>>>>         * testsuite/experimental/algorithm/sample-2.cc: New.
> >>>>>         * testsuite/experimental/algorithm/shuffle.cc: New.
> >>>>>
> >>>>> Tested x86_64-linux, committed to trunk.
> >>>>>
> >>>>> This would be safe to backport, but nobody has noticed the algos are
> >>>>> missing or complained, so it doesn't seem very important to backport.
> >>>>>
> >>>>>
> >>>>
> >>>>Hi,
> >>>>
> >>>>On bare-metal targets (aarch64 and arm + newlib), I've noticed that
> >>>>the two new tests fail:
> >>>>PASS: experimental/algorithm/shuffle.cc (test for excess errors)
> >>>>spawn /aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/utils/bin/qemu-wrapper.sh
> >>>>./shuffle.exe
> >>>>terminate called after throwing an instance of 'std::runtime_error'
> >>>>  what():  random_device::random_device(const std::string&)
> >>>>
> >>>>*** EXIT code 4242
> >>>>FAIL: experimental/algorithm/shuffle.cc execution test
> >>>>
> >>>>PASS: experimental/algorithm/sample-2.cc (test for excess errors)
> >>>>spawn /aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/utils/bin/qemu-wrapper.sh
> >>>>./sample-2.exe
> >>>>terminate called after throwing an instance of 'std::runtime_error'
> >>>>  what():  random_device::random_device(const std::string&)
> >>>>
> >>>>*** EXIT code 4242
> >>>>FAIL: experimental/algorithm/sample-2.cc execution test
> >>>>
> >>>>Does this ring a bell?
> >>>
> >>>Does the existing testsuite/experimental/random/randint.cc file fail
> >>>in the same way?
> >>>
> >>
> >>Yes it does.
> >>
> >>And so do:
> >>25_algorithms/make_heap/complexity.cc
> >
> >This one also uses std::random_device.
> >
> >>23_containers/array/element_access/at_neg.cc
> >
> >Hmm,
> >
> > // Expected behavior is to either throw and have the uncaught
> > // exception end up in a terminate handler which eventually exits,
> > // or abort. (Depending on -fno-exceptions.)
> >
> >So this is expected to XFAIL.
> >
> >>26_numerics/random/random_device/cons/default.cc
> >
> >We should XFAIL the ones that use std::random_device, if we can
> >identify an effective target to describe them.
>
> This adds a new "random_device" effective-target, so the tests are
> disabled when the random_device isn't usable.
>
> Tested powerpc64le-linux, committed to trunk. If this works for
> Christophe's bare metal targets I'll backport it to gcc-8-branch too.
>
Yes, that works for me: the tests are now UNSUPPORTED on aarch64*-elf
and arm-none-eabi.

Thanks!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]