From: "Doug Evans" <dje@google.com>
To: "Pierre Muller" <muller@ics.u-strasbg.fr>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] BINOP_DIV and ptyp command
Date: Thu, 31 Jan 2008 02:57:00 -0000 [thread overview]
Message-ID: <e394668d0801301506t6d0fdce8oc6968fd179e864c8@mail.gmail.com> (raw)
In-Reply-To: <000601c8638a$ba92aaf0$2fb800d0$@u-strasbg.fr>
On Jan 30, 2008 1:54 PM, Pierre Muller <muller@ics.u-strasbg.fr> wrote:
> Doug, I like your patch but
> > + else if (TYPE_CODE (type1) == TYPE_CODE_BOOL
> > + && TYPE_CODE (type2) == TYPE_CODE_BOOL)
> > + {
> > + switch (op)
> > + {
> > + case BINOP_BITWISE_AND:
> > + case BINOP_BITWISE_IOR:
> > + case BINOP_BITWISE_XOR:
> > + case BINOP_EQUAL:
> > + case BINOP_NOTEQUAL:
> > + break;
> > + default:
> > + error (_("Invalid operation on booleans."));
> > + }
>
> I would have expected that only
> BINOP_LOGICAL_OR and BINOP_LOGICAL_AND
> are valid for Booleans.
> Am I wrong?
Note that expr1 &&/|| expr2 is handled at a higher level (to avoid
evaluating expr2 as appropriate). I'm guessing bool op bool is
special cased in value_binop because in the languages where this is
used one doesn't want the result promoted. At any rate the above is
basically just cut-n-paste-n-tweak from value_binop. [I tried to not
change too much, I basically just moved some code around - the theory
being any preserved bugs can be fixed in a later pass if the general
patch is OK.] As for why LOGICAL_AND/OR are missing here, I don't
know - presumably support for them hasn't been needed yet.
next prev parent reply other threads:[~2008-01-30 23:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-30 18:05 Doug Evans
2008-01-30 22:58 ` Pierre Muller
2008-01-31 2:57 ` Doug Evans [this message]
2008-01-31 23:01 ` Daniel Jacobowitz
2008-02-04 0:34 ` Doug Evans
-- strict thread matches above, loose matches on Subject: below --
2008-01-30 4:00 Doug Evans
2008-01-31 22:48 ` Daniel Jacobowitz
2008-01-30 3:38 Doug Evans
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e394668d0801301506t6d0fdce8oc6968fd179e864c8@mail.gmail.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=muller@ics.u-strasbg.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox