[Bug target/44948] -msse/-mavx change ABI

2010-10-26 Thread hjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44948

--- Comment #22 from hjl at gcc dot gnu.org hjl at gcc dot gnu.org 2010-10-26 
13:56:46 UTC ---
Author: hjl
Date: Tue Oct 26 13:56:42 2010
New Revision: 165965

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=165965
Log:
Properly align parameters on stack for x86.

gcc/

2010-10-26  H.J. Lu  hongjiu...@intel.com

PR target/44948
* config/i386/i386.c (ix86_old_function_arg_boundary): New.
(ix86_function_arg_boundary): Always align parameters on stack
in 64bit and align parameters with alignment = 16byte on stack 
in 32bit.  Warn alignment change.

gcc/testsuite/

2010-10-26  H.J. Lu  hongjiu...@intel.com

PR target/44948
* g++.dg/abi/param2.C: Add -Wno-psabi for ilp32 x86.
* g++.dg/vect/pr33860a.cc: Likewise.
* gcc.c-torture/compile/20070522-1.c: Likewise.
* gcc.dg/compat/struct-align-1_x.c: Likewise.
* gcc.dg/compat/struct-align-1_y.c: Likewise.
* gcc.dg/compat/struct-align-2_x.c: Likewise.
* gcc.dg/compat/struct-align-2_y.c: Likewise.
* gcc.dg/pr44136.c: Likewise.

* gcc.c-torture/compile/pr33617.c: Add -Wno-psabi for x86.
* gcc.dg/compat/vector-1_x.c: Likewise.
* gcc.dg/compat/vector-1_y.c: Likewise.
* gcc.dg/compat/vector-2_x.c: Likewise.
* gcc.dg/compat/vector-2_y.c: Likewise.
* gcc.dg/pr43300.c: Likewise.

* gcc.dg/compat/vector-1a_x.c: Add -Wno-psabi.
* gcc.dg/compat/vector-1a_y.c: Likewise.
* gcc.dg/compat/vector-1b_x.c: Likewise.
* gcc.dg/compat/vector-1b_y.c: Likewise.
* gcc.dg/compat/vector-2a_x.c: Likewise.
* gcc.dg/compat/vector-2a_y.c: Likewise.
* gcc.dg/compat/vector-2b_x.c: Likewise.
* gcc.dg/compat/vector-2b_y.c: Likewise.
* gcc.target/i386/pr39162.c: Likewise.
* gcc.target/i386/pr40906-2.c: Likewise.
* gcc.target/i386/sse-5.c: Likewise.

* gcc.dg/pr35442.c: Prune ABI change warnings.

* gcc.c-torture/execute/pr38151.x: New.
* gcc.target/i386/pr44948-1a.c: Likewise.
* gcc.target/i386/pr44948-1b.c: Likewise.
* gcc.target/i386/pr44948-2a.c: Likewise.
* gcc.target/i386/pr44948-2b.c: Likewise.

Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr38151.x
trunk/gcc/testsuite/gcc.target/i386/pr44948-1a.c
trunk/gcc/testsuite/gcc.target/i386/pr44948-1b.c
trunk/gcc/testsuite/gcc.target/i386/pr44948-2a.c
trunk/gcc/testsuite/gcc.target/i386/pr44948-2b.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/abi/param2.C
trunk/gcc/testsuite/g++.dg/vect/pr33860a.cc
trunk/gcc/testsuite/gcc.c-torture/compile/20070522-1.c
trunk/gcc/testsuite/gcc.c-torture/compile/pr33617.c
trunk/gcc/testsuite/gcc.dg/compat/struct-align-1_x.c
trunk/gcc/testsuite/gcc.dg/compat/struct-align-1_y.c
trunk/gcc/testsuite/gcc.dg/compat/struct-align-2_x.c
trunk/gcc/testsuite/gcc.dg/compat/struct-align-2_y.c
trunk/gcc/testsuite/gcc.dg/compat/vector-1_x.c
trunk/gcc/testsuite/gcc.dg/compat/vector-1_y.c
trunk/gcc/testsuite/gcc.dg/compat/vector-1a_x.c
trunk/gcc/testsuite/gcc.dg/compat/vector-1a_y.c
trunk/gcc/testsuite/gcc.dg/compat/vector-1b_x.c
trunk/gcc/testsuite/gcc.dg/compat/vector-1b_y.c
trunk/gcc/testsuite/gcc.dg/compat/vector-2_x.c
trunk/gcc/testsuite/gcc.dg/compat/vector-2_y.c
trunk/gcc/testsuite/gcc.dg/compat/vector-2a_x.c
trunk/gcc/testsuite/gcc.dg/compat/vector-2a_y.c
trunk/gcc/testsuite/gcc.dg/compat/vector-2b_x.c
trunk/gcc/testsuite/gcc.dg/compat/vector-2b_y.c
trunk/gcc/testsuite/gcc.dg/pr35442.c
trunk/gcc/testsuite/gcc.dg/pr43300.c
trunk/gcc/testsuite/gcc.dg/pr44136.c
trunk/gcc/testsuite/gcc.target/i386/pr39162.c
trunk/gcc/testsuite/gcc.target/i386/pr40906-2.c
trunk/gcc/testsuite/gcc.target/i386/sse-5.c


