Hi,

I'm experiencing troubles with va_list on the mips target. When one of the
parameter is either float (double), long long, or long double, and the function
handling the va_list is static inlined, the va_list argument is invalid.

The target triplet mips-sls-dnaos is an in-house description handling our OS
and equivalent to mips-elf.

The attached file is the .i of the regression application showing the buggy
behavior. The libC used is newlib 1.17.0.

FYI, the same application and the same compiler works fine on ARM targets.

==== GCC's configuration ====

Configured with: ../../../../Workspace/GNUTools/gcc/gcc-4.3.2/configure
--prefix=/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain
--target=mips-sls-dnaos --enable-multilib --enable-languages=c --with-newlib
--with-headers=/Users/xguerin/Workspace/GNUTools/newlib/1.16.0/src/newlib/libc/include

==== Application's CFLAGS and LDFLAGS ====
CFLAGS="--save-temps -g -Wall -Werror -EL -O3 -G0 -std=c99 -Wall -msoft-float
-march=mips32"
LDFLAGS="-msoft-float -EL"

==== Application's .i file ====

# 1 "main.c"
# 1 "/Users/xguerin/Workspace/Applications/Regression/Queue.git/sources//"
# 1 "<interne>"
# 1 "<command-line>"
# 1 "main.c"
# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdio.h"
1 3
# 29
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdio.h"
3
# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/_ansi.h"
1 3
# 15
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/_ansi.h"
3
# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/newlib.h"
1 3
# 16
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/_ansi.h"
2 3
# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/config.h"
1 3



# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/machine/ieeefp.h"
1 3
# 5
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/config.h"
2 3
# 17
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/_ansi.h"
2 3
# 30
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdio.h"
2 3




# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/include/stddef.h"
1 3 4
# 214
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/include/stddef.h"
3 4
typedef unsigned int size_t;
# 35
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdio.h"
2 3


# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/include/stdarg.h"
1 3 4
# 43
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/include/stdarg.h"
3 4
typedef __builtin_va_list __gnuc_va_list;
# 38
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdio.h"
2 3







# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/reent.h"
1 3
# 13
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/reent.h"
3
# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/_ansi.h"
1 3
# 14
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/reent.h"
2 3
# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/_types.h"
1 3
# 12
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/_types.h"
3
# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/machine/_types.h"
1 3






# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/machine/_default_types.h"
1 3
# 26
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/machine/_default_types.h"
3
typedef signed char __int8_t ;
typedef unsigned char __uint8_t ;
# 36
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/machine/_default_types.h"
3
typedef signed short __int16_t;
typedef unsigned short __uint16_t;
# 46
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/machine/_default_types.h"
3
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
# 58
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/machine/_default_types.h"
3
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
# 76
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/machine/_default_types.h"
3
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
# 99
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/machine/_default_types.h"
3
typedef signed long long __int64_t;
typedef unsigned long long __uint64_t;
# 8
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/machine/_types.h"
2 3
# 13
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/_types.h"
2 3
# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/lock.h"
1 3



typedef int _LOCK_T;
typedef int _LOCK_RECURSIVE_T;



extern void _dna_lock_init (int * lock);
extern void _dna_lock_close (int * lock);
extern void _dna_lock_acquire (int * lock);
extern void _dna_lock_release (int * lock);
# 14
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/_types.h"
2 3


typedef long long int _off_t;



typedef short __dev_t;



typedef unsigned short __uid_t;



typedef unsigned short __gid_t;



typedef long long int _off64_t;







typedef long long int _fpos_t;



typedef long int _ssize_t;


# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/include/stddef.h"
1 3 4
# 355
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/include/stddef.h"
3 4
typedef unsigned int wint_t;
# 48
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/_types.h"
2 3



typedef struct
{
  int __count;
  union
  {
    wint_t __wch;
    unsigned char __wchb[4];
  } __value;
} _mbstate_t;



typedef _LOCK_RECURSIVE_T _flock_t;




typedef void *_iconv_t;
# 15
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/reent.h"
2 3






typedef unsigned long __ULong;
# 37
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/reent.h"
3
struct _reent;






struct _Bigint
{
  struct _Bigint *_next;
  int _k, _maxwds, _sign, _wds;
  __ULong _x[1];
};


