Skip to content

Instantly share code, notes, and snippets.

View iains's full-sized avatar

Iain Sandoe iains

  • UK
View GitHub Profile
for this (and three other) functions in this test Darwin's port is producing very different code from linux (and it's not especially obvious to me why it would, since I've not [at least inentionally] modified any vector stuff):
EDIT: explanation is that the Linux long double is 128 bit, where the Darwin ABI has long double same as double.
long double
check_l_pos (long double x, long double y)
{
return x * __builtin_copysignl (1.0, y);
}
@iains
iains / gist:fc53cdfdf55c383d1d33ba1c2850052a
Created August 14, 2023 09:36
using a lambda trampoline - to making a closure into a function ptr.
// Closure type that runs the original function with the supplied args.
auto __callable = [&] {
std::__invoke(std::forward<_Callable>(__f),
std::forward<_Args>(__args)...);
};
// Trampoline to call the actual fn; we will pass in the closure address.
void (*__oc_tramp)(void*)
= [] (void *ca) { (*static_cast<decltype(__callable)*>(ca))(); };
@iains
iains / gist:7cf5329d81359a572c0c38e34da6666c
Created May 22, 2023 08:07
additions to arsen/maint/intl-update
diff --git a/Makefile.def b/Makefile.def
index 067d70a8e02..fbbcc3865e2 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -345,7 +345,7 @@ dependencies = { module=all-build-fixincludes; on=all-build-libiberty; };
dependencies = { module=all-build-libcpp; on=all-build-libiberty; };
// Host modules specific to gcc.
-dependencies = { module=configure-gcc; on=configure-gettext-runtime; };
+dependencies = { module=configure-gcc; on=configure-gettext; };
@iains
iains / gist:dc28eb2aab6b540872f491adb3cb01fd
Created January 31, 2023 11:24
dummy target for dejagnu
these two files are in my dejagnu-boards/
I then use --target_board=dummy in my RUNTESTFLAGS
no-exe.exp:
proc no_exe_load { dest prog args } {
verbose -log "no_exe_load $prog $args "
return [list "xfail" $prog $args]
}
From 0123fb126ce7817222aecb9545a3f26e6fc297b2 Mon Sep 17 00:00:00 2001
From: Iain Sandoe <iain@sandoe.co.uk>
Date: Tue, 10 Jan 2023 09:10:25 +0000
Subject: [PATCH] modula-2, driver: Try to fix up specs and command line v3.1
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/ChangeLog:
* gcc.cc (fe_add_spec_function):
@iains
iains / gist:392ac23e0101297faf14b6d5e9020a95
Created December 10, 2022 10:11
allow 'extern "C" ' coroutines.
diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index 3f23317a315..c1a0d6c2283 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "gcc-rich-location.h"
#include "hash-map.h"
+#include "cgraph.h"
@iains
iains / gist:140cf56f4524fe561d8d6bebfa9984b1
Created October 8, 2022 19:11
debugging stuff for GCC coroutines.cc
/* ================= Debug. ================= */
#include "cxx-pretty-print.h"
extern void debug_tree (tree);
void
coro_dump_frame (tree fr)
{
gcc_checking_assert (TREE_CODE (fr) == RECORD_TYPE);
@iains
iains / darwin-ada-cc-renamed.txt
Created January 18, 2022 08:27
ada cc rename fix for Darwin
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index 59db72834dc..9e0c545a7be 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -2856,7 +2856,7 @@ LIBGNAT_TARGET_PAIRS += \
# LIBGNAT_SRCS is the list of all C files (including headers) of the runtime
# library. LIBGNAT_OBJS is the list of object files for libgnat.
-# thread.cc is special as put into GNATRTL_TASKING_OBJS
+# thread.c is special as put into GNATRTL_TASKING_OBJS
diff --git a/libstdc++-v3/include/c_compatibility/fenv.h b/libstdc++-v3/include/c_compatibility/fenv.h
index 0413e3b7c25..6b491ecf003 100644
--- a/libstdc++-v3/include/c_compatibility/fenv.h
+++ b/libstdc++-v3/include/c_compatibility/fenv.h
@@ -26,6 +26,10 @@
* This is a Standard C++ Library header.
*/
+#if !defined __cplusplus || defined _GLIBCXX_INCLUDE_NEXT_C_HEADERS
+# include_next <fenv.h>
From ea19ab9479aa40d602650734f943cb85a259bd25 Mon Sep 17 00:00:00 2001
From: Iain Sandoe <iain@sandoe.co.uk>
Date: Tue, 20 Jul 2021 14:00:38 +0100
Subject: [PATCH] c++tools, configury: Configure with C++; test checking status
[PR98821].
The configure fragments need to be built with a C++ compiler.
The stand-alone server uses diagnostic mechanisms in common with
GCC, but needs to define implementations of the asserts and supporting
output funtions.