This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
What to do with (known) ABI mismatches during compilation
- From: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 08 Jun 2005 18:36:49 +0200
- Subject: What to do with (known) ABI mismatches during compilation
Consider the (two) case(s)
double foo(double) __attribute__((sseregparm));
static double bar(double) __attribute__((sseregparm));
static double bar(double x) { return x; }
now, with -mno-sse we have the following choices for call
to function foo:
1 Emit the call with SSE arguments regardless of -mno-sse
(we get (maybe) SIGILL at runtime)
2 Emit the call with FP stack arguments regardless of
attribute sseregparm (bad - we will get wrong results
if SSE is actually supported at runtime, else we either
get SIGILL or correct result(?))
3 Error out at compile-time (bad - the call may actually
be reached at runtime)
4 Emit a call to abort()
with a call to function bar there is a fifth possibility:
5 Ignore the sseregparm attribute for both emitting the
function and the call.
Currently we do 2, which is not really better than 3 which
I implemented before. Bonzini suggested creating an
"unreachable" attribute and transforming calls to such
function to abort() in the middle-end; I'm currently
trying if I can make the backend emit SSE code for the
call regardless of -mno-sse, but it looks complicated.
So, the first (separate) question is, do we want to support 5?
Which leaves us to decide between 1 and 4.
Thoughts?
Richard.