[PATCH] Detect whether target can use -fprofile-update=atomic

Martin Liška mliska@suse.cz
Tue Aug 16 12:56:00 GMT 2016


Hello.

As reported in [1], m68k has been broken since I installed the patch. Reason is that the target
does not support atomic operations (add, or) for a mode of gcov_type. Because of that, we see
an undefined symbols.

Proper fix contains of 2 parts:
a) compiler emission must verify that -fprofile-update=atomic is doable for a given target; it's done
via a new function can_generate_atomic_builtin
b) libgcc must detect whether __atomic_fetch_add_x can be expanded on the target; that requires configure
support and if the target is not capable to expand these, we must conditionally remove all gcov_.*profiler_atomic
functions from libgcov.a.

Andreas reported that it fixes the test-case mentioned in the PR and I tested that on -march=i386.
Apart from that I've been doing bootstrap on x86_64-linux-gnu.

Ready after it finishes?
Martin

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58306#c30
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Detect-whether-target-can-use-fprofile-update-atomic.patch
Type: text/x-patch
Size: 16467 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160816/7d0ea5e8/attachment.bin>


More information about the Gcc-patches mailing list