[Bug target/44942] Bug in argument passing of long double

2010-08-06 Thread ebotcazou at gcc dot gnu dot org


--- Comment #11 from ebotcazou at gcc dot gnu dot org  2010-08-06 23:23 
---
Subject: Bug 44942

Author: ebotcazou
Date: Fri Aug  6 23:23:29 2010
New Revision: 162969

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162969
Log:
PR target/44942
* config/sparc/sparc.c (function_arg_advance): Always take into account
the padding, if any.

Modified:
branches/gcc-4_4-branch/gcc/ChangeLog
branches/gcc-4_4-branch/gcc/config/sparc/sparc.c


-- 


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



[Bug target/44942] Bug in argument passing of long double

2010-08-06 Thread ebotcazou at gcc dot gnu dot org


--- Comment #10 from ebotcazou at gcc dot gnu dot org  2010-08-06 23:23 
---
Subject: Bug 44942

Author: ebotcazou
Date: Fri Aug  6 23:23:12 2010
New Revision: 162968

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162968
Log:
PR target/44942
* config/sparc/sparc.c (function_arg_advance): Always take into account
the padding, if any.

Modified:
branches/gcc-4_5-branch/gcc/ChangeLog
branches/gcc-4_5-branch/gcc/config/sparc/sparc.c


-- 


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



[Bug target/44942] Bug in argument passing of long double

2010-08-06 Thread ebotcazou at gcc dot gnu dot org


--- Comment #9 from ebotcazou at gcc dot gnu dot org  2010-08-06 23:23 
---
Subject: Bug 44942

Author: ebotcazou
Date: Fri Aug  6 23:22:52 2010
New Revision: 162967

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162967
Log:
PR target/44942
* config/sparc/sparc.c (function_arg_advance): Always take into account
the padding, if any.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/sparc/sparc.c


-- 


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



[Bug target/44942] Bug in argument passing of long double

2010-07-21 Thread jakub at gcc dot gnu dot org


--- Comment #8 from jakub at gcc dot gnu dot org  2010-07-22 06:48 ---
Should be fixed now for 4.4+.


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to fail|3.2.3 3.3.3 4.1.2 4.3.4 |3.2.3 3.3.3 4.1.2 4.3.4
   |4.4.3 4.5.0 |4.4.3 4.4.4 4.5.0
  Known to work|4.6.0   |4.6.0 4.5.1 4.4.5
 Resolution||FIXED


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



[Bug target/44942] Bug in argument passing of long double

2010-07-21 Thread jakub at gcc dot gnu dot org


--- Comment #7 from jakub at gcc dot gnu dot org  2010-07-22 06:46 ---
Subject: Bug 44942

Author: jakub
Date: Thu Jul 22 06:46:28 2010
New Revision: 162399

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162399
Log:
Backport from mainline
2010-07-16  Jakub Jelinek  

PR target/44942
* config/i386/i386-protos.h (ix86_function_arg_boundary): Change second
argument to const_tree.
* config/i386/i386.c (function_arg_advance): If padding needs to be
inserted before argument, increment cum->words by number of padding
words as well.
(contains_aligned_value_p): Change argument to const_tree.
(ix86_function_arg_boundary): Change second argument to const_tree.

* gcc.c-torture/execute/pr44942.c: New test.
* gcc.target/i386/pr44942.c: New test.

Added:
branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr44942.c
branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr44942.c
Modified:
branches/gcc-4_4-branch/gcc/ChangeLog
branches/gcc-4_4-branch/gcc/config/i386/i386-protos.h
branches/gcc-4_4-branch/gcc/config/i386/i386.c
branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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



[Bug target/44942] Bug in argument passing of long double

2010-07-21 Thread jakub at gcc dot gnu dot org


--- Comment #6 from jakub at gcc dot gnu dot org  2010-07-22 06:42 ---
Subject: Bug 44942

Author: jakub
Date: Thu Jul 22 06:42:02 2010
New Revision: 162398

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162398
Log:
Backport from mainline
2010-07-16  Jakub Jelinek  

PR target/44942
* config/i386/i386-protos.h (ix86_function_arg_boundary): Change second
argument to const_tree.
* config/i386/i386.c (function_arg_advance): If padding needs to be
inserted before argument, increment cum->words by number of padding
words as well.
(contains_aligned_value_p): Change argument to const_tree.
(ix86_function_arg_boundary): Change second argument to const_tree.

