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 optimization/14840] [tree-ssa] fold tree_code_type[CST] and tree_code_length[CST] in GCC itself


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-04 16:11 -------
Note the definifition for static_tree_code_type and TREE_CODE_CLASS is wrong for C++, Java, 
Objective-C and some all other languages besides C.
It should be more like which is right for every language but only folds to the constant for the language 
independent trees:
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,

static const char static_tree_code_type[] = {
#include "tree.def"
  'x'
};
#undef DEFTREECODE
 
#define TREE_CODE_CLASS(CODE)                 \
  (__builtin_constant_p (CODE)		      \
   && (CODE) <= LAST_AND_UNUSED_TREE_CODE     \
   ? static_tree_code_type[(int) (CODE)]      \
   : tree_code_type[(int) (CODE)])

-- 


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


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