Bug 31496 - FAIL: gcc.dg/builtins-20.c (test for excess errors)
Summary: FAIL: gcc.dg/builtins-20.c (test for excess errors)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-06 20:07 UTC by John David Anglin
Modified: 2010-10-27 17:06 UTC (History)
3 users (show)

See Also:
Host: hppa*-*-hpux*
Target: hppa*-*-hpux*
Build: hppa*-*-hpux*
Known to work:
Known to fail:
Last reconfirmed:


Attachments
builtins-20.s (1.35 KB, text/plain)
2007-08-25 22:24 UTC, dave
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2007-04-06 20:07:03 UTC
Executing on host: /test/gnu/gcc/objdir/gcc/xgcc -B/test/gnu/gcc/objdir/gcc/ /te
st/gnu/gcc/gcc/gcc/testsuite/gcc.dg/builtins-20.c   -O2 -ffast-math -fno-show-co
lumn  -lm   -o builtins-20.exe    (timeout = 300)
ld: Unsatisfied symbol "cargf" in file /var/tmp//ccKMBpML.o
ld: Unsatisfied symbol "cargl" in file /var/tmp//ccKMBpML.o
ld: Unsatisfied symbol "atan2l" in file /var/tmp//ccKMBpML.o
ld: Unsatisfied symbol "link_error" in file /var/tmp//ccKMBpML.o
4 errors.
collect2: ld returned 1 exit status
compiler exited with status 1
output is:
ld: Unsatisfied symbol "cargf" in file /var/tmp//ccKMBpML.o
ld: Unsatisfied symbol "cargl" in file /var/tmp//ccKMBpML.o
ld: Unsatisfied symbol "atan2l" in file /var/tmp//ccKMBpML.o
ld: Unsatisfied symbol "link_error" in file /var/tmp//ccKMBpML.o
4 errors.
collect2: ld returned 1 exit status
Comment 1 dave 2007-08-25 22:24:33 UTC
Subject: Re:   New: FAIL: gcc.dg/builtins-20.c (test for excess errors)

test3l and test3f fail.  Attached .s file.

Dave
Comment 2 dave 2007-08-25 22:24:33 UTC
Created attachment 14115 [details]
builtins-20.s
Comment 3 John David Anglin 2007-09-15 23:12:28 UTC
I believe that this test started failing when mode cases were added
in the "Handle CONJ_EXPR in negate_expr_p and fold_negate_expr".  Test
doesn't fail on linux, so this has something to do with missing C99
functions. 
Comment 4 John David Anglin 2007-09-16 00:21:39 UTC
Sorry, comment #3 is wrong.

This change was introduced by the additions to builtins-20.c for the
carg(z) -> atan2(z.i, z.r).  There we have:

+static tree
+fold_builtin_carg(tree arglist, tree type)
+{
+  if (validate_arglist (arglist, COMPLEX_TYPE, VOID_TYPE))
+    {
+      tree atan2_fn = mathfn_built_in (type, BUILT_IN_ATAN2);
+
+      if (atan2_fn)
+        {
+         tree arg = builtin_save_expr (TREE_VALUE (arglist));
+         tree r_arg = fold_build1 (REALPART_EXPR, type, arg);
+         tree i_arg = fold_build1 (IMAGPART_EXPR, type, arg);
+         tree newarglist = tree_cons (NULL_TREE, i_arg,
+                                      build_tree_list (NULL_TREE, r_arg));
+         return build_function_call_expr (atan2_fn, newarglist);
+       }
+    }
+
+  return NULL_TREE;
+}

PA-RISC HP-UX has atan2 and atan2f, but not atan2l.  We have in
builtins.def:

DEF_C99_C90RES_BUILTIN (BUILT_IN_ATAN2F, "atan2f", BT_FN_FLOAT_FLOAT_FLOAT, ATTR
_MATHFN_FPROUNDING_ERRNO)

and

/* Builtin that is specified by C99 and C90 reserve the name for future use.
   We can still recognize the builtin in C90 mode but we can't produce it
   implicitly.  */
#undef DEF_C99_C90RES_BUILTIN
#define DEF_C99_C90RES_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
  DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE,    \
               true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS, true)

Think we need to do something about atan2f in the backend.  However,
we don't have atan2l, so the test will have to be xfailed...
Comment 5 John David Anglin 2007-09-16 02:03:44 UTC
There doesn't seem to be any difference between the definitions
for DEF_C99_BUILTIN and DEF_C99_C90RES_BUILTIN.
Comment 6 Steve Ellcey 2009-01-15 22:58:24 UTC
It looks like this test is passing since the test was changed to include
the #ifdef HAVE_C99_RUNTIME.  It looks OK on the 4.3 branch and trunk so
I think we can close it.  Any objections?
Comment 7 dave 2009-01-15 23:40:53 UTC
Subject: Re:  FAIL: gcc.dg/builtins-20.c (test for excess errors)

> I think we can close it.  Any objections?

No.

Dave
Comment 8 Steve Ellcey 2009-01-15 23:45:37 UTC
Fixed with change to test.