[Bug c++/12566] ugly ERROR_MARK use
carlo at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sun Oct 12 01:06:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12566
------- Additional Comments From carlo at gcc dot gnu dot org 2003-10-12 01:06 -------
On the topic of ugly ERROR_MARK usage,
are you aware of the fact that C_EXP_ORIGINAL_CODE,
defined in c-common.h, is used to (sometimes) read
the value of tree_exp::complexity of expressions
that never use (or explicitely set) C_EXP_ORIGINAL_CODE?
The result is that the value returned by C_EXP_ORIGINAL_CODE
for those expressions, which is 0 as a result of the
memset() in make_node(), is interpreted as ERROR_MARK,
which coincidently has value 0 too.
In most cases this results in an boolean expression
to evaluate to false, like in:
if (C_EXP_ORIGINAL_CODE(exp) == PLUS_EXPR)
but a for example in parser_build_binary_op() it is
indirectly also used as array index, doing something
like:
code1 = C_EXP_ORIGINAL_CODE (arg1);
[...]
use TREE_CODE_CLASS (code1)
I ran into this when I tried to use the apparently by
most expression types unused 'complexity' element for
something else.
More information about the Gcc-bugs
mailing list