public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/22083] New: TARGET_C99_FUNCTIONS is wrongly defined on AIX 5.1
@ 2005-06-15 20:56 lmakhlis at bmc dot com
  2005-06-17 13:57 ` [Bug target/22083] " dje at gcc dot gnu dot org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: lmakhlis at bmc dot com @ 2005-06-15 20:56 UTC (permalink / raw)
  To: gcc-bugs

gcc/config/rs6000/aix51.h and gcc/config/rs6000/aix52.h both define
TARGET_C99_FUNCTIONS.  This seems to be wrong for AIX 5.1: it has xxxl
functions, but not xxxf ones.

Source code:
=== CUT ===
extern double sqrt(double);

float f(float x)
{
  return sqrt(x);
}

int main()
{
  return f(1.0f) != 1.0f;
}
=== CUT ===

"gcc -v" output:

=== CUT ===
Reading specs from /bmc/moe/lib/gcc/powerpc-ibm-aix5.1.0.0/3.4.3/specs
Configured with: /depot/gnu/gcc-3.4.3/configure --prefix=/bmc/moe
--srcdir=/depot/gnu/gcc-3.4.3 --exec-prefix=/bmc/moe
--with-local-prefix=/bmc/moe --enable-shared --with-as=/usr/bin/as
--with-ld=/usr/bin/ld --enable-threads=posix --with-x --enable-java-awt=xlib
--disable-nls
Thread model: aix
gcc version 3.4.3
=== CUT ===

"oslevel -r" output:
5100-04

"lslpp -l bos.adt.libm" output:
=== CUT ===
  Fileset                      Level  State      Description
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  bos.adt.libm              5.1.0.25  COMMITTED  Base Application Development
                                                 Math Library
=== CUT ===

"gcc <file> -O -lm" output:
ld: 0711-317 ERROR: Undefined symbol: .sqrtf
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status

The problem becomes even worse for C++ code:
libstdc++ correctly detects that (e.g.) sqrtf() is missing, and generates a stub
that calls sqrt().  But the compiler converts that sqrt() call back into
sqrtf(), resulting in infinite recursion!  The following example triggers this:

=== CUT ===
#include <cmath>

int main()
{
  return std::sqrt(1.0f) != 1.0f;
}
=== CUT ===

-- 
           Summary: TARGET_C99_FUNCTIONS is wrongly defined on AIX 5.1
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lmakhlis at bmc dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-ibm-aix5.1.0.0
  GCC host triplet: powerpc-ibm-aix5.1.0.0
GCC target triplet: powerpc-ibm-aix5.1.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22083


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2005-07-08 18:38 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-15 20:56 [Bug target/22083] New: TARGET_C99_FUNCTIONS is wrongly defined on AIX 5.1 lmakhlis at bmc dot com
2005-06-17 13:57 ` [Bug target/22083] " dje at gcc dot gnu dot org
2005-06-17 14:02 ` pinskia at gcc dot gnu dot org
2005-06-17 14:43 ` [Bug target/22083] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-06-17 17:22 ` roger at eyesopen dot com
2005-06-17 19:01 ` lmakhlis at bmc dot com
2005-06-17 19:05 ` pinskia at gcc dot gnu dot org
2005-06-17 19:13 ` ebotcazou at gcc dot gnu dot org
2005-06-17 19:32 ` lmakhlis at bmc dot com
2005-06-18 13:26 ` cvs-commit at gcc dot gnu dot org
2005-06-30 21:54 ` [Bug target/22083] [3.4/4.0 " pinskia at gcc dot gnu dot org
2005-07-06 16:28 ` mmitchel at gcc dot gnu dot org
2005-07-08 18:28 ` cvs-commit at gcc dot gnu dot org
2005-07-08 18:33 ` cvs-commit at gcc dot gnu dot org
2005-07-08 18:35 ` dje at gcc dot gnu dot org
2005-07-08 18:38 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).