Re: gcc-4.9.1 generating different code between two successive builds

2015-12-31 Thread Cole
I will investigate next week, and have a look at whether ASLR is turned off in our build system. But if it was on, I would expect more than a single .o file to be different. At this point in time, by disabling libcilkrts, and one other option, I can't remember which right now, I can get gcc buildi

Re: Strange C++ function pointer test

2015-12-31 Thread Jonathan Wakely
On 31 December 2015 at 13:09, Dominik Vogt wrote: > On Thu, Dec 31, 2015 at 12:42:56PM +, Jonathan Wakely wrote: >> On 31 December 2015 at 11:54, Dominik Vogt wrote: >> > Is there a requirement for a certain minimum Glibc version for >> > this to work? >> >> It doesn't work with any glibc, bec

Re: Strange C++ function pointer test

2015-12-31 Thread Dominik Vogt
On Thu, Dec 31, 2015 at 12:42:56PM +, Jonathan Wakely wrote: > On 31 December 2015 at 11:54, Dominik Vogt wrote: > > Is there a requirement for a certain minimum Glibc version for > > this to work? > > It doesn't work with any glibc, because it doesn't declare the C++ overloads. All right, so

Re: Strange C++ function pointer test

2015-12-31 Thread Jonathan Wakely
On 31 December 2015 at 11:54, Dominik Vogt wrote: > Is there a requirement for a certain minimum Glibc version for > this to work? It doesn't work with any glibc, because it doesn't declare the C++ overloads. Libstdc++ has an include/c_compatibility/math.h header that would include (which declar

Re: Strange C++ function pointer test

2015-12-31 Thread Jonathan Wakely
On 31 December 2015 at 11:37, Marc Glisse wrote: > That's what I called "bug" in my message (there are a few bugzilla PRs for > this). It would probably work on Solaris. Yes, the case is still a mess in the standard and in glibc. The "only in namespace std in the second case" part is what I meant

Re: Strange C++ function pointer test

2015-12-31 Thread Jonathan Wakely
On 31 December 2015 at 11:34, Dominik Vogt wrote: > On Thu, Dec 31, 2015 at 10:11:55AM +, Jonathan Wakely wrote: >> is required to declare std::abs and it's unspecified whether >> it also declares it as ::abs. >> >> is required to declare ::abs and it's unspecified whether it >> also declares

Re: Strange C++ function pointer test

2015-12-31 Thread Dominik Vogt
On Thu, Dec 31, 2015 at 12:45:06PM +0100, Marc Glisse wrote: > On Thu, 31 Dec 2015, Dominik Vogt wrote: > > >The minimal failing program is > > > >-- abs.C -- > >#include > >static float (*p1_)(float) = abs; > >-- abs.C -- > > This is allowed to fail. If you include math.h (in addition or > inst

Re: Strange C++ function pointer test

2015-12-31 Thread Marc Glisse
On Thu, 31 Dec 2015, Dominik Vogt wrote: The minimal failing program is -- abs.C -- #include static float (*p1_)(float) = abs; -- abs.C -- This is allowed to fail. If you include math.h (in addition or instead of stdlib.h), it has to work (gcc bug if it doesn't). See also http://www.open-

Re: Strange C++ function pointer test

2015-12-31 Thread Marc Glisse
On Thu, 31 Dec 2015, Jonathan Wakely wrote: There are other overloads of 'abs' declared in math.h / cmath (only in namespace std in the second case, and there are bugs (or standard issues) about having them in the global namespace for the first one). That's not quite accurate, C++11 was altere

Re: Strange C++ function pointer test

2015-12-31 Thread Dominik Vogt
On Thu, Dec 31, 2015 at 10:11:55AM +, Jonathan Wakely wrote: > On 31 December 2015 at 09:57, Marc Glisse wrote: > > On Thu, 31 Dec 2015, Dominik Vogt wrote: > > > >> This snippet ist from the Plumhall 2014 xvs test suite: > >> > >> #if CXX03 || CXX11 || CXX14 > >> static float (*p1_)(float) =

Re: gcc-4.9.1 generating different code between two successive builds

2015-12-31 Thread Andrew Haley
On 30/12/15 15:33, Georg-Johann Lay wrote: > Some parts of the compiler use the address of objects to compute > hashes, but I don't remember which part(s) actually do this. That > technique can lead to different code for different runs of the > compiler even on the same system. This is hard to r

Re: Strange C++ function pointer test

2015-12-31 Thread Jonathan Wakely
On 31 December 2015 at 09:57, Marc Glisse wrote: > On Thu, 31 Dec 2015, Dominik Vogt wrote: > >> This snippet ist from the Plumhall 2014 xvs test suite: >> >> #if CXX03 || CXX11 || CXX14 >> static float (*p1_)(float) = abs; >> ... >> checkthat(__LINE__, p1_ != 0); >> #endif >> >> (With the tes

Re: Strange C++ function pointer test

2015-12-31 Thread Jonathan Wakely
On 31 December 2015 at 09:57, Jakub Jelinek wrote: > On Thu, Dec 31, 2015 at 10:49:18AM +0100, Dominik Vogt wrote: >> This snippet ist from the Plumhall 2014 xvs test suite: >> >> #if CXX03 || CXX11 || CXX14 >> static float (*p1_)(float) = abs; >> ... >> checkthat(__LINE__, p1_ != 0); >>

Re: Strange C++ function pointer test

2015-12-31 Thread Marc Glisse
On Thu, 31 Dec 2015, Dominik Vogt wrote: This snippet ist from the Plumhall 2014 xvs test suite: #if CXX03 || CXX11 || CXX14 static float (*p1_)(float) = abs; ... checkthat(__LINE__, p1_ != 0); #endif (With the testsuite specific macros doing the obvious). abs() is declared as: int abs

Re: Strange C++ function pointer test

2015-12-31 Thread Jakub Jelinek
On Thu, Dec 31, 2015 at 10:49:18AM +0100, Dominik Vogt wrote: > This snippet ist from the Plumhall 2014 xvs test suite: > > #if CXX03 || CXX11 || CXX14 > static float (*p1_)(float) = abs; > ... > checkthat(__LINE__, p1_ != 0); > #endif > > (With the testsuite specific macros doing the

Strange C++ function pointer test

2015-12-31 Thread Dominik Vogt
This snippet ist from the Plumhall 2014 xvs test suite: #if CXX03 || CXX11 || CXX14 static float (*p1_)(float) = abs; ... checkthat(__LINE__, p1_ != 0); #endif (With the testsuite specific macros doing the obvious). abs() is declared as: int abs(int j) Am I missing some odd C++ f