This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/14840] [tree-ssa] fold tree_code_type[CST] and tree_code_length[CST] in GCC itself
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Apr 2004 16:11:29 -0000
- Subject: [Bug optimization/14840] [tree-ssa] fold tree_code_type[CST] and tree_code_length[CST] in GCC itself
- References: <20040403233411.14840.kazu@cs.umass.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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