complex-6.c: New.
authorAndreas Jaeger <aj@gcc.gnu.org>
Sun, 23 Jun 2002 05:30:14 +0000 (07:30 +0200)
committerAndreas Jaeger <aj@gcc.gnu.org>
Sun, 23 Jun 2002 05:30:14 +0000 (07:30 +0200)
* gcc.c-torture/execute/complex-6.c: New.

* reg-stack.c (convert_regs_exit): Push the registers to stack in
proper order.

From-SVN: r54915

gcc/ChangeLog
gcc/reg-stack.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/complex-6.c [new file with mode: 0644]

index 261874de79468f07d31e71017f2fdf84bf031b38..8d31820a2f76d08d67bd546817cf1770b93bd7ad 100644 (file)
@@ -1,3 +1,8 @@
+2002-06-23  Jan Hubicka  <jh@suse.cz>
+
+       * reg-stack.c (convert_regs_exit): Push the registers to stack in
+       proper order.
+
 2002-06-22  Ulrich Weigand  <uweigand@de.ibm.com>
 
        PR middle-end/6963
 2002-06-21  Matt Thomas  <matt@3am-software.com>
 
        * config/vax/vax.c (vax_output_function_prologue): Use
-       REGISTER_PREFIX.  Fix some indentation. 
+       REGISTER_PREFIX.  Fix some indentation.
        * config/vax/vax.h (FUNCTION_PROFILER): Use reg_names[].
        (VAX_ISTREAM_SYNC): Define.
        (INITIALIZE_TRAMPOLINE): Use VAX_ISTREAM_SYNC.  Move the
-       i-stream sync to the end. 
-       (REGISTER_PREFIX): Define as "".  
+       i-stream sync to the end.
+       (REGISTER_PREFIX): Define as "".
        (ASM_OUTPUT_MI_THUNK): Use REGISTER_PREFIX.
 
 2002-06-21  Jason Thorpe  <thorpej@wasabisystems.com>
@@ -55,8 +60,8 @@
 2002-06-21  Richard Henderson  <rth@redhat.com>
 
        * bb-reorder.c (make_reorder_chain_1): Search harder for the
-       vax casesi fallthru edge. 
-       * cfglayout.c (cleanup_unconditional_jumps): Use 
+       vax casesi fallthru edge.
+       * cfglayout.c (cleanup_unconditional_jumps): Use
        redirect_edge_succ_nodup.  Do not delete ADDR_VEC insns as dead.
        * cfgrtl.c (force_nonfallthru_and_redirect): Place redirection
        block after ADDR_VEC.
@@ -255,7 +260,7 @@ Thu Jun 20 17:25:29 CEST 2002  JAn HUbicka  <jh@suse.cz>
        (sparclite-*-elf*): Likewise.
        (sparc86x-*-elf*): Likewise.
        (sparc64-*-elf*): Likewise.
-       
+
        * config/i386/sol2.h (PREFERRED_DEBUGGING_TYPE): Moved to
        config/sol2.h.
        (ASM_SPEC): Override config/sol2.h version for now.
@@ -270,7 +275,7 @@ Thu Jun 20 17:25:29 CEST 2002  JAn HUbicka  <jh@suse.cz>
        (SWITCH_TAKES_ARG, STDC_0_IN_SYSTEM_HEADERS): Likewise.
        (ASM_CPU_SPEC): Define.
        (SUBTARGET_EXTRA_SPECS): Define.
-       
+
        * config/sparc/sol2-bi.h (LONG_DOUBLE_TYPE_SIZE): Removed, already
        in config/sparc/sol2.h.
        (ASM_SPEC): Moved to config/sol2.h.
@@ -286,7 +291,7 @@ Thu Jun 20 17:25:29 CEST 2002  JAn HUbicka  <jh@suse.cz>
        (LINK_ARCH64_SPEC): Simplified.
        (LINK_ARCH_SPEC): Redefined config/sol2.h version for 64-bit support.
        (LINK_SPEC): Moved to config/sol2.h
-       
+
        * config/sparc/sol2.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Moved to
        config/sol2.h.
        Use BITS_PER_WORD for size.
