Skip to content

Commit

Permalink
Workaround unsupported 'X' asm constraint in tcc
Browse files Browse the repository at this point in the history
PR #649 (bdwgc).

Use "g" instead of "X" for tinyc asm constraint.

* include/gc/gc.h [__GNUC__ && !__INTEL_COMPILER && __TINYC__
&& !(__APPLE__ && __arm__)] (GC_reachable_here): Use "g" constraint
instead of "X".
  • Loading branch information
kimshrier authored and ivmai committed Aug 2, 2024
1 parent 4b55dae commit 41d46ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/gc/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,10 @@ GC_API int GC_CALL GC_invoke_finalizers(void);
#if defined(__GNUC__) && !defined(__INTEL_COMPILER) \
&& !(defined(__APPLE__) && defined(__arm__) && defined(__TINYC__))
/* TCC (as of v0.9.28rc) does not support asm on macOS/arm. */
# if defined(__e2k__)
# if defined(__TINYC__)
# define GC_reachable_here(ptr) \
__asm__ __volatile__ (" " : : "g"(ptr) : "memory")
# elif defined(__e2k__)
# define GC_reachable_here(ptr) \
__asm__ __volatile__ (" " : : "r"(ptr) : "memory")
# else
Expand Down

0 comments on commit 41d46ec

Please sign in to comment.