struct __tm
{
  int __tm_sec;
  int __tm_min;
  int __tm_hour;
  int __tm_mday;
  int __tm_mon;
  int __tm_year;
  int __tm_wday;
  int __tm_yday;
  int __tm_isdst;
};







struct _on_exit_args {
 void * _fnargs[32];
 void * _dso_handle[32];

 __ULong _fntypes;


 __ULong _is_cxa;
};
# 89
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/reent.h"
3
struct _atexit {
 struct _atexit *_next;
 int _ind;

 void (*_fns[32])(void);
        struct _on_exit_args _on_exit_args;
};
# 105
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/reent.h"
3
struct __sbuf {
 unsigned char *_base;
 int _size;
};
# 169
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/reent.h"
3
struct __sFILE {
  unsigned char *_p;
  int _r;
  int _w;
  short _flags;
  short _file;
  struct __sbuf _bf;
  int _lbfsize;






  void * _cookie;

  int (*_read) (struct _reent *, void *, char *, int);

  int (*_write) (struct _reent *, void *, const char *, int);

  _fpos_t (*_seek) (struct _reent *, void *, _fpos_t, int);
  int (*_close) (struct _reent *, void *);


  struct __sbuf _ub;
  unsigned char *_up;
  int _ur;


  unsigned char _ubuf[3];
  unsigned char _nbuf[1];


  struct __sbuf _lb;


  int _blksize;
  int _offset;


  struct _reent *_data;



  _flock_t _lock;

  _mbstate_t _mbstate;
  int _flags2;
};
# 273
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/reent.h"
3
typedef struct __sFILE __FILE;



struct _glue
{
  struct _glue *_next;
  int _niobs;
  __FILE *_iobs;
};
# 305
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/reent.h"
3
struct _rand48 {
  unsigned short _seed[3];
  unsigned short _mult[3];
  unsigned short _add;




};
# 579
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/reent.h"
3
struct _reent
{
  int _errno;




  __FILE *_stdin, *_stdout, *_stderr;

  int _inc;
  char _emergency[25];

  int _current_category;
  const char *_current_locale;

  int __sdidinit;

  void (*__cleanup) (struct _reent *);


  struct _Bigint *_result;
  int _result_k;
  struct _Bigint *_p5s;
  struct _Bigint **_freelist;


  int _cvtlen;
  char *_cvtbuf;

  union
    {
      struct
        {
          unsigned int _unused_rand;
          char * _strtok_last;
          char _asctime_buf[26];
          struct __tm _localtime_buf;
          int _gamma_signgam;
          __extension__ unsigned long long _rand_next;
          struct _rand48 _r48;
          _mbstate_t _mblen_state;
          _mbstate_t _mbtowc_state;
          _mbstate_t _wctomb_state;
          char _l64a_buf[8];
          char _signal_buf[24];
          int _getdate_err;
          _mbstate_t _mbrlen_state;
          _mbstate_t _mbrtowc_state;
          _mbstate_t _mbsrtowcs_state;
          _mbstate_t _wcrtomb_state;
          _mbstate_t _wcsrtombs_state;
   int _h_errno;
        } _reent;



      struct
        {

          unsigned char * _nextf[30];
          unsigned int _nmalloc[30];
        } _unused;
    } _new;


  struct _atexit *_atexit;
  struct _atexit _atexit0;


  void (**(_sig_func))(int);




  struct _glue __sglue;
  __FILE __sf[3];
};
# 812
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/reent.h"
3
extern struct _reent *_impure_ptr;
extern struct _reent *const _global_impure_ptr;

void _reclaim_reent (struct _reent *);
# 46
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdio.h"
2 3
# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/types.h"
1 3







# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/include/stddef.h"
1 3 4
# 152
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/include/stddef.h"
3 4
typedef int ptrdiff_t;
# 326
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/include/stddef.h"
3 4
typedef int wchar_t;
# 9
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/types.h"
2 3
# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/machine/types.h"
1 3
# 19
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/machine/types.h"
3
typedef long int __off_t;
typedef int __pid_t;

__extension__ typedef long long int __loff_t;
# 10
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/types.h"
2 3
# 32
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/types.h"
3
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;



typedef unsigned short ushort;
typedef unsigned int uint;



