public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/44942]  New: Bug in argument passing of long double
@ 2010-07-15  2:39 pdox at alum dot mit dot edu
  2010-07-15  8:06 ` [Bug target/44942] " rguenth at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: pdox at alum dot mit dot edu @ 2010-07-15  2:39 UTC (permalink / raw)
  To: gcc-bugs

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


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

end of thread, other threads:[~2010-08-06 23:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-15  2:39 [Bug c/44942] New: Bug in argument passing of long double pdox at alum dot mit dot edu
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

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).