[(pushed)] riscv: fix error: control reaches end of non-void function
Commit Message
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(+)
Comments
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!
@@ -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))])