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

--- Comment #7 from Jozef Lawrynowicz <jozef.l at mittosystems dot com> ---
(In reply to Jonathan Wakely from comment #6)
> This should be fixed now.
> 
> If you're able to run the tests for these components that would be very much
> appreciated. To run just the <memory_resource> tests, run the following in
> the $objdir/$target/libstdc++-v3 directory:
> 
> make check RUNTESTFLAGS=conformance.exp=20_util/*_resource/*
Most of the memory_resource tests are too large for the default MSP430
configuration and fail at link time due to memory region overflows.

> PASS: 20_util/memory_resource/1.cc (test for excess errors)
> PASS: 20_util/monotonic_buffer_resource/1.cc (test for excess errors)
> 
>    === libstdc++ Summary ===
> 
> # of expected passes    2
> # of unexpected failures  11
> # of unresolved testcases 11
> # of unsupported tests    5
Running the tests with -mlarge doesn't currently work, as testsuite_abi.cc
won't compile. Since size_t is __int20, instances of "cout << (size_t)" cause
an error: 

> util/testsuite_abi.cc:501: error: ambiguous overload for 'operator<<' in 
> 'std::cout.std::basic_ostream<char>::operator<<(std::endl<char, 
> std::char_traits<char> >) << 
> added_names.std::vector<std::__cxx11::basic_string<char> >::size()' (operand 
> types are 'std::basic_ostream<char>::__ostream_type' {aka 
> 'std::basic_ostream<char>'} and 'std::vector<std::__cxx11::basic_string<char> 
> >::size_type' {aka '__int20 unsigned'})
A quick hack (attached) of casting usage of size_t with cout to (unsigned long)
gets testsuite_abi.cc building so the tests can be run.
The -mlarge/-mcode-region=either/-mdata-region=either configuration makes the
best use of the 20-bit address space, so most of the tests do actually link and
pass now.

> make check RUNTESTFLAGS="conformance.exp=20_util/*_resource/* 
> --target_board=msp430-sim/-mlarge/-mdata-region=either/-mcode-region=either"

>                 === libstdc++ Summary ===
> 
> # of expected passes            21
> # of unexpected failures        3
> # of unsupported tests          5
One failure is at compile time, due to a couple of warnings in
allocate-max-chunks.cc. This is also present in the default configuration, but
obscured among all the relocation overflows.

> Excess errors:
> libstdc++-v3/testsuite/20_util/unsynchronized_pool_resource/allocate-max-chunks.cc:39:
>  warning: integer overflow in expression of type 'int' results in '0' 
> [-Woverflow]
> libstdc++-v3/testsuite/20_util/unsynchronized_pool_resource/allocate-max-chunks.cc:67:
>  warning: left shift count >= width of type [-Wshift-count-overflow]
The allocate-max-chunks execution tests subsequently fails:

> unsynchronized_pool_resource/allocate-max-chunks.cc:67: void test01(): 
> Assertion 'opts.max_blocks_per_chunk <= (1 << 19)' failed.
The third and final failure is at execution:

> terminate called after throwing an instance of 'std::bad_alloc'
>   what():  std::bad_alloc
> FAIL: 20_util/unsynchronized_pool_resource/allocate.cc execution test
I've seen many "terminate called after..." failures in the G++ testsuite being
caused by stack overrunning into heap, so I'm not sure at this point if this is
a real failure.

Testsuite .log is attached.

Should I file separate PRs for these errors?
I'll look at the "cout << (__int20)" issue a bit more as well.

Reply via email to