emit-rtl.c (gen_realpart): Issue an error for cases GCC can not handle at this time...
authorJeffrey A Law <law@cygnus.com>
Wed, 14 Jul 1999 23:04:45 +0000 (23:04 +0000)
committerJeff Law <law@gcc.gnu.org>
Wed, 14 Jul 1999 23:04:45 +0000 (17:04 -0600)
        * emit-rtl.c (gen_realpart): Issue an error for cases GCC can not
        handle at this time instead of silently generating incorrect code.
        (gen_imagpart): Likewise.

From-SVN: r28105

gcc/ChangeLog
gcc/emit-rtl.c

index 62228a92db97be2fe5f855d02b95f0f4a61dea16..d854d089431bf5226699a09ed76469555e6fe22b 100644 (file)
@@ -1,5 +1,9 @@
 Wed Jul 14 23:28:06 1999  Jeffrey A Law  (law@cygnus.com)
 
+       * emit-rtl.c (gen_realpart): Issue an error for cases GCC can not
+       handle at this time instead of silently generating incorrect code.
+       (gen_imagpart): Likewise.
+
        * reload.c (find_reloads): Emit a USE for a pseudo register without
        a hard register if we could not create an optional reload for the
        pseudo.
index 0b310f2fa67e0fc9f25c2a8ec84154cf49668bb8..4519a23b5afb5e5ec11118524369cec7913247fa 100644 (file)
@@ -966,6 +966,11 @@ gen_realpart (mode, x)
 {
   if (GET_CODE (x) == CONCAT && GET_MODE (XEXP (x, 0)) == mode)
     return XEXP (x, 0);
+  else if (WORDS_BIG_ENDIAN
+          && GET_MODE_BITSIZE (mode) < BITS_PER_WORD
+          && REG_P (x)
+          && REGNO (x) < FIRST_PSEUDO_REGISTER)
+    fatal ("Unable to access real part of complex value in a hard register on this target");
   else if (WORDS_BIG_ENDIAN)
     return gen_highpart (mode, x);
   else
@@ -984,6 +989,11 @@ gen_imagpart (mode, x)
     return XEXP (x, 1);
   else if (WORDS_BIG_ENDIAN)
     return gen_lowpart (mode, x);
+  else if (!WORDS_BIG_ENDIAN
+          && GET_MODE_BITSIZE (mode) < BITS_PER_WORD
+          && REG_P (x)
+          && REGNO (x) < FIRST_PSEUDO_REGISTER)
+    fatal ("Unable to access imaginary part of complex value in a hard register on this target");
   else
     return gen_highpart (mode, x);
 }