public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH (pushed)] riscv: fix error: control reaches end of non-void function
@ 2023-05-03 14:37 Martin Liška
  2023-05-03 14:54 ` Palmer Dabbelt
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Liška @ 2023-05-03 14:37 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jakub Jelinek

It's pre-approved by Jakub.

Cheers,
Martin

Fixes:
gcc/config/riscv/sync.md:66:1: error: control reaches end of non-void function [-Werror=return-type]
66 |   [(set (attr "length") (const_int 4))])
   | ^

	PR target/109713

gcc/ChangeLog:

	* config/riscv/sync.md: Add gcc_unreachable to a switch.
---
 gcc/config/riscv/sync.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/config/riscv/sync.md b/gcc/config/riscv/sync.md
index 6e7c762ac57..9fc626267de 100644
--- a/gcc/config/riscv/sync.md
+++ b/gcc/config/riscv/sync.md
@@ -62,6 +62,8 @@ (define_insn "mem_thread_fence_1"
 	return "fence\tr,rw";
     else if (model == MEMMODEL_RELEASE)
 	return "fence\trw,w";
+    else
+	gcc_unreachable ();
   }
   [(set (attr "length") (const_int 4))])
 
-- 
2.40.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH (pushed)] riscv: fix error: control reaches end of non-void function
  2023-05-03 14:37 [PATCH (pushed)] riscv: fix error: control reaches end of non-void function Martin Liška
@ 2023-05-03 14:54 ` Palmer Dabbelt
  0 siblings, 0 replies; 2+ messages in thread
From: Palmer Dabbelt @ 2023-05-03 14:54 UTC (permalink / raw)
  To: mliska; +Cc: gcc-patches, jakub

On Wed, 03 May 2023 07:37:07 PDT (-0700), mliska@suse.cz wrote:
> It's pre-approved by Jakub.
>
> Cheers,
> Martin
>
> Fixes:
> gcc/config/riscv/sync.md:66:1: error: control reaches end of non-void function [-Werror=return-type]
> 66 |   [(set (attr "length") (const_int 4))])
>    | ^
>
> 	PR target/109713
>
> gcc/ChangeLog:
>
> 	* config/riscv/sync.md: Add gcc_unreachable to a switch.
> ---
>  gcc/config/riscv/sync.md | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/gcc/config/riscv/sync.md b/gcc/config/riscv/sync.md
> index 6e7c762ac57..9fc626267de 100644
> --- a/gcc/config/riscv/sync.md
> +++ b/gcc/config/riscv/sync.md
> @@ -62,6 +62,8 @@ (define_insn "mem_thread_fence_1"
>  	return "fence\tr,rw";
>      else if (model == MEMMODEL_RELEASE)
>  	return "fence\trw,w";
> +    else
> +	gcc_unreachable ();
>    }
>    [(set (attr "length") (const_int 4))])

Thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-03 14:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-03 14:37 [PATCH (pushed)] riscv: fix error: control reaches end of non-void function Martin Liška
2023-05-03 14:54 ` Palmer Dabbelt

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).