public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/24306]  New: va_arg gets confused when skipping over certain zero-sized types
@ 2005-10-11 12:01 bje at gcc dot gnu dot org
  2005-10-11 13:34 ` [Bug target/24306] " pinskia at gcc dot gnu dot org
                   ` (18 more replies)
  0 siblings, 19 replies; 22+ messages in thread
From: bje at gcc dot gnu dot org @ 2005-10-11 12:01 UTC (permalink / raw)
  To: gcc-bugs

va_arg seems to mess up the va_list when variadic variables have size 0, but
when have large alignment requirements.  When the alignment is small, this
seems to work by chance.

$ gcc foo.c -o foo && ./foo
3 0

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

typedef int __attribute__ ((vector_size (16))) foo_t;

struct s
{
  foo_t f[0];
} s1;

void
check (int x, ...)
{
  int y;
  va_list ap;

  va_start (ap, x);
  va_arg (ap, struct s);
  y = va_arg (ap, int);

  /* Expect output: 3 7  */
  printf ("%d %d\n", x, y);
}

int main()
{
  check (3, s1, 7);
  return 0;
}


-- 
           Summary: va_arg gets confused when skipping over certain zero-
                    sized types
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: major
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bje at gcc dot gnu dot org
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 22+ messages in thread
[parent not found: <bug-24306-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2015-10-16  8:24 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-11 12:01 [Bug target/24306] New: va_arg gets confused when skipping over certain zero-sized types bje at gcc dot gnu dot org
2005-10-11 13:34 ` [Bug target/24306] " pinskia at gcc dot gnu dot org
2005-10-11 14:02 ` bje at gcc dot gnu dot org
2005-10-11 14:09 ` [Bug target/24306] [3.4/4.0/4.1 Regression] va_arg gets confused when skipping over certain zero-sized types with -msse pinskia at gcc dot gnu dot org
2005-10-31  6:10 ` mmitchel at gcc dot gnu dot org
2005-12-19 11:34 ` [Bug target/24306] [3.4/4.0/4.1/4.2 " rguenth at gcc dot gnu dot org
2005-12-19 11:40 ` [Bug middle-end/24306] " rguenth at gcc dot gnu dot org
2005-12-20 16:20 ` rguenth at gcc dot gnu dot org
2005-12-20 17:23 ` [Bug middle-end/24306] [3.4/4.0/4.1 " rguenth at gcc dot gnu dot org
2005-12-20 17:24 ` [Bug middle-end/24306] [3.4/4.0 " rguenth at gcc dot gnu dot org
2006-02-03 12:35 ` rguenth at gcc dot gnu dot org
2006-03-11  3:22 ` mmitchel at gcc dot gnu dot org
2007-02-03 15:46 ` [Bug middle-end/24306] [4.0 " gdr at gcc dot gnu dot org
2007-11-07  1:06 ` mrs at apple dot com
2007-12-21 20:45 ` howarth at nitro dot med dot uc dot edu
2007-12-22 16:42 ` howarth at nitro dot med dot uc dot edu
2007-12-22 16:56 ` howarth at nitro dot med dot uc dot edu
2007-12-22 17:16 ` howarth at nitro dot med dot uc dot edu
2007-12-22 17:37 ` howarth at nitro dot med dot uc dot edu
2007-12-22 17:51 ` howarth at nitro dot med dot uc dot edu
     [not found] <bug-24306-4@http.gcc.gnu.org/bugzilla/>
2012-02-07 19:15 ` rsandifo at gcc dot gnu.org
2015-10-16  8:24 ` rguenth 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).