public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/46481] New: long double should default to 64bit even for aix6.1
@ 2010-11-15 11:22 michael.haubenwallner at salomon dot at
  2010-11-26 15:52 ` [Bug target/46481] " michael.haubenwallner at salomon dot at
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: michael.haubenwallner at salomon dot at @ 2010-11-15 11:22 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: long double should default to 64bit even for aix6.1
           Product: gcc
           Version: 4.2.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: michael.haubenwallner@salomon.at


For AIX6.1, long double was changed from 64 to 128bit by default since
gcc-4.2.4 as of bug#19115.

It seems the reason to do so was because frexpl() in libc.a expects 128bit.

But this is a known bug in libc.a, and thus should not be the reason to switch
to 128bit by default. There is a static 64bit frexpl() replacement in math.h
(attachment#15004, bug#34794 comment#5) to work around this bug:
> /*
>  * frexpl(), ldexpl(), and modfl() have preexisting shared versions which are
>  * 128-bit only.  64-bit versions must be made available for C99 for the
>  * default 64-bit long double.  These cannot simply be macros because the
>  * actual routines will be the incorrect form in 64-bit mode if the user
>  * forces the actual routines to be used through undef or macro suppression
>  * per the standard.
>  */
So the proper fix for bug#19115 would have been to use the working replacement
of frexpl() in libstdc++ - but AFAICS this is not a problem any more.

Another reason:
Passing a 128bit long double to printf("%Lf") breaks subsequent (at least)
arguments when not linked against libc128.a.

The manpage printf(3) on AIX says:

>  Library
>    Standard C Library (libc.a) or the Standard C Library with 128-Bit long
>    doubles (libc128.a)

as well as:

>   *    An optional L specifying that a following e, E, f,
>        g, or G conversion specifier applies to a long
>        double parameter. If linked with libc.a, long double
>        is the same as double (64bits). If linked with
>        libc128.a and libc.a, long double is 128 bits.


Also, there is another important comment in math.h:
> /*
>  * The following interfaces are available only for the
>  * non-default 128-bit long double mode.  By default long
>  * double is the same as double (64-bit) and should use the
>  * the double precision versions of these routines.
>  *
>  * Many of these routine may not actually exist.  The standards interfaces
>  * are redefined in 128-mode later in this file.  The redefinitions are
>  * are added here to cause link errors rather than runtime errors
>  * when attempting to use these routines in 128-bit long double mode.
>  * Without these redefinitions the 64-bit versions in the libraries
>  * would be invoked at runtime.
>  */

So for now, I'd say 128bit long double support is still incomplete with gcc (if
not with aix at all).

Thank you!


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

* [Bug target/46481] long double should default to 64bit even for aix6.1
  2010-11-15 11:22 [Bug target/46481] New: long double should default to 64bit even for aix6.1 michael.haubenwallner at salomon dot at
@ 2010-11-26 15:52 ` michael.haubenwallner at salomon dot at
  2011-07-06 11:27 ` michael.haubenwallner at salomon dot at
  2014-02-06 20:15 ` dje at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: michael.haubenwallner at salomon dot at @ 2010-11-26 15:52 UTC (permalink / raw)
  To: gcc-bugs

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

Michael Haubenwallner <michael.haubenwallner at salomon dot at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |powerpc-ibm-aix6.1.0.0
            Version|4.2.4                       |4.5.1
         Depends on|                            |19115

--- Comment #1 from Michael Haubenwallner <michael.haubenwallner at salomon dot at> 2010-11-26 15:41:40 UTC ---
This is the same problem for any version since gcc-4.2.4.


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

* [Bug target/46481] long double should default to 64bit even for aix6.1
  2010-11-15 11:22 [Bug target/46481] New: long double should default to 64bit even for aix6.1 michael.haubenwallner at salomon dot at
  2010-11-26 15:52 ` [Bug target/46481] " michael.haubenwallner at salomon dot at
@ 2011-07-06 11:27 ` michael.haubenwallner at salomon dot at
  2014-02-06 20:15 ` dje at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: michael.haubenwallner at salomon dot at @ 2011-07-06 11:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Michael Haubenwallner <michael.haubenwallner at salomon dot at> 2011-07-06 11:26:37 UTC ---
Seems this is fixed since gcc-4.6.0 by
http://gcc.gnu.org/viewcvs?view=revision&revision=169981.


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

* [Bug target/46481] long double should default to 64bit even for aix6.1
  2010-11-15 11:22 [Bug target/46481] New: long double should default to 64bit even for aix6.1 michael.haubenwallner at salomon dot at
  2010-11-26 15:52 ` [Bug target/46481] " michael.haubenwallner at salomon dot at
  2011-07-06 11:27 ` michael.haubenwallner at salomon dot at
@ 2014-02-06 20:15 ` dje at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: dje at gcc dot gnu.org @ 2014-02-06 20:15 UTC (permalink / raw)
  To: gcc-bugs

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

David Edelsohn <dje at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from David Edelsohn <dje at gcc dot gnu.org> ---
fixed


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

end of thread, other threads:[~2014-02-06 20:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-15 11:22 [Bug target/46481] New: long double should default to 64bit even for aix6.1 michael.haubenwallner at salomon dot at
2010-11-26 15:52 ` [Bug target/46481] " michael.haubenwallner at salomon dot at
2011-07-06 11:27 ` michael.haubenwallner at salomon dot at
2014-02-06 20:15 ` dje at gcc dot gnu.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).