This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH 2.95.4] Offer backward compatible abi for vxworks



----- Original Message -----
From: "Dave Korn" <davek-ml@ntlworld.com>
To: "gcc-patches" <gcc-patches@gcc.gnu.org>


  I should also mention that this patch was build and tested on a real
vxworks target board, caused no regressions, but didn't actually fix any
failing testcases either; I used the following testcase which fails without
the new flag and passes when compiled with it.  This testcase isn't in
a form suitable for inclusion in the testsuite but I just wanted to show
how the patch had been tested.

        DaveK

=========================================================

diff -c3pNr /gcc.orig/gcc/gcc/testsuite/gcc.c-torture/execute/vxworks-5.c
/gcc.dev/gcc/gcc/testsuite/gcc.c-torture/execute/vxworks-5.c
*** /gcc.orig/gcc/gcc/testsuite/gcc.c-torture/execute/vxworks-5.c Thu Jan  1 00:00:00 1970
--- /gcc.dev/gcc/gcc/testsuite/gcc.c-torture/execute/vxworks-5.c Mon Jan 22 03:14:08 2001
***************
*** 0 ****
--- 1,77 ----
+
+ #include <VxWorks.h>
+ #include <stdarg.h>
+ #include <stdio.h>
+
+ /* Testcase to spot argument alignment trouble between gcc-2.7.2 eabi as
+    used by vxworks, and gcc-2.95.2 (more correct) eabi implementation.   */
+
+ int bar (int a, long long b, int c, long long d, int e, long long f, int g,
+           long long h, int i, long long j, int k, long long l,
+       float fa, double fb, float fc, double fd, float fe, double ff, float fg,
+           double fh, float fi, double fj, float fk, double fl)
+ {
+ char buf[512];
+
+   sprintf(buf,
+         "%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%d:%d-%d-%d-%d-%d-%d-"
+         "%d-%d-%d-%d-%d-%d:"
+     "%g-%g-%g-%g-%g-%g-%g-%g-%g-%g-%g-%g:%g-%g-%g-%g-%g-%g-"
+     "%g-%g-%g-%g-%g-%g:"
+         "%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%d:%d-%d-%d-%d-%d-%d-"
+         "%d-%d-%d-%d-%d-%d:"
+     "%g-%g-%g-%g-%g-%g-%g-%g-%g-%g-%g-%g:%g-%g-%g-%g-%g-%g-"
+     "%g-%g-%g-%g-%g-%g:",
+         a, c, e, g, i, k,
+         b, d, f,
+         a, c, e, g, i, k,
+         h, j, l,
+         fa, fb, fc, fd, fe, ff, fg, fh, fi, fj, fk, fl,
+         fa, fb, fc, fd, fe, ff, fg, fh, fi, fj, fk, fl,
+         a, c, e, g, i, k,
+         b, d, f,
+         a, c, e, g, i, k,
+         h, j, l,
+         fa, fb, fc, fd, fe, ff, fg, fh, fi, fj, fk, fl,
+         fa, fb, fc, fd, fe, ff, fg, fh, fi, fj, fk, fl);
+
+   if (strcmp (buf,
+     "3-5-7-9-11-13-0-4-0-6-0-8:3-5-7-9-11-13-0-10-0-12-0-14:"
+     "1-2-4-8-16-32-64-128-256-512-1024-2048:"
+     "1-2-4-8-16-32-64-128-256-512-1024-2048:3-5-7-9-11-13-0-4-0-6-0-8:"
+     "3-5-7-9-11-13-0-10-0-12-0-14:1-2-4-8-16-32-64-128-256-512-1024-2048:"
+     "1-2-4-8-16-32-64-128-256-512-1024-2048:"))
+       return 1;
+
+
+   sprintf (buf, "%d-%g-%d-%g-%d-%g-%d-%g:%d-%g-%d-%g-%d-%g-%d-%g:"
+                 "%d-%g-%d-%g-%d-%g-%d-%g:%d-%g-%d-%g-%d-%g-%d-%g:"
+                 "%d-%d-%g-%d-%g-%d-%g-%d-%g:%d-%g-%d-%g-%d-%g-%d-%g:"
+                 "%d-%g-%d-%g-%d-%g-%d-%g:%d-%g-%d-%g-%d-%g-%d-%g:",
+    3, 1.0, 4, 2.0, 5, 4.0, 6, 8.0, 7, 16.0, 8, 32.0, 9, 64.0, 10, 128.0,
+    11, 256.0, 12, 512.0, 13, 1024.0, 14, 2048.0, 15, 4096.0, 16, 8192.0, 17, 16384.0, 18, 32768.0,
+    2, 3, 1.0, 4, 2.0, 5, 4.0, 6, 8.0, 7, 16.0, 8, 32.0, 9, 64.0, 10, 128.0,
+    11, 256.0, 12, 512.0, 13, 1024.0, 14, 2048.0, 15, 4096.0, 16, 8192.0, 17, 16384.0, 18, 32768.0);
+
+   return (strcmp (buf, "3-1-4-2-5-4-6-8:7-16-8-32-9-64-10-128:"
+             "11-256-12-512-13-1024-14-2048:"
+             "15-4096-16-8192-17-16384-18-32768:2-3-1-4-2-5-4-6-8:"
+             "7-16-8-32-9-64-10-128:11-256-12-512-13-1024-14-2048:"
+             "15-4096-16-8192-17-16384-18-32768:"));
+
+ }
+
+ int main(void)
+ {
+
+   if (bar (3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1.0, 2.0, 4.0, 8.0,
+             16.0, 32.0, 64.0, 128.0, 256.0, 512.0, 1024.0, 2048.0))
+     abort ();
+
+   exit (0);
+ }
+
+
+
+
+




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]