patches/gcc/3.3.1/pr11949-fix.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     1 Message-Id: 20030822160024.GA305@ftbfs.org
     2 From: Matt Kraai kraai at alumni dot cmu dot edu
     3 To: gcc-patches at gcc dot gnu dot org
     4 Date: Fri, 22 Aug 2003 09:00:24 -0700
     5 Subject: PR 11949
     6 
     7 Howdy,
     8 
     9 I've backported the following patch from the mainline to the 3.3
    10 branch to fix PR 11949.
    11 
    12 Bootstrapped and regression tested on powerpc-unknown-linux-gnu.
    13 
    14 OK to commit?
    15 
    16 	PR c/11949
    17 	Backport from mainline:
    18 
    19 	2003-05-05  Aldy Hernandez  aldyh@redhat.com
    20 
    21 	* testsuite/gcc.c-torture/compile/simd-6.c: New.
    22 
    23 	* c-typeck.c (digest_init): Handle arrays of vector constants.
    24 
    25 Index: gcc/c-typeck.c
    26 ===================================================================
    27 RCS file: /cvs/gcc/gcc/gcc/c-typeck.c,v
    28 retrieving revision 1.213.2.8
    29 diff -3 -c -p -r1.213.2.8 c-typeck.c
    30 *** gcc/gcc/c-typeck.c	19 Aug 2003 01:42:35 -0000	1.213.2.8
    31 --- gcc/gcc/c-typeck.c	22 Aug 2003 09:24:03 -0000
    32 *************** digest_init (type, init, require_constan
    33 *** 4765,4772 ****
    34     if (code == VECTOR_TYPE
    35         && comptypes (TREE_TYPE (inside_init), type)
    36         && TREE_CONSTANT (inside_init))
    37 !     return build_vector (type, TREE_OPERAND (inside_init, 1));
    38 ! 
    39   
    40     /* Any type can be initialized
    41        from an expression of the same type, optionally with braces.  */
    42 --- 4765,4778 ----
    43     if (code == VECTOR_TYPE
    44         && comptypes (TREE_TYPE (inside_init), type)
    45         && TREE_CONSTANT (inside_init))
    46 !     {
    47 !       if (TREE_CODE (inside_init) == VECTOR_CST
    48 ! 	  && comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (inside_init)),
    49 ! 			TYPE_MAIN_VARIANT (type)))
    50 ! 	return inside_init;
    51 !       else
    52 ! 	return build_vector (type, CONSTRUCTOR_ELTS (inside_init));
    53 !     }
    54   
    55     /* Any type can be initialized
    56        from an expression of the same type, optionally with braces.  */
    57 
    58 typedef int __attribute__((mode(V2SI))) vec;
    59 
    60 vec a[] = {(vec) {1, 2}, {3, 4}};
    61