Build of 10.0.1.s20200126 fails as shown below. System compiler is FreeBSD clang version 9.0.1, x86_64-unknown-freebsd12.1. Previous snapshot had failed similarly but 10.0.0.s20200105 completed ok. I didn't try those in between. c++ -fno-PIE -c -O2 -pipe -march=sandybridge -DLIBICONV_PLUG -DIN_GCC -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -fno-common -DHAVE_CONFIG_H -I. -Ianalyzer -I/usr/ports/lang/gcc10-devel/work/gcc-10-20200126/gcc -I/usr/ports/lang/gcc10-devel/work/gcc-10-20200126/gcc/analyzer -I/usr/ports/lang/gcc10-devel/work/gcc-10-20200126/gcc/../include -I/usr/ports/lang/gcc10-devel/work/gcc-10-20200126/gcc/../libcpp/include -I/usr/local/include -I/usr/ports/lang/gcc10-devel/work/gcc-10-20200126/gcc/../libdecnumber -I/usr/ports/lang/gcc10-devel/work/gcc-10-20200126/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/ports/lang/gcc10-devel/work/gcc-10-20200126/gcc/../libbacktrace -DLIBICONV_PLUG -o analyzer/engine.o -MT analyzer/engine.o -MMD -MP -MF analyzer/.deps/engine.TPo /usr/ports/lang/gcc10-devel/work/gcc-10-20200126/gcc/analyzer/engine.cc [... multiple warnings ...] /usr/ports/lang/gcc10-devel/work/gcc-10-20200126/gcc/analyzer/engine.cc:2971:13: error: reinterpret_cast from 'nullptr_t' to 'function *' is not allowed v.m_fun = reinterpret_cast<function *> (NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/ports/lang/gcc10-devel/work/gcc-10-20200126/gcc/analyzer/engine.cc:2983:21: error: reinterpret_cast from 'nullptr_t' to 'function *' is not allowed return v.m_fun == reinterpret_cast<function *> (NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Would you mind reporting such issues upstream, cf. https://gcc.gnu.org/bugs/ ? gcc10-devel tracks upstream HEAD, the equivalent of -CURRENT in FreeBSD, so it is quite likely to be broken somewhat regularly. I am test building both on a daily base and when updating the port, but as we have seen here there is always some configuration that may escape. On this one I reached out to who I believe is the upstream author of the code in question and hope he'll look into it.
Created attachment 211143 [details] Proposed patch Can you please test the attached patch? (Put the attached file into lang/gcc10/files in your ports tree and try building lang/gcc10 with that.)
The patch allows the build to complete.
A commit references this bug: Author: gerald Date: Thu Jan 30 20:48:54 UTC 2020 New revision: 524659 URL: https://svnweb.freebsd.org/changeset/ports/524659 Log: Fix a build failure in the new analyzer module that was reported with clang 9.0.1 (only): ports/lang/gcc10-devel/work/gcc-10-20200126/gcc/analyzer/engine.cc:2971:13: error: reinterpret_cast from 'nullptr_t' to 'function *' is not allowed v.m_fun = reinterpret_cast<function *> (NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PR: 243681 Reported by: Philippe Michel <philippe.michel7@free.fr> Changes: head/lang/gcc10-devel/files/patch-analyzer
Thanks for verifying the patch! I have applied this locally for the time being and will keep an eye on it getting upstream (or a different fix being applied there).
To make sure this gets into the GCC 10.1 release I filed an upstream bug to track the issue and (proposed) fix: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93543
There's a new patch at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93543 Can you please give that a try?
I see that they have already settled the matter but, anyway, the patch from gcc.gnu.org works for me as well.
Cool, thank you for the confirmation, Philippe! We should then receive this fix with the next snapshot (due to be created upstream next Sunday), at which point I'll remove the local patch we are carrying for now.