On Fri, 2016-08-05 15:43:02 +0200, Martin Liška wrote: [...] > Great, attaching install candidate. > >From 0b3ac8636ef34b02e301f22c86dde0602f9969ef Mon Sep 17 00:00:00 2001 > From: marxin > Date: Thu, 28 Jul 2016 14:32:47 +0200 > Subject: [PATCH 1/4] Cherry-pick fprofile-generate-atomic from google/gcc-4_9 > branch > > gcc/ChangeLog: > > 2016-08-05 Martin Liska > > Cherry picked (and modified) from google-4_7 branch > 2012-12-26 Rong Xu > * common.opt (fprofile-update): Add new flag. > * coretypes.h: Define enum profile_update. > * doc/invoke.texi: Document -fprofile-update. > * gcov-io.h: Declare GCOV_TYPE_ATOMIC_FETCH_ADD and > GCOV_TYPE_ATOMIC_FETCH_ADD_FN. > * tree-profile.c (gimple_init_edge_profiler): Generate > also atomic profiler update. > (gimple_gen_edge_profiler): Likewise. [...] > --- a/gcc/gcov-io.h > +++ b/gcc/gcov-io.h > @@ -164,6 +164,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see > #ifndef GCC_GCOV_IO_H > #define GCC_GCOV_IO_H > > +#if LONG_LONG_TYPE_SIZE > 32 > +#define GCOV_TYPE_ATOMIC_FETCH_ADD_FN __atomic_fetch_add_8 > +#define GCOV_TYPE_ATOMIC_FETCH_ADD BUILT_IN_ATOMIC_FETCH_ADD_8 > +#else > +#define GCOV_TYPE_ATOMIC_FETCH_ADD_FN __atomic_fetch_add_4 > +#define GCOV_TYPE_ATOMIC_FETCH_ADD BUILT_IN_ATOMIC_FETCH_ADD_4 > +#endif > + > #ifndef IN_LIBGCOV > /* About the host */ > This doesn't work for AVR since their LONG_LONG_TYPE_SIZE depents on target flags (see eg. build http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=602648) g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -I. -I. -I/home/jbglaw/repos/gcc/gcc -I/home/jbglaw/repos/gcc/gcc/. -I/home/jbglaw/repos/gcc/gcc/../include -I/home/jbglaw/repos/gcc/gcc/../libcpp/include -I/home/jbglaw/repos/gcc/gcc/../libdecnumber -I/home/jbglaw/repos/gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I/home/jbglaw/repos/gcc/gcc/../libbacktrace -o auto-profile.o -MT auto-profile.o -MMD -MP -MF ./.deps/auto-profile.TPo /home/jbglaw/repos/gcc/gcc/auto-profile.c In file included from ./tm.h:19:0, from /home/jbglaw/repos/gcc/gcc/backend.h:28, from /home/jbglaw/repos/gcc/gcc/auto-profile.c:26: ./options.h:261:36: error: token "." is not valid in preprocessor expressions #define target_flags global_options.x_target_flags ^ ./options.h:5153:23: note: in expansion of macro ‘target_flags’ #define TARGET_INT8 ((target_flags & MASK_INT8) != 0) ^ /home/jbglaw/repos/gcc/gcc/config/avr/avr.h:138:24: note: in expansion of macro ‘TARGET_INT8’ #define INT_TYPE_SIZE (TARGET_INT8 ? 8 : 16) ^ /home/jbglaw/repos/gcc/gcc/config/avr/avr.h:141:30: note: in expansion of macro ‘INT_TYPE_SIZE’ #define LONG_LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 32 : 64) ^ /home/jbglaw/repos/gcc/gcc/gcov-io.h:167:5: note: in expansion of macro ‘LONG_LONG_TYPE_SIZE’ #if LONG_LONG_TYPE_SIZE > 32 ^ Makefile:1096: recipe for target 'auto-profile.o' failed make[1]: *** [auto-profile.o] Error 1 make[1]: Leaving directory '/home/jbglaw/build/avr/build-gcc/gcc' MfG, JBG -- Jan-Benedict Glaw jbglaw@lug-owl.de +49-172-7608481 Signature of: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html the second :