[
https://issues.apache.org/jira/browse/STDCXX-861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12588605#action_12588605
]
Martin Sebor commented on STDCXX-861:
-------------------------------------
-------- Original Message --------
Subject: Re: (Incident Review ID: 1229484) Sun C++/x86_64 bad codegen on va_arg
and long double
Date: Mon, 14 Apr 2008 08:03:53 -0700 (MST)
From: Steve Clamage <Stephen.Clamage AT Sun DOT COM>
To: sebor AT roguewave DOT com
Hi Martin Sebor,
Thank you for reporting this issue.
We have determined that this report is a new bug and entered the bug into our
internal bug tracking system under Bug Id: 6688168.
You can monitor this bug on the Java Bug Database at
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6688168.
It may take a day or two before your bug shows up in this external database.
If you are a member of the Sun Developer Network (SDN), there are two
additional options once the bug is visible.
1. Voting for the bug
Click http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6688168.
2. Adding the report to your Bug Watch list.
You will receive an email notification when this bug is updated.
Click http://bugs.sun.com/bugdatabase/addBugWatch.do?bug_id=6688168.
The Sun Developer Network (http://developers.sun.com) is a free service that
Sun offers. To join, visit
https://softwarereg.sun.com/registration/developer/en_US/new_user.
For a limited time, SDN members can obtain fully licensed Java IDEs for web and
enterprise development. More information is at
http://developers.sun.com/prodtech/javatools/free/.
> [Sun C++ 5.9/x86_64] bad codegen on va_arg and long double
> ----------------------------------------------------------
>
> Key: STDCXX-861
> URL: https://issues.apache.org/jira/browse/STDCXX-861
> Project: C++ Standard Library
> Issue Type: Bug
> Components: External
> Reporter: Martin Sebor
>
> Sun C++ 5.9 appears to generate incorrect code for x86_64 (but not for x86 or
> SPARC) the attached program involving va_arg() and long double.
> {noformat}
> $ cat t.cpp && CC -m64 -V t.cpp && ./a.out
> #include <cassert>
> #include <cstdarg>
> #include <cstdio>
> #include <cstring>
> char buffer [80];
> const char* a1;
> int a2;
> const char* a3;
> int a4;
> const char* a5;
> long double a6;
> void setargs (std::va_list va) {
> a1 = va_arg (va, const char*);
> a2 = va_arg (va, int);
> a3 = va_arg (va, const char*);
> a4 = va_arg (va, int);
> a5 = va_arg (va, const char*);
> a6 = va_arg (va, long double);
> }
> void foo (const char *fmt, ...) {
> std::va_list va;
> va_start (va, fmt);
> setargs (va);
> std::sprintf (buffer, "%s %x %Lg", a3, a4, a6);
> va_end (va);
> }
> void bar (char *buf, const char *fmt, ...) {
> std::va_list va;
> va_start (va, fmt);
> setargs (va);
> std::sprintf (buf, "%s %x %Lg", a3, a4, a6);
> va_end (va);
> }
> int main () {
> char buf [80];
> foo ( "", "", 1, "", 0x12345678, "%Lg", 1.0L);
> bar (buf, "", "", 1, "", 0x12345678, "%Lg", 1.0L);
> std::puts (buffer);
> std::puts (buf);
> assert (0 == std::strcmp (buf, buffer));
> assert (0 == std::strcmp (buf, " 12345678 1"));
> }
> CC: Sun C++ 5.9 SunOS_i386 Patch 124864-01 2007/07/25
> /amd/packages/mdx/solaris/amd64/compilers/sun/C++5.9j1/prod/bin/c++filt: Sun
> C++ 5.9 SunOS_i386 2007/05/03
> ccfe: Sun C++ 5.9 SunOS_i386 Patch 124864-01 2007/07/25
> ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.482
> 12345678 1
> 12345678 2.60544e-4932
> Assertion failed: 0 == std::strcmp (buf, buffer), file t.cpp, line 48
> Abort (core dumped)
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.