From: Ian Lance Taylor <iant@golang.org>
To: gcc-patches <gcc-patches@gcc.gnu.org>,
gofrontend-dev <gofrontend-dev@googlegroups.com>
Subject: Go patch committed: Permit abstract bool expressions to remain abstract
Date: Tue, 28 Jun 2022 09:51:00 -0700 [thread overview]
Message-ID: <CAOyqgcUdAsv8=jmPv3vV79HvRKAqpYJnxg4d+HXVrNG6wMATTA@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 319 bytes --]
This patch to the Go frontend permits expressions of abstract bool to
remain abstract, rather than forcing them into the named type bool.
The test case for this is https://go.dev/cl/414755. This fixes
https://go.dev/issue/51475. Bootstrarpped and ran Go testsuite on
x86_64-pc-linux-gnu. Committed to mainline.
Ian
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1508 bytes --]
eebc9c8f0b23acddea253eb5a44f59f44f3f466b
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 16d274ce99d..a0e386ab4f6 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-927528cdc112fc51e0d07ee79e7a1254b586eabe
+28fe9fad4acb4e02083faf5503b06e3e6e8eecaf
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index f59f61d19ad..aadca9710e6 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -6829,11 +6829,12 @@ Binary_expression::do_determine_type(const Type_context* context)
{
if ((tleft->integer_type() != NULL && tright->integer_type() != NULL)
|| (tleft->float_type() != NULL && tright->float_type() != NULL)
- || (tleft->complex_type() != NULL && tright->complex_type() != NULL))
+ || (tleft->complex_type() != NULL && tright->complex_type() != NULL)
+ || (tleft->is_boolean_type() && tright->is_boolean_type()))
{
- // Both sides have an abstract integer, abstract float, or
- // abstract complex type. Just let CONTEXT determine
- // whether they may remain abstract or not.
+ // Both sides have an abstract integer, abstract float,
+ // abstract complex, or abstract boolean type. Just let
+ // CONTEXT determine whether they may remain abstract or not.
}
else if (tleft->complex_type() != NULL)
subcontext.type = tleft;
reply other threads:[~2022-06-28 16:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='CAOyqgcUdAsv8=jmPv3vV79HvRKAqpYJnxg4d+HXVrNG6wMATTA@mail.gmail.com' \
--to=iant@golang.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=gofrontend-dev@googlegroups.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).