@@ -302,7 +307,7 @@ Thu Jun 20 17:25:29 CEST 2002  JAn HUbicka  <jh@suse.cz>
        (SWITCH_TAKES_ARG, STDC_0_IN_SYSTEM_HEADERS): Likewise.
        (TARGET_DEFAULT): Reordered to match config/sparc/sol2-bi.h version.
        (TRANSFER_FROM_TRAMPOLINE): Moved to config/sol2.h
-       
+
        * config.gcc (i?86-*-solaris2*): Removed obsolete gas support.
        * config/i386/sol2gas.h: Removed.
 
index ff896fd93b1cc75d885351617908f31ac1d5f4b9..6ed482c4277694c336ce86e57f0eb6a8ea42ec3e 100644 (file)
@@ -2462,7 +2462,7 @@ convert_regs_exit ()
       output_stack->top = value_reg_high - value_reg_low;
       for (reg = value_reg_low; reg <= value_reg_high; ++reg)
        {
-         output_stack->reg[reg - value_reg_low] = reg;
+         output_stack->reg[value_reg_high - reg] = reg;
          SET_HARD_REG_BIT (output_stack->reg_set, reg);
        }
     }
index 52b8c9b998999bdfc605157280b73b5c66c0f028..9391915b7337d2be8bb871f1b5f261bafc9d08d3 100644 (file)
@@ -1,3 +1,7 @@
+2002-06-23  Andreas Jaeger  <aj@suse.de>
+
+       * gcc.c-torture/execute/complex-6.c: New.
+
 2002-06-22  Neil Booth  <neil@daikokuya.co.uk>
 
        * gcc.dg/cpp/trad/comment-2.c. gcc.dg/cpp/trad/funlike-2.c,
@@ -47,7 +51,7 @@
 2002-06-18  Hans-Peter Nilsson  <hp@axis.com>
 
        * gcc.c-torture/execute/20020615-1.c: Fix typo in comment.
-       
+
 2002-06-18  Aldy Hernandez  <aldyh@redhat.com>
 
         * gcc.c-torture/execute/simd-1.c: New.
 
 2002-06-02  Richard Henderson  <rth@redhat.com>
 
-       * gcc.c-torture/execute/pure-1.c: Don't mark any of the 
+       * gcc.c-torture/execute/pure-1.c: Don't mark any of the
        test functions static.
 
 2002-06-02  Andreas Jaeger  <aj@suse.de>
diff --git a/gcc/testsuite/gcc.c-torture/execute/complex-6.c b/gcc/testsuite/gcc.c-torture/execute/complex-6.c
new file mode 100644 (file)
index 0000000..bbb8c8d
--- /dev/null
@@ -0,0 +1,59 @@
+/* This test tests complex conjugate and passing/returning of
+   complex parameter.  */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+int err;
+
+#define TEST(TYPE, FUNC)                                       \
+__complex__ TYPE                                               \
+ctest_ ## FUNC (__complex__ TYPE x)                            \
+{                                                              \
+  __complex__ TYPE res;                                                \
+                                                               \
+  res = ~x;                                                    \
+                                                               \
+  return res;                                                  \
+}                                                              \
+                                                               \
+void                                                           \
+test_ ## FUNC (void)                                           \
+{                                                              \
+  __complex__ TYPE res, x;                                     \
+                                                               \
+  x = 1.0 + 2.0i;                                              \
+                                                               \
+  res = ctest_ ## FUNC (x);                                    \
+                                                               \
+  if (res != 1.0 - 2.0i)                                       \
+    {                                                          \
+      printf ("test_" #FUNC " failed\n");                      \
+      ++err;                                                   \
+    }                                                          \
+}
+
+
+TEST(float, float)
+TEST(double, double)
+TEST(long double, long_double)
+TEST(int, int)
+TEST(long int, long_int)
+
+int
+main (void)
+{
+
+  err = 0;
+
+  test_float ();
+  test_double ();
+  test_long_double ();
+  test_int ();
+  test_long_int ();
+
+  if (err != 0)
+    abort ();
+
+  return 0;
+}