2002-11-11 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
authorsirl <sirl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Nov 2002 21:29:19 +0000 (21:29 +0000)
committersirl <sirl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Nov 2002 21:29:19 +0000 (21:29 +0000)
PR c/8467
* gcc.c-torture/execute/20021111-1.c

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59026 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/stmt.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20021111-1.c [new file with mode: 0644]

index dcc0bd2..7b06a1e 100644 (file)
@@ -1,3 +1,9 @@
+2002-11-11  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
+
+       PR c/8467
+       * stmt.c (tail_recursion_args): Handle DECL_MODE differing from the
+       mode of DECL_RTL case.
+
 2002-11-11  Janis Johnson  <janis187@us.ibm.com>
 
        * doc/contrib.texi: Merge in the list from the libstdc++ web pages.
index c07fe66..360abe1 100644 (file)
@@ -3311,8 +3311,18 @@ tail_recursion_args (actuals, formals)
       if (GET_MODE (DECL_RTL (f)) == GET_MODE (argvec[i]))
        emit_move_insn (DECL_RTL (f), argvec[i]);
       else
-       convert_move (DECL_RTL (f), argvec[i],
-                     TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (a))));
+       {
+         rtx tmp = argvec[i];
+
+         if (DECL_MODE (f) != GET_MODE (DECL_RTL (f)))
+           {
+             tmp = gen_reg_rtx (DECL_MODE (f));
+             convert_move (tmp, argvec[i],
+                           TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (a))));
+           }
+         convert_move (DECL_RTL (f), tmp,
+                       TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (a))));
+       }
     }
 
   free_temp_slots ();
index 99af5fe..2a8434f 100644 (file)
@@ -1,3 +1,8 @@
+2002-11-11  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
+
+       PR c/8467
+       * gcc.c-torture/execute/20021111-1.c
+
 2002-11-09  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        PR c/8439
diff --git a/gcc/testsuite/gcc.c-torture/execute/20021111-1.c b/gcc/testsuite/gcc.c-torture/execute/20021111-1.c
new file mode 100644 (file)
index 0000000..b81fa0b
--- /dev/null
@@ -0,0 +1,31 @@
+/* Origin: PR c/8467 */
+
+extern void abort (void);
+extern void exit (int);
+
+int aim_callhandler(int sess, int conn, unsigned short family, unsigned short type);
+
+int aim_callhandler(int sess, int conn, unsigned short family, unsigned short type)
+{
+  static int i = 0;
+
+  if (!conn)
+    return 0;
+
+  if (type == 0xffff)
+    {
+      return 0;
+    }
+
+  if (i >= 1)
+    abort ();
+
+  i++;
+  return aim_callhandler(sess, conn, family, (unsigned short) 0xffff);
+}
+
+int main (void)
+{
+  aim_callhandler (0, 1, 0, 0);
+  exit (0);
+}