[testsuite] Fix gcc.dg/tree-prof/val-profiler-threads-1.c
Eric Botcazou
ebotcazou@adacore.com
Wed Jun 28 07:51:00 GMT 2017
The manual says that the type of the 2nd argument of pthread_join is void **.
Now gcc.dg/tree-prof/val-profiler-threads-1.c does this:
int retval;
for(t=0;t<NUM_THREADS;t++)
pthread_join (threads[t], (void**)&retval);
which means a potential buffer overflow on LP64 targets in addition to an
alignment issue if the target is strict-alignment, for example SPARC 64-bit.
Tested on SPARC64/Linux, applied on the mainline and 7 branch as obvious.
2017-06-28 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/tree-prof/val-profiler-threads-1.c (main): Fix 2nd argument
passed to pthread_join.
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 498 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170628/f5e4b0e8/attachment.bin>
More information about the Gcc-patches
mailing list