[Bug target/44948] -msse/-mavx change ABI

2010-10-26 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44948

H.J. Lu hjl.tools at gmail dot com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.6.0

--- Comment #23 from H.J. Lu hjl.tools at gmail dot com 2010-10-26 13:58:57 
UTC ---
Fixed.


[Bug target/44948] -msse/-mavx change ABI

2010-08-21 Thread hjl dot tools at gmail dot com


--- Comment #21 from hjl dot tools at gmail dot com  2010-08-21 17:06 
---
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2010-08/msg01669.html


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

URL||http://gcc.gnu.org/ml/gcc-
   ||patches/2010-
   ||08/msg01669.html


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



[Bug target/44948] -msse/-mavx change ABI

2010-07-16 Thread hjl dot tools at gmail dot com


--- Comment #18 from hjl dot tools at gmail dot com  2010-07-16 13:31 
---
The problem isn't new:

[...@gnu-6 case3]$ cat x.c
#include x.h

void
foo (long double x, struct A y, long double z)
{
  int i;
  struct A a = { { 0, 1, 2, 3 } };

  if (x != 8.0L || z != 8.0L)
__builtin_abort ();
  if (__builtin_memcmp (a, y, sizeof (a)))
__builtin_abort ();
}
[...@gnu-6 case3]$ cat x.h
struct A
{ 
  float V4SF __attribute__ ((vector_size (16)));
};

void foo (long double, struct A, long double);
[...@gnu-6 case3]$ cat main.c 
#include x.h

int
main (void)
{
  struct A a = { { 0, 1, 2, 3 } };
  foo (8.0L, a, 8.0L);
  return 0;
}
[...@gnu-6 case3]$ make CC=gcc
gcc -m32 -g -O -msse2   -c -o x.o x.c
gcc -m32 -g -O -mno-sse   -c -o main.o main.c
gcc -m32 -g -O -o x x.o main.o
./x
make: *** [all] Aborted
[...@gnu-6 case3]$ 


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

Summary|-mavx changes ABI   |-msse/-mavx change ABI


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



[Bug target/44948] -msse/-mavx change ABI

2010-07-16 Thread hjl dot tools at gmail dot com


--- Comment #19 from hjl dot tools at gmail dot com  2010-07-16 13:41 
---
Created an attachment (id=21223)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21223action=view)
A patch with psABI warning

This patch changes and warns psABI:

[...@gnu-6 case3]$ make
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -m32 -g -O -msse2   -c -o x.o
x.c
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -m32 -g -O -mno-sse   -c -o
main.o main.c
main.c: In function ‘main’:
main.c:7:7: note: The ABI of passing parameter with 16byte or greater alignment
has changed in GCC 4.6
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -m32 -g -O -o x x.o main.o
./x
[...@gnu-6 case2]$ make
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -O -mavx   -c -o x.o x.c
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -O   -c -o main.o main.c
main.c: In function ‘main’:
main.c:7:7: note: The ABI of passing parameter with 16byte or greater alignment
has changed in GCC 4.6
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -O -o x x.o main.o
./x
[...@gnu-6 case2]$ 


-- 


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



[Bug target/44948] -msse/-mavx change ABI

2010-07-16 Thread hjl dot tools at gmail dot com


--- Comment #20 from hjl dot tools at gmail dot com  2010-07-16 13:55 
---
The following testcases are affected:

gcc.c-torture/compile/20070522-1.c
gcc.c-torture/compile/pr33617.c
gcc.c-torture/execute/pr38151.c
gcc.dg/compat/struct-align-1
gcc.dg/compat/struct-align-2
gcc.dg/compat/vector-1a
gcc.dg/compat/vector-1
gcc.dg/compat/vector-2a
gcc.dg/compat/vector-2b
gcc.dg/compat/vector-2
gcc.dg/pr43300.c
gcc.dg/pr44136.c
gcc.target/i386/pr39162.c
gcc.target/i386/pr40906-2.c
gcc.target/i386/sse-5.c
g++.dg/abi/param2.C
g++.dg/vect/pr33860a.cc


-- 


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