This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch for PR 16286


The following patch corrects PR 16286.  The ability to #undefine
vector is specified in the Altivec PIM document.  I have omitted the
patch to altivec.h here because (a) it is a mechanical change and (b)
the diff is enormous.  The ChangeLog entry describes the change
adequately.

Tested with bootstrap and make check. Okay for mainline?

Ben


2004-08-12  Ben Elliston  <bje@au.ibm.com>

	* config/rs6000/altivec.h: Change vector to __vector throughout.
        (Except for the `vector' macro itself).

2004-08-12  Ben Elliston  <bje@au.ibm.com>

	PR target/16286
	* gcc.dg/pr16286.c: New test.

/* { dg-do compile { target powerpc*-*-* } } */
/* { dg-options "-maltivec" } */

/* PR 16286
 * Compilation of a simple Altivec test program fails if vector is #undefined
 * when compiling with -maltivec.  This may be done for building C++ programs
 * that use the STL <vector>.
 */

#include <altivec.h>
#undef vector

void test(void)
{
        __vector unsigned int a, b;
        a = vec_and(a, b);
}

/* { dg-bogus "syntax error before \"vector\"" "-maltivec" { target powerpc*-*-* } 0 } */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]