typedef unsigned long clock_t;




typedef long time_t;




struct timespec {
  time_t tv_sec;
  long tv_nsec;
};

struct itimerspec {
  struct timespec it_interval;
  struct timespec it_value;
};


typedef long daddr_t;
typedef char * caddr_t;

typedef long long int ino_t;
typedef long long int off_t;
typedef long int dev_t;
typedef long int uid_t;
typedef long int gid_t;
typedef long int pid_t;
typedef long int key_t;
typedef long int ssize_t;

typedef unsigned long int mode_t;
typedef unsigned short nlink_t;


typedef unsigned long clockid_t;




typedef unsigned long timer_t;



typedef unsigned long int useconds_t;
typedef long int suseconds_t;
# 47
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdio.h"
2 3



typedef __FILE FILE;
# 59
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdio.h"
3
typedef _fpos_t fpos_t;





# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/sys/stdio.h"
1 3
# 66
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdio.h"
2 3
# 175
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdio.h"
3
FILE * tmpfile (void);
char * tmpnam (char *);
int fclose (FILE *);
int fflush (FILE *);
FILE * freopen (const char *, const char *, FILE *);
void setbuf (FILE *, char *);
int setvbuf (FILE *, char *, int, size_t);
int fprintf (FILE *, const char *, ...) __attribute__ ((__format__ (__printf__,
2, 3)));

int fscanf (FILE *, const char *, ...) __attribute__ ((__format__ (__scanf__,
2, 3)));

int printf (const char *, ...) __attribute__ ((__format__ (__printf__, 1, 2)));

int scanf (const char *, ...) __attribute__ ((__format__ (__scanf__, 1, 2)));

int sscanf (const char *, const char *, ...) __attribute__ ((__format__
(__scanf__, 2, 3)));

int vfprintf (FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__
(__printf__, 2, 0)));

int vprintf (const char *, __gnuc_va_list) __attribute__ ((__format__
(__printf__, 1, 0)));

int vsprintf (char *, const char *, __gnuc_va_list) __attribute__ ((__format__
(__printf__, 2, 0)));

int fgetc (FILE *);
char * fgets (char *, int, FILE *);
int fputc (int, FILE *);
int fputs (const char *, FILE *);
int getc (FILE *);
int getchar (void);
char * gets (char *);
int putc (int, FILE *);
int putchar (int);
int puts (const char *);
int ungetc (int, FILE *);
size_t fread (void *, size_t _size, size_t _n, FILE *);
size_t fwrite (const void * , size_t _size, size_t _n, FILE *);



int fgetpos (FILE *, fpos_t *);

int fseek (FILE *, long, int);



int fsetpos (FILE *, const fpos_t *);

long ftell ( FILE *);
void rewind (FILE *);
void clearerr (FILE *);
int feof (FILE *);
int ferror (FILE *);
void perror (const char *);

FILE * fopen (const char *_name, const char *_type);
int sprintf (char *, const char *, ...) __attribute__ ((__format__ (__printf__,
2, 3)));

int remove (const char *);
int rename (const char *, const char *);
# 360
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdio.h"
3
int _asiprintf_r (struct _reent *, char **, const char *, ...) __attribute__
((__format__ (__printf__, 3, 4)));

char * _asniprintf_r (struct _reent *, char *, size_t *, const char *, ...)
__attribute__ ((__format__ (__printf__, 4, 5)));

char * _asnprintf_r (struct _reent *, char *, size_t *, const char *, ...)
__attribute__ ((__format__ (__printf__, 4, 5)));

int _asprintf_r (struct _reent *, char **, const char *, ...) __attribute__
((__format__ (__printf__, 3, 4)));

int _diprintf_r (struct _reent *, int, const char *, ...) __attribute__
((__format__ (__printf__, 3, 4)));

int _dprintf_r (struct _reent *, int, const char *, ...) __attribute__
((__format__ (__printf__, 3, 4)));

int _fclose_r (struct _reent *, FILE *);
int _fcloseall_r (struct _reent *);
FILE * _fdopen_r (struct _reent *, int, const char *);
int _fflush_r (struct _reent *, FILE *);
int _fgetc_r (struct _reent *, FILE *);
char * _fgets_r (struct _reent *, char *, int, FILE *);




