aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2016-08-10 18:56:35 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2016-08-10 18:56:35 +0000
commit4cc1fc4f9eefdfdae09ecb7f4cff9a284b1b4e8b (patch)
treef0af15a57dfdab3f9e66d033ad33fdf6825291c0 /gcc
parent5a02adf63e73d0894b72f13505a4a7e6d154ea20 (diff)
downloadgcc-4cc1fc4f9eefdfdae09ecb7f4cff9a284b1b4e8b.zip
gcc-4cc1fc4f9eefdfdae09ecb7f4cff9a284b1b4e8b.tar.gz
gcc-4cc1fc4f9eefdfdae09ecb7f4cff9a284b1b4e8b.tar.bz2
compiler: annotate or fix fall through cases in switch statements
A new GCC warning, -Wimplicit-fallthrough, detected these three cases where a switch case falls through to another. One of them looks like a bug, so I fixed it; the two other look like intended fall throughs so I just added a "fall through" comment to suppress the GCC warning. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Reviewed-on: https://go-review.googlesource.com/26695 From-SVN: r239332
Diffstat (limited to 'gcc')
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/escape.cc2
-rw-r--r--gcc/go/gofrontend/expressions.cc1
3 files changed, 4 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 72d8f1e..68e414b 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-8da2129a005cc1f44d4d993b0b7312b64c0d68a4
+5e05b7bc947231b4d5a8327bf63e2fa648e51dc7
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/escape.cc b/gcc/go/gofrontend/escape.cc
index 433477e..ee7fa09 100644
--- a/gcc/go/gofrontend/escape.cc
+++ b/gcc/go/gofrontend/escape.cc
@@ -281,6 +281,7 @@ Node::op_format() const
{
case Runtime::PANIC:
op << "panic";
+ break;
case Runtime::APPEND:
op << "append";
@@ -1923,6 +1924,7 @@ Escape_analysis_assign::assign(Node* dst, Node* src)
if (!e->type()->has_pointer())
break;
}
+ // Fall through.
case Expression::EXPRESSION_CONVERSION:
case Expression::EXPRESSION_TYPE_GUARD:
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 71a84c7..bdc14aa 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -5767,6 +5767,7 @@ Binary_expression::do_get_backend(Translate_context* context)
case OPERATOR_DIV:
if (left_type->float_type() != NULL || left_type->complex_type() != NULL)
break;
+ // Fall through.
case OPERATOR_MOD:
is_idiv_op = true;
break;