From f40fac9b075ab3fa18619f9bbc49ea4867460d45 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Tue, 31 Aug 1993 14:22:41 -0700 Subject: [PATCH] (push_reload): Abort is secondary_reload wants same class as an input reload. From-SVN: r5236 --- gcc/reload.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gcc/reload.c b/gcc/reload.c index c88d6519a4a..f3e880224bb 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -1006,6 +1006,21 @@ push_reload (in, out, inloc, outloc, class, : type == RELOAD_FOR_OUTPUT ? RELOAD_FOR_OUTPUT_ADDRESS : type); + /* This case isn't valid, so fail. Reload is allowed to use the + same register for RELOAD_FOR_INPUT_ADDRESS and RELOAD_FOR_INPUT + reloads, but in the case of a secondary register, we actually + need two different registers for correct code. We fail here + to prevent the possibility of silently generating incorrect code + later. + + The convention is that secondary input reloads are valid only if + the secondary_class is different from class. If you have such + a case, you can not use secondary reloads, you must work around + the problem some other way. */ + + if (type == RELOAD_FOR_INPUT && secondary_class == class) + abort (); + /* If we need a tertiary reload, see if we have one we can reuse or else make one. */