int _fgetpos_r (struct _reent *, FILE *, fpos_t *);
int _fsetpos_r (struct _reent *, FILE *, const fpos_t *);

int _fiprintf_r (struct _reent *, FILE *, const char *, ...) __attribute__
((__format__ (__printf__, 3, 4)));

int _fiscanf_r (struct _reent *, FILE *, const char *, ...) __attribute__
((__format__ (__scanf__, 3, 4)));

FILE * _fmemopen_r (struct _reent *, void *, size_t, const char *);
FILE * _fopen_r (struct _reent *, const char *, const char *);
FILE * _freopen_r (struct _reent *, const char *, const char *, FILE *);
int _fprintf_r (struct _reent *, FILE *, const char *, ...) __attribute__
((__format__ (__printf__, 3, 4)));

int _fputc_r (struct _reent *, int, FILE *);
int _fputs_r (struct _reent *, const char *, FILE *);
size_t _fread_r (struct _reent *, void *, size_t _size, size_t _n, FILE *);
int _fscanf_r (struct _reent *, FILE *, const char *, ...) __attribute__
((__format__ (__scanf__, 3, 4)));

int _fseek_r (struct _reent *, FILE *, long, int);
int _fseeko_r (struct _reent *, FILE *, _off_t, int);
long _ftell_r (struct _reent *, FILE *);
_off_t _ftello_r (struct _reent *, FILE *);
void _rewind_r (struct _reent *, FILE *);
size_t _fwrite_r (struct _reent *, const void * , size_t _size, size_t _n, FILE
*);
int _getc_r (struct _reent *, FILE *);
int _getc_unlocked_r (struct _reent *, FILE *);
int _getchar_r (struct _reent *);
int _getchar_unlocked_r (struct _reent *);
char * _gets_r (struct _reent *, char *);
int _iprintf_r (struct _reent *, const char *, ...) __attribute__ ((__format__
(__printf__, 2, 3)));

int _iscanf_r (struct _reent *, const char *, ...) __attribute__ ((__format__
(__scanf__, 2, 3)));

FILE * _open_memstream_r (struct _reent *, char **, size_t *);
void _perror_r (struct _reent *, const char *);
int _printf_r (struct _reent *, const char *, ...) __attribute__ ((__format__
(__printf__, 2, 3)));

int _putc_r (struct _reent *, int, FILE *);
int _putc_unlocked_r (struct _reent *, int, FILE *);
int _putchar_unlocked_r (struct _reent *, int);
int _putchar_r (struct _reent *, int);
int _puts_r (struct _reent *, const char *);
int _remove_r (struct _reent *, const char *);
int _rename_r (struct _reent *, const char *_old, const char *_new);

int _scanf_r (struct _reent *, const char *, ...) __attribute__ ((__format__
(__scanf__, 2, 3)));

int _siprintf_r (struct _reent *, char *, const char *, ...) __attribute__
((__format__ (__printf__, 3, 4)));

int _siscanf_r (struct _reent *, const char *, const char *, ...) __attribute__
((__format__ (__scanf__, 3, 4)));

int _sniprintf_r (struct _reent *, char *, size_t, const char *, ...)
__attribute__ ((__format__ (__printf__, 4, 5)));

int _snprintf_r (struct _reent *, char *, size_t, const char *, ...)
__attribute__ ((__format__ (__printf__, 4, 5)));

int _sprintf_r (struct _reent *, char *, const char *, ...) __attribute__
((__format__ (__printf__, 3, 4)));

int _sscanf_r (struct _reent *, const char *, const char *, ...) __attribute__
((__format__ (__scanf__, 3, 4)));

char * _tempnam_r (struct _reent *, const char *, const char *);
FILE * _tmpfile_r (struct _reent *);
char * _tmpnam_r (struct _reent *, char *);
int _ungetc_r (struct _reent *, int, FILE *);
int _vasiprintf_r (struct _reent *, char **, const char *, __gnuc_va_list)
__attribute__ ((__format__ (__printf__, 3, 0)));

char * _vasniprintf_r (struct _reent*, char *, size_t *, const char *,
__gnuc_va_list) __attribute__ ((__format__ (__printf__, 4, 0)));

