1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/gcc/3.3.1/pr11949-fix.patch Sat Jun 16 18:01:59 2007 +0000
1.3 @@ -0,0 +1,61 @@
1.4 +Message-Id: 20030822160024.GA305@ftbfs.org
1.5 +From: Matt Kraai kraai at alumni dot cmu dot edu
1.6 +To: gcc-patches at gcc dot gnu dot org
1.7 +Date: Fri, 22 Aug 2003 09:00:24 -0700
1.8 +Subject: PR 11949
1.9 +
1.10 +Howdy,
1.11 +
1.12 +I've backported the following patch from the mainline to the 3.3
1.13 +branch to fix PR 11949.
1.14 +
1.15 +Bootstrapped and regression tested on powerpc-unknown-linux-gnu.
1.16 +
1.17 +OK to commit?
1.18 +
1.19 + PR c/11949
1.20 + Backport from mainline:
1.21 +
1.22 + 2003-05-05 Aldy Hernandez aldyh@redhat.com
1.23 +
1.24 + * testsuite/gcc.c-torture/compile/simd-6.c: New.
1.25 +
1.26 + * c-typeck.c (digest_init): Handle arrays of vector constants.
1.27 +
1.28 +Index: gcc/c-typeck.c
1.29 +===================================================================
1.30 +RCS file: /cvs/gcc/gcc/gcc/c-typeck.c,v
1.31 +retrieving revision 1.213.2.8
1.32 +diff -3 -c -p -r1.213.2.8 c-typeck.c
1.33 +*** gcc/gcc/c-typeck.c 19 Aug 2003 01:42:35 -0000 1.213.2.8
1.34 +--- gcc/gcc/c-typeck.c 22 Aug 2003 09:24:03 -0000
1.35 +*************** digest_init (type, init, require_constan
1.36 +*** 4765,4772 ****
1.37 + if (code == VECTOR_TYPE
1.38 + && comptypes (TREE_TYPE (inside_init), type)
1.39 + && TREE_CONSTANT (inside_init))
1.40 +! return build_vector (type, TREE_OPERAND (inside_init, 1));
1.41 +!
1.42 +
1.43 + /* Any type can be initialized
1.44 + from an expression of the same type, optionally with braces. */
1.45 +--- 4765,4778 ----
1.46 + if (code == VECTOR_TYPE
1.47 + && comptypes (TREE_TYPE (inside_init), type)
1.48 + && TREE_CONSTANT (inside_init))
1.49 +! {
1.50 +! if (TREE_CODE (inside_init) == VECTOR_CST
1.51 +! && comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (inside_init)),
1.52 +! TYPE_MAIN_VARIANT (type)))
1.53 +! return inside_init;
1.54 +! else
1.55 +! return build_vector (type, CONSTRUCTOR_ELTS (inside_init));
1.56 +! }
1.57 +
1.58 + /* Any type can be initialized
1.59 + from an expression of the same type, optionally with braces. */
1.60 +
1.61 +typedef int __attribute__((mode(V2SI))) vec;
1.62 +
1.63 +vec a[] = {(vec) {1, 2}, {3, 4}};
1.64 +