This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: SIMPLE NOT expressions
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- Cc: Daniel Berlin <dberlin at dberlin dot org>, Paul Brook <paul at nowt dot org>, gcc at gcc dot gnu dot org
- Date: Thu, 18 Jul 2002 21:29:20 -0400
- Subject: Re: SIMPLE NOT expressions
- Organization: Red Hat Canada
- References: <Pine.LNX.4.44.0207181635040.24156-100000@dberlin.org> <1027025148.737.71.camel@steven>
On Thu, 18 Jul 2002, Steven Bosscher wrote:
> 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!
>
But wait, the grammar is inconsistent here. On the one hand we
say that we should accept '!a' and on the other hand we are
converting '!a' into 'a != 0'. We had not had this problem before
because the C front end always generates 'a != 0' for '!a'.
For the sake of consistency I vote for removing the unary
operator ! from the grammar. After all, we define condexpr to be
'val op val'.
Thoughts?
Diego.
* tree-simple.c: Don't allow '!' as a unary operator.
Index: tree-simple.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-simple.c,v
retrieving revision 1.1.4.3
diff -d -u -p -r1.1.4.3 tree-simple.c
--- tree-simple.c 4 Jul 2002 20:32:18 -0000 1.1.4.3
+++ tree-simple.c 19 Jul 2002 01:27:37 -0000
@@ -134,7 +134,6 @@ Boston, MA 02111-1307, USA. */
unop
: '+'
| '-'
- | '!'
| '~'
binop