* [committed] x86: Emit "#" instead of calling gcc_unreachable for invalid insns.
@ 2020-02-06 16:36 Uros Bizjak
2020-02-06 17:07 ` Jakub Jelinek
0 siblings, 1 reply; 3+ messages in thread
From: Uros Bizjak @ 2020-02-06 16:36 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 492 bytes --]
Implement standard approach by emitting "#" for insns that have to be split.
Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.
2020-02-06 Uroš Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (*pushtf): Emit "#" instead of
calling gcc_unreachable in insn output.
(*pushxf): Ditto.
(*pushdf): Ditto.
(*pushsf_rex64): Ditto for alternatives other than 1.
(*pushsf): Ditto for alternatives other than 1.
Committed to mainline.
Uros.
[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 1343 bytes --]
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 496a8666643..34649c010b8 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -3032,7 +3032,7 @@
"TARGET_64BIT || TARGET_SSE"
{
/* This insn should be already split before reg-stack. */
- gcc_unreachable ();
+ return ("#");
}
[(set_attr "isa" "*,x64")
(set_attr "type" "multi")
@@ -3087,7 +3087,7 @@
""
{
/* This insn should be already split before reg-stack. */
- gcc_unreachable ();
+ return ("#");
}
[(set_attr "isa" "*,*,*,nox64,x64")
(set_attr "type" "multi")
@@ -3123,7 +3123,7 @@
""
{
/* This insn should be already split before reg-stack. */
- gcc_unreachable ();
+ return ("#");
}
[(set_attr "isa" "*,nox64,nox64,nox64,x64,sse2")
(set_attr "type" "multi")
@@ -3156,7 +3156,8 @@
"TARGET_64BIT"
{
/* Anything else should be already split before reg-stack. */
- gcc_assert (which_alternative == 1);
+ if (which_alternative != 1)
+ return ("#");
return "push{q}\t%q1";
}
[(set_attr "type" "multi,push,multi")
@@ -3169,7 +3170,8 @@
"!TARGET_64BIT"
{
/* Anything else should be already split before reg-stack. */
- gcc_assert (which_alternative == 1);
+ if (which_alternative != 1)
+ return ("#");
return "push{l}\t%1";
}
[(set_attr "type" "multi,push,multi")
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [committed] x86: Emit "#" instead of calling gcc_unreachable for invalid insns.
2020-02-06 16:36 [committed] x86: Emit "#" instead of calling gcc_unreachable for invalid insns Uros Bizjak
@ 2020-02-06 17:07 ` Jakub Jelinek
2020-02-06 17:09 ` Uros Bizjak
0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2020-02-06 17:07 UTC (permalink / raw)
To: Uros Bizjak; +Cc: gcc-patches
On Thu, Feb 06, 2020 at 05:36:43PM +0100, Uros Bizjak wrote:
> 2020-02-06 Uroš Bizjak <ubizjak@gmail.com>
>
> * config/i386/i386.md (*pushtf): Emit "#" instead of
> calling gcc_unreachable in insn output.
> (*pushxf): Ditto.
> (*pushdf): Ditto.
> (*pushsf_rex64): Ditto for alternatives other than 1.
> (*pushsf): Ditto for alternatives other than 1.
>
> Committed to mainline.
>
> Uros.
> diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
> index 496a8666643..34649c010b8 100644
> --- a/gcc/config/i386/i386.md
> +++ b/gcc/config/i386/i386.md
> @@ -3032,7 +3032,7 @@
> "TARGET_64BIT || TARGET_SSE"
> {
> /* This insn should be already split before reg-stack. */
> - gcc_unreachable ();
> + return ("#");
No need for those ()s around, just return "#"; would do.
> @@ -3156,7 +3156,8 @@
> "TARGET_64BIT"
> {
> /* Anything else should be already split before reg-stack. */
> - gcc_assert (which_alternative == 1);
> + if (which_alternative != 1)
> + return ("#");
> return "push{q}\t%q1";
Shouldn't this be then
"@
#
push{q}\t%q1
#"
instead then?
> @@ -3169,7 +3170,8 @@
> "!TARGET_64BIT"
> {
> /* Anything else should be already split before reg-stack. */
> - gcc_assert (which_alternative == 1);
> + if (which_alternative != 1)
> + return ("#");
> return "push{l}\t%1";
> }
> [(set_attr "type" "multi,push,multi")
Likewise.
Jakub
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [committed] x86: Emit "#" instead of calling gcc_unreachable for invalid insns.
2020-02-06 17:07 ` Jakub Jelinek
@ 2020-02-06 17:09 ` Uros Bizjak
0 siblings, 0 replies; 3+ messages in thread
From: Uros Bizjak @ 2020-02-06 17:09 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: gcc-patches
On Thu, Feb 6, 2020 at 6:07 PM Jakub Jelinek <jakub@redhat.com> wrote:
>
> On Thu, Feb 06, 2020 at 05:36:43PM +0100, Uros Bizjak wrote:
> > 2020-02-06 Uroš Bizjak <ubizjak@gmail.com>
> >
> > * config/i386/i386.md (*pushtf): Emit "#" instead of
> > calling gcc_unreachable in insn output.
> > (*pushxf): Ditto.
> > (*pushdf): Ditto.
> > (*pushsf_rex64): Ditto for alternatives other than 1.
> > (*pushsf): Ditto for alternatives other than 1.
> >
> > Committed to mainline.
> >
> > Uros.
>
> > diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
> > index 496a8666643..34649c010b8 100644
> > --- a/gcc/config/i386/i386.md
> > +++ b/gcc/config/i386/i386.md
> > @@ -3032,7 +3032,7 @@
> > "TARGET_64BIT || TARGET_SSE"
> > {
> > /* This insn should be already split before reg-stack. */
> > - gcc_unreachable ();
> > + return ("#");
>
> No need for those ()s around, just return "#"; would do.
Eh... will "fix".
> > @@ -3156,7 +3156,8 @@
> > "TARGET_64BIT"
> > {
> > /* Anything else should be already split before reg-stack. */
> > - gcc_assert (which_alternative == 1);
> > + if (which_alternative != 1)
> > + return ("#");
> > return "push{q}\t%q1";
>
> Shouldn't this be then
> "@
> #
> push{q}\t%q1
> #"
> instead then?
I have considered this option, but choose the above. It just looks better.
Thanks,
Uros.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-02-06 17:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-06 16:36 [committed] x86: Emit "#" instead of calling gcc_unreachable for invalid insns Uros Bizjak
2020-02-06 17:07 ` Jakub Jelinek
2020-02-06 17:09 ` Uros Bizjak
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).