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]

Re: [patch] fix PR c++/18073


Volker Reichelt <reichelt@igpm.rwth-aachen.de> writes:

> The include file xmmintrin.h has been rejected on mainline
> by the C++ frontend since Mark's casting patch
> http://gcc.gnu.org/ml/gcc-cvs/2004-10/msg01166.html
> which flagged casting from/to vectors as invalid.
>
> Mark added the casting *to* vectors in
> http://gcc.gnu.org/ml/gcc-cvs/2004-10/msg01279.html
> but the casting *from* vectors still doesn't work.
> The following patch adds the missing bit.
>
> Bootstrapped and regtested on i686-pc-linux-gnu. Ok to commit?

The new test fails on x86-64 in 64-bit mode with:

Executing on host: /builds/gcc/misc/gcc/testsuite/../g++ -B/builds/gcc/misc/gcc/testsuite/../ /cvs/gcc/gcc/testsuite/g++.dg/other/mmintrin.C  -nostdinc++ -I/builds/gcc/misc/x86_64-suse-linux-gnu/libstdc++-v3/include/x86_64-suse-linux-gnu -I/builds/gcc/misc/x86_64-suse-linux-gnu/libstdc++-v3/include -I/cvs/gcc/libstdc++-v3/libsupc++ -I/cvs/gcc/libstdc++-v3/include/backward -I/cvs/gcc/libstdc++-v3/testsuite -fmessage-length=0  -msse  -S  -o mmintrin.s    (timeout = 300)
/builds/gcc/misc/gcc/testsuite/../include/emmintrin.h: In function 'void _mm_stream_si128(long long int __vector__*, long long int __vector__)':
/builds/gcc/misc/gcc/testsuite/../include/emmintrin.h:1426: error: invalid conversion from 'long long int __vector__*' to 'long int __vector__*'
/builds/gcc/misc/gcc/testsuite/../include/emmintrin.h:1426: error:   initializing argument 1 of 'void __builtin_ia32_movntdq(long int __vector__*, long int __vector__)'
compiler exited with status 1
output is:
/builds/gcc/misc/gcc/testsuite/../include/emmintrin.h: In function 'void _mm_stream_si128(long long int __vector__*, long long int __vector__)':
/builds/gcc/misc/gcc/testsuite/../include/emmintrin.h:1426: error: invalid conversion from 'long long int __vector__*' to 'long int __vector__*'
/builds/gcc/misc/gcc/testsuite/../include/emmintrin.h:1426: error:   initializing argument 1 of 'void __builtin_ia32_movntdq(long int __vector__*, long int __vector__)'

FAIL: g++.dg/other/mmintrin.C (test for excess errors)
Excess errors:
/builds/gcc/misc/gcc/testsuite/../include/emmintrin.h:1426: error: invalid conversion from 'long long int __vector__*' to 'long int __vector__*'
/builds/gcc/misc/gcc/testsuite/../include/emmintrin.h:1426: error:   initializing argument 1 of 'void __builtin_ia32_movntdq(long int __vector__*, long int __vector__)'

I don't understand this - 'long long int __vector__*' and 'long int
__vector__*' should be basically the same type (both pointers to
64-bit).

Andreas

> Regards,
> Volker
>
>
> 2004-12-08  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
>
> 	* typeck.c (build_reinterpret_cast_1): Allow cast from vector.
>
>
> Index: gcc/gcc/cp/typeck.c
> ===================================================================
> RCS file: /home/reichelt/GCC/CVS/gcc-cvs/gcc/gcc/cp/typeck.c,v
> retrieving revision 1.600
> diff -u -p -r1.600 typeck.c
> --- gcc/gcc/cp/typeck.c	26 Nov 2004 15:45:47 -0000	1.600
> +++ gcc/gcc/cp/typeck.c	8 Dec 2004 12:09:24 -0000
> @@ -4972,6 +4972,8 @@ build_reinterpret_cast_1 (tree type, tre
>      }
>    else if (TREE_CODE (type) == VECTOR_TYPE)
>      return fold_if_not_in_template (convert_to_vector (type, expr));
> +  else if (TREE_CODE (intype) == VECTOR_TYPE)
> +    return fold_if_not_in_template (convert_to_integer (type, expr));
>    else
>      {
>        if (valid_p)
> ===================================================================
>
>
>

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 NÃrnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Attachment: pgp00000.pgp
Description: PGP signature


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