char * _vasnprintf_r (struct _reent*, char *, size_t *, const char *,
__gnuc_va_list) __attribute__ ((__format__ (__printf__, 4, 0)));

int _vasprintf_r (struct _reent *, char **, const char *, __gnuc_va_list)
__attribute__ ((__format__ (__printf__, 3, 0)));

int _vdiprintf_r (struct _reent *, int, const char *, __gnuc_va_list)
__attribute__ ((__format__ (__printf__, 3, 0)));

int _vdprintf_r (struct _reent *, int, const char *, __gnuc_va_list)
__attribute__ ((__format__ (__printf__, 3, 0)));

int _vfiprintf_r (struct _reent *, FILE *, const char *, __gnuc_va_list)
__attribute__ ((__format__ (__printf__, 3, 0)));

int _vfiscanf_r (struct _reent *, FILE *, const char *, __gnuc_va_list)
__attribute__ ((__format__ (__scanf__, 3, 0)));

int _vfprintf_r (struct _reent *, FILE *, const char *, __gnuc_va_list)
__attribute__ ((__format__ (__printf__, 3, 0)));

int _vfscanf_r (struct _reent *, FILE *, const char *, __gnuc_va_list)
__attribute__ ((__format__ (__scanf__, 3, 0)));

int _viprintf_r (struct _reent *, const char *, __gnuc_va_list) __attribute__
((__format__ (__printf__, 2, 0)));

int _viscanf_r (struct _reent *, const char *, __gnuc_va_list) __attribute__
((__format__ (__scanf__, 2, 0)));

int _vprintf_r (struct _reent *, const char *, __gnuc_va_list) __attribute__
((__format__ (__printf__, 2, 0)));

int _vscanf_r (struct _reent *, const char *, __gnuc_va_list) __attribute__
((__format__ (__scanf__, 2, 0)));

int _vsiprintf_r (struct _reent *, char *, const char *, __gnuc_va_list)
__attribute__ ((__format__ (__printf__, 3, 0)));

int _vsiscanf_r (struct _reent *, const char *, const char *, __gnuc_va_list)
__attribute__ ((__format__ (__scanf__, 3, 0)));

int _vsniprintf_r (struct _reent *, char *, size_t, const char *,
__gnuc_va_list) __attribute__ ((__format__ (__printf__, 4, 0)));

int _vsnprintf_r (struct _reent *, char *, size_t, const char *,
__gnuc_va_list) __attribute__ ((__format__ (__printf__, 4, 0)));

int _vsprintf_r (struct _reent *, char *, const char *, __gnuc_va_list)
__attribute__ ((__format__ (__printf__, 3, 0)));

int _vsscanf_r (struct _reent *, const char *, const char *, __gnuc_va_list)
__attribute__ ((__format__ (__scanf__, 3, 0)));


ssize_t __getdelim (char **, size_t *, int, FILE *);
ssize_t __getline (char **, size_t *, FILE *);
# 514
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdio.h"
3
int __srget_r (struct _reent *, FILE *);
int __swbuf_r (struct _reent *, int, FILE *);
# 701
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdio.h"
3

# 2 "main.c" 2
# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdint.h"
1 3
# 41
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdint.h"
3
typedef signed char int8_t ;
typedef unsigned char uint8_t ;




typedef signed char int_least8_t;
typedef unsigned char uint_least8_t;




typedef signed short int16_t;
typedef unsigned short uint16_t;
# 67
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdint.h"
3
typedef int16_t int_least16_t;
typedef uint16_t uint_least16_t;
# 79
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdint.h"
3
typedef signed long int32_t;
typedef unsigned long uint32_t;
# 97
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdint.h"
3
typedef int32_t int_least32_t;
typedef uint32_t uint_least32_t;
# 119
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdint.h"
3
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
# 129
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdint.h"
3
typedef int64_t int_least64_t;
typedef uint64_t uint_least64_t;
# 159
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdint.h"
3
  typedef signed int int_fast8_t;
  typedef unsigned int uint_fast8_t;




  typedef signed int int_fast16_t;
  typedef unsigned int uint_fast16_t;




  typedef signed int int_fast32_t;
  typedef unsigned int uint_fast32_t;
