[PATCH] Use proper location for tls_init function (PR c++/88263).
Rainer Orth
ro@CeBiTec.Uni-Bielefeld.DE
Wed Jan 2 12:41:00 GMT 2019
Hi Martin,
> The PR is about a function (__tls_init) that ends before it begins
> (from line point of view). The patch uses location of a variable where
> we first create the function declaration. I'm not much familiar with C++ FE,
> but it works.
>
> Survives bootstrap and regression test on ppc64le-linux-gnu.
>
> Ready for trunk?
> Thanks,
> Martin
>
> gcc/cp/ChangeLog:
>
> 2018-11-30 Martin Liska <mliska@suse.cz>
>
> PR c++/88263
> * decl2.c (get_local_tls_init_fn): Add location_t argument and
> use it.
> (get_tls_init_fn): Call it with location of variable for which
> we'll need to create tls_init function.
> (handle_tls_init): Likewise.
>
> gcc/testsuite/ChangeLog:
>
> 2018-11-30 Martin Liska <mliska@suse.cz>
>
> * g++.dg/gcov/pr88263.C: New test.
the new testcase FAILs on Solaris:
+FAIL: g++.dg/gcov/pr88263.C (test for excess errors)
Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/gcov/pr88263.C:7:11: error: 'namespace log { }' conflicts with a previous declaration
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/gcov/pr88263.C:19:11: error: 'namespace log { }' conflicts with a previous declaration
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/gcov/pr88263.C:21:33: error: 'Logstream' has not been declared
/var/gcc/regression/trunk/11.5-gcc/build/gcc/include-fixed/iso/math_iso.h:69:15: note: previous declaration 'namespace std { }::log'
+UNRESOLVED: g++.dg/gcov/pr88263.C compilation failed to produce executable
+FAIL: g++.dg/gcov/pr88263.C gcov failed: pr88263.C.gcov does not exist
<iso/math_iso.h> has
namespace std {
extern double log __P((double));
extern "C++" {
inline float log(float __X) { return __logf(__X); }
inline long double log(long double __X) { return __logl(__X); }
}
}
Fixed by renaming namespace log to logging to avoid the clash. Tested
on i386-pc-solaris2.11, sparc-sun-solaris2.11, and x86_64-pc-linux-gnu.
Installed no mainline.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2018-12-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* g++.dg/gcov/pr88263.C: Rename namespace log to logging.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sol2-pr88263.patch
Type: text/x-patch
Size: 526 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190102/8b96ec65/attachment.bin>
More information about the Gcc-patches
mailing list