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++/12566] ugly ERROR_MARK use


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.


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