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

Re: SIMPLE NOT expressions


Op do 18-07-2002, om 22:36 schreef Daniel Berlin:
> But anyway, why should is_simple_unary_expr return true for a 
> TRUTH_NOT_EXPR.

Hmmm, you're right, it should not. The truth NOT operator is not part of
the SIMPLE grammar.

> They should all be converted into EQ_EXPR's.
> case TRUTH_NOT_EXPR:
>       tmp = TREE_OPERAND (*expr_p, 0);
>       simplify_expr (&tmp, pre_p, post_p, is_simple_id, fb_rvalue);
>       *expr_p = build (EQ_EXPR, TREE_TYPE (*expr_p), tmp, 
> integer_zero_node);
>       break;
> 
> This code should always replace a TRUTH_NOT_EXPR with an EQ_EXPR.
> 
> So why do you still end up with them?

My mistake. Before I wrote this code, I looked at tree-simple.c:

      unop
              : '+'
              | '-'
              | '!'
              | '~'

But these are bitwise unops, so we're actually generating non-SIMPLE
code. Oops!

I'll fix it, thanks!

Greetz
Steven



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