* gcc.c-torture/execute/pr44942.c: New test.
* gcc.target/i386/pr44942.c: New test.

Added:
branches/gcc-4_5-branch/gcc/testsuite/gcc.c-torture/execute/pr44942.c
branches/gcc-4_5-branch/gcc/testsuite/gcc.target/i386/pr44942.c
Modified:
branches/gcc-4_5-branch/gcc/ChangeLog
branches/gcc-4_5-branch/gcc/config/i386/i386-protos.h
branches/gcc-4_5-branch/gcc/config/i386/i386.c
branches/gcc-4_5-branch/gcc/testsuite/ChangeLog


-- 


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



[Bug target/44942] Bug in argument passing of long double

2010-07-16 Thread jakub at gcc dot gnu dot org


--- Comment #5 from jakub at gcc dot gnu dot org  2010-07-16 10:35 ---
Fixed on the trunk so far, will backport to branches later on.


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

  Known to fail|3.2.3 3.3.3 4.1.2 4.3.4 |3.2.3 3.3.3 4.1.2 4.3.4
   |4.4.3 4.5.0 4.6.0   |4.4.3 4.5.0
  Known to work||4.6.0


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



[Bug target/44942] Bug in argument passing of long double

2010-07-16 Thread jakub at gcc dot gnu dot org


--- Comment #4 from jakub at gcc dot gnu dot org  2010-07-16 09:06 ---
Subject: Bug 44942

Author: jakub
Date: Fri Jul 16 09:06:02 2010
New Revision: 162255

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162255
Log:
PR target/44942
* config/i386/i386-protos.h (ix86_function_arg_boundary): Change second
argument to const_tree.
* config/i386/i386.c (function_arg_advance): If padding needs to be
inserted before argument, increment cum->words by number of padding
words as well.
(contains_aligned_value_p): Change argument to const_tree.
(ix86_function_arg_boundary): Change second argument to const_tree.

* gcc.c-torture/execute/pr44942.c: New test.
* gcc.target/i386/pr44942.c: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr44942.c
trunk/gcc/testsuite/gcc.target/i386/pr44942.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386-protos.h
trunk/gcc/config/i386/i386.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug target/44942] Bug in argument passing of long double

2010-07-15 Thread jakub at gcc dot gnu dot org


--- Comment #3 from jakub at gcc dot gnu dot org  2010-07-15 12:03 ---
Created an attachment (id=21209)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21209&action=view)
gcc46-pr44942.patch

Untested fix.  Grep tells me that cum->words is only ever used for x86-64
va_start expansion (and only for non-ms ABI), so I hope this patch doesn't
affect anything but __builtin_va_start in functions where at least one of the
arguments passed on the stack had to be padded.


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED


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



[Bug target/44942] Bug in argument passing of long double

2010-07-15 Thread jakub at gcc dot gnu dot org


--- Comment #2 from jakub at gcc dot gnu dot org  2010-07-15 09:49 ---
Seems ix86_function_arg_advance ignores padding for > 8 byte aligned arguments
when updating cum->words.

With:
#include 

long double
test (int a, int b, int c, int d, int e, int f, int g, int g2, int g3, long
double h, int g4, long double h2, int g5, long double h3, ...)
{
  int i;
  va_list ap;

  va_start (ap, h3);
  i = va_arg (ap, int);
  __builtin_printf ("Got %d, expected %d\n", i, 123456789);
  va_end (ap);
  return h + h2 + h3 + g3 + g4 + g5;
}

int
main ()
{
  test (0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0L, 0, 0.0L, 0, 0.0L, 123456789,
0xULL, 0xULL);
  return 0;
}

testcase the reading of the va_arg is already off by 24 bytes (3 times 8 byte
padding before each of the long double arguments).
Looking into it.


-- 


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



[Bug target/44942] Bug in argument passing of long double

2010-07-15 Thread rguenth at gcc dot gnu dot org


--- Comment #1 from rguenth at gcc dot gnu dot org  2010-07-15 08:06 ---
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
  Component|c   |target
 Ever Confirmed|0   |1
   Keywords||wrong-code
  Known to fail||3.3.3 4.1.2 4.3.4 4.4.3
   ||4.5.0 4.6.0
   Last reconfirmed|-00-00 00:00:00 |2010-07-15 08:06:24
   date||


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