This is the mail archive of the gcc-bugs@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]

[Bug c++/10611] operations on vector mode not recognized in C++


------- Additional Comments From dylan at q-games dot com  2004-07-23 14:22 -------
I seem to have gotten this working to some extent by doing the following:

This is just a quick hack but is it the right direction?  If so, I can tidy it 
up and fix the side-effects. (or someone else with more knowledge of the 
internals of gcc/cp can)

cp/cp-tree.h, change the ARITHMETIC_TYPE_P define to:

#define ARITHMETIC_TYPE_P(TYPE) \
  (CP_INTEGRAL_TYPE_P (TYPE) || TREE_CODE (TYPE) == REAL_TYPE || TREE_CODE 
(TYPE) == VECTOR_TYPE )

and

cp/typeck.c, function build_binary_op

** CHANGE **
  if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE || code0 == COMPLEX_TYPE)
      &&
      (code1 == INTEGER_TYPE || code1 == REAL_TYPE || code1 == COMPLEX_TYPE))
    {
      int none_complex = (code0 != COMPLEX_TYPE && code1 != COMPLEX_TYPE);

** TO **

  if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE || code0 == COMPLEX_TYPE || 
code0 == VECTOR_TYPE)
      &&
      (code1 == INTEGER_TYPE || code1 == REAL_TYPE || code1 == COMPLEX_TYPE || 
code1 == VECTOR_TYPE))
    {
      int none_complex = (code0 != COMPLEX_TYPE && code1 != COMPLEX_TYPE && 
code0 != VECTOR_TYPE && code1 != VECTOR_TYPE );


-- 


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


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