public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pdox at alum dot mit dot edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/44942]  New: Bug in argument passing of long double
Date: Thu, 15 Jul 2010 02:39:00 -0000	[thread overview]
Message-ID: <bug-44942-19440@http.gcc.gnu.org/bugzilla/> (raw)

On X86-64, the following code demonstrates how passing a long double as a fixed
 argument causes corruption of the following variable arguments.

#include <stdio.h>
#include <assert.h>
#include <stdarg.h>

void test(int a, int b, int c, int d, int e, int f, int g, long double h, ...)
{
  int i;
  va_list ap;

  va_start(ap, h);
  i = va_arg(ap, int);
  printf("Got %d, expected %d\n", i, 123456789);
  va_end(ap);
}

int main() {
  test(0, 0, 0, 0, 0, 0, 0, (long double)0.0, (int)123456789);
  return 0;
}


-- 
           Summary: Bug in argument passing of long double
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pdox at alum dot mit dot edu
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


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


             reply	other threads:[~2010-07-15  2:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-15  2:39 pdox at alum dot mit dot edu [this message]
2010-07-15  8:06 ` [Bug target/44942] " rguenth at gcc dot gnu dot org
2010-07-15  9:50 ` jakub at gcc dot gnu dot org
2010-07-15 12:03 ` jakub at gcc dot gnu dot org
2010-07-16  9:06 ` jakub at gcc dot gnu dot org
2010-07-16 10:35 ` jakub at gcc dot gnu dot org
2010-07-22  6:42 ` jakub at gcc dot gnu dot org
2010-07-22  6:46 ` jakub at gcc dot gnu dot org
2010-07-22  6:49 ` jakub at gcc dot gnu dot org
2010-08-06 23:23 ` ebotcazou at gcc dot gnu dot org
2010-08-06 23:23 ` ebotcazou at gcc dot gnu dot org
2010-08-06 23:23 ` ebotcazou at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-44942-19440@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).