This is the mail archive of the 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]
Other format: [Raw text]

Re: patch to solve PR39856

Jakub Jelinek wrote:
On Fri, May 22, 2009 at 03:25:08PM -0400, Vladimir Makarov wrote:
^^^ This isn't needed IMHO.
+/* { dg-options "-O3 -fomit-frame-pointer -m32 -msse3 -march=i586" } */
Why? The above option set will work on x86 and x86_64 without a problem.

Because the decision whether to test with -m32 or -m64 should be tester's
decision (how do you invoke make chec, e.g. with
make check RUNTESTFLAGS="--target_board=unix/\{-m32,-m64\}" you want to test both, etc. Several people have been cleaning tests over
time not to have these...

Jakub, thanks for the explanation. It looks like I have no skills to write the tests.

Taking you comments into account the new version of the patch looks like

2009-05-22 Vladimir Makarov <>

* testsuite/ New test.

Is it ok for the branch and trunk? I've checked it on x86 and x86_64.

Index: testsuite/
--- testsuite/	(revision 0)
+++ testsuite/	(revision 0)
@@ -0,0 +1,31 @@
+/* PR target/39856 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fomit-frame-pointer -msse3" } */
+/* { dg-options "-O3 -fomit-frame-pointer -msse3 -march=i586" { target ilp32 } } */
+extern double pow (double, double);
+extern double fabs (double);
+void foo (double *);
+void bar (double *);
+static double
+baz (double x, double e)
+  if ((int) e == 1)
+    return x;
+  return pow (x, e);
+test (double *x, double *y)
+  double P[3], r;
+  bar (P);
+  if (P[2] != 0)
+    baz (fabs (P[2]), y[2]);
+  if (fabs (P[0]) > fabs (P[1]))
+    r = baz (fabs (P[1] / P[0]), y[0]);
+  if (P[2])
+    P[2] *= (1 + r);
+  foo (x);

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