# 213
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdint.h"
3
  typedef int_least64_t int_fast64_t;
  typedef uint_least64_t uint_fast64_t;







  typedef long long int intmax_t;
# 231
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdint.h"
3
  typedef long long unsigned int uintmax_t;
# 243
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/../../../../mips-sls-dnaos/include/stdint.h"
3
typedef signed int intptr_t;
typedef unsigned int uintptr_t;
# 3 "main.c" 2
# 1
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/include/stdarg.h"
1 3 4
# 105
"/Users/xguerin/Workspace/Toolchains/mips-sls-dnaos.toolchain/lib/gcc/mips-sls-dnaos/4.3.2/include/stdarg.h"
3 4
typedef __gnuc_va_list va_list;
# 4 "main.c" 2
# 1 "../headers/queue.h" 1





typedef void (* func) (va_list list);

static inline void queue_test_bouncer (int32_t n, func toto, ...)
{
  va_list list;

  __builtin_va_start(list,toto);
  toto (list);
  __builtin_va_end(list);
}
# 5 "main.c" 2

void queue_test_list (va_list list)
{
  int8_t int8 = 0;
  int16_t int16 = 0;
  int32_t int32 = 0;
  int64_t int64 = 0;

  int16 = __builtin_va_arg(list,int32_t);
  int64 = __builtin_va_arg(list,int64_t);
  int8 = __builtin_va_arg(list,int32_t);
  int32 = __builtin_va_arg(list,int32_t);

  printf ("[List Queue Test]\r\n");

  if (int8 == 12) printf ("int8 value is OK\r\n");
  if (int16 == 1234) printf ("int16 value is OK\r\n");
  if (int32 == 123456) printf ("int32 value is OK\r\n");
  if (int64 == 123456789012345) printf ("int64 value is OK\r\n");
}

void queue_test_shuffled (int32_t n, ...)
{
  int8_t int8 = 0;
  int16_t int16 = 0;
  int32_t int32 = 0;
  int64_t int64 = 0;
  va_list list;

  __builtin_va_start(list,n);

  int16 = __builtin_va_arg(list,int32_t);
  int64 = __builtin_va_arg(list,int64_t);
  int8 = __builtin_va_arg(list,int32_t);
  int32 = __builtin_va_arg(list,int32_t);

  printf ("[Shuffled Queue Test]\r\n");

  if (int8 == 12) printf ("int8 value is OK\r\n");
  if (int16 == 1234) printf ("int16 value is OK\r\n");
  if (int32 == 123456) printf ("int32 value is OK\r\n");
  if (int64 == 123456789012345) printf ("int64 value is OK\r\n");

  __builtin_va_end(list);
}

void queue_test (int32_t n, ...)
{
  int8_t int8 = 0;
  int16_t int16 = 0;
  int32_t int32 = 0;
  int64_t int64 = 0;
  va_list list;

  __builtin_va_start(list,n);

  int8 = __builtin_va_arg(list,int32_t);
  int16 = __builtin_va_arg(list,int32_t);
  int32 = __builtin_va_arg(list,int32_t);
  int64 = __builtin_va_arg(list,int64_t);

  printf ("[Ordered Queue Test]\r\n");

  if (int8 == 12) printf ("int8 value is OK\r\n");
  if (int16 == 1234) printf ("int16 value is OK\r\n");
  if (int32 == 123456) printf ("int32 value is OK\r\n");
  if (int64 == 123456789012345) printf ("int64 value is OK\r\n");

  __builtin_va_end(list);
}

int main (void)
{
  int8_t int8 = 12;
  int16_t int16 = 1234;
  int32_t int32 = 123456;
  int64_t int64 = 123456789012345;

  printf ("%lld\r\n", int64);

  queue_test (4, int8, int16, int32, int64);
  queue_test_shuffled (4, int16, int64, int8, int32);
  queue_test_bouncer (4, queue_test_list, int16, int64, int8, int32);

 return 0;
}


-- 
           Summary: MIPS : buggy va_list with float, long long and long
                    double arguments
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: xavier dot guerin at imag dot fr
 GCC build triplet: i386-apple-darwin9.5.1
  GCC host triplet: 386-apple-darwin9.5.1
GCC target triplet: mips-sls-dnaos


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

Reply via email to