From: Marek Polacek <polacek@redhat.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Richard Sandiford <richard.sandiford@arm.com>
Subject: PATCH to add more FALLTHRU markers
Date: Tue, 27 Sep 2016 16:55:00 -0000 [thread overview]
Message-ID: <20160927164726.GG3223@redhat.com> (raw)
Currently Makefile.in contains -Wno-error for several of the insn-* files, but
after further investigation I think with this patch we won't need them anymore.
I'm not removing it until I bootstrap gcc on more arches, though. Meanwhile,
this patch at least makes the code more robust.
Richard S., can you look at the genattrtab.c bit? Thanks,
Bootstrapped/regtested on x86_64-linux, ok for trunk?
2016-09-27 Marek Polacek <polacek@redhat.com>
* config/i386/sse.md: Add FALLTHRU markers.
* genattrtab.c (write_attr_case): Also emit FALLTHRU marker.
diff --git gcc/config/i386/sse.md gcc/config/i386/sse.md
index 7e718a0..a503b19 100644
--- gcc/config/i386/sse.md
+++ gcc/config/i386/sse.md
@@ -11268,8 +11268,10 @@
{
case MODE_XI:
gcc_assert (TARGET_AVX512F);
+ /* FALLTHRU */
case MODE_OI:
gcc_assert (TARGET_AVX2);
+ /* FALLTHRU */
case MODE_TI:
gcc_assert (TARGET_SSE2);
switch (<MODE>mode)
@@ -11298,8 +11300,10 @@
case MODE_V16SF:
gcc_assert (TARGET_AVX512F);
+ /* FALLTHRU */
case MODE_V8SF:
gcc_assert (TARGET_AVX);
+ /* FALLTHRU */
case MODE_V4SF:
gcc_assert (TARGET_SSE);
@@ -11393,8 +11397,10 @@
{
case MODE_XI:
gcc_assert (TARGET_AVX512F);
+ /* FALLTHRU */
case MODE_OI:
gcc_assert (TARGET_AVX2 || TARGET_AVX512VL);
+ /* FALLTHRU */
case MODE_TI:
gcc_assert (TARGET_SSE2 || TARGET_AVX512VL);
switch (<MODE>mode)
@@ -11402,10 +11408,11 @@
case V16SImode:
case V8DImode:
if (TARGET_AVX512F)
- {
- tmp = "p<logic><ssemodesuffix>";
- break;
- }
+ {
+ tmp = "p<logic><ssemodesuffix>";
+ break;
+ }
+ /* FALLTHRU */
case V8SImode:
case V4DImode:
case V4SImode:
@@ -11419,6 +11426,7 @@
case MODE_V8SF:
gcc_assert (TARGET_AVX);
+ /* FALLTHRU */
case MODE_V4SF:
gcc_assert (TARGET_SSE);
gcc_assert (!<mask_applied>);
@@ -11489,8 +11497,10 @@
{
case MODE_XI:
gcc_assert (TARGET_AVX512F);
+ /* FALLTHRU */
case MODE_OI:
gcc_assert (TARGET_AVX2 || TARGET_AVX512VL);
+ /* FALLTHRU */
case MODE_TI:
gcc_assert (TARGET_SSE2 || TARGET_AVX512VL);
switch (<MODE>mode)
@@ -11498,21 +11508,23 @@
case V64QImode:
case V32HImode:
if (TARGET_AVX512F)
- {
- tmp = "p<logic>";
- ssesuffix = "q";
- break;
- }
+ {
+ tmp = "p<logic>";
+ ssesuffix = "q";
+ break;
+ }
+ /* FALLTHRU */
case V32QImode:
case V16HImode:
case V16QImode:
case V8HImode:
if (TARGET_AVX512VL || TARGET_AVX2 || TARGET_SSE2)
- {
- tmp = "p<logic>";
- ssesuffix = TARGET_AVX512VL ? "q" : "";
- break;
- }
+ {
+ tmp = "p<logic>";
+ ssesuffix = TARGET_AVX512VL ? "q" : "";
+ break;
+ }
+ /* FALLTHRU */
default:
gcc_unreachable ();
}
@@ -11520,6 +11532,7 @@
case MODE_V8SF:
gcc_assert (TARGET_AVX);
+ /* FALLTHRU */
case MODE_V4SF:
gcc_assert (TARGET_SSE);
tmp = "<logic>ps";
diff --git gcc/genattrtab.c gcc/genattrtab.c
index c8e166e..3b47f34 100644
--- gcc/genattrtab.c
+++ gcc/genattrtab.c
@@ -4283,6 +4283,8 @@ write_attr_case (FILE *outf, struct attr_desc *attr, struct attr_value *av,
fprintf (outf, " && asm_noperands (PATTERN (insn)) < 0)\n");
write_indent (outf, indent + 2);
fprintf (outf, " fatal_insn_not_found (insn);\n");
+ write_indent (outf, indent + 2);
+ fprintf (outf, "/* FALLTHRU */\n");
}
if (write_case_lines)
Marek
next reply other threads:[~2016-09-27 16:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-27 16:55 Marek Polacek [this message]
2016-09-27 19:00 ` Richard Sandiford
2016-09-29 17:22 ` Marek Polacek
2016-09-27 19:08 ` Florian Weimer
2016-09-27 19:22 ` Marek Polacek
2016-09-27 19:33 ` Florian Weimer
2016-09-27 19:39 ` Marek Polacek
2016-09-27 20:13 ` Jakub Jelinek
2016-09-29 17:17 ` Marek Polacek
2016-09-29 20:21 ` Jakub Jelinek
2016-09-30 21:31 ` [PATCH] FALLTHRU markers for sse.md and some cleanups Jakub Jelinek
2016-10-01 8:31 ` Uros Bizjak
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=20160927164726.GG3223@redhat.com \
--to=polacek@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=richard.sandiford@arm.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).