qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 29/34] tcg: Reorg function calls


From: Ilya Leoshkevich
Subject: Re: [PATCH v3 29/34] tcg: Reorg function calls
Date: Tue, 06 Dec 2022 16:58:58 +0100
User-agent: Evolution 3.46.1 (3.46.1-1.fc37)

On Tue, 2022-12-06 at 09:49 -0600, Richard Henderson wrote:
> On 12/6/22 09:28, Ilya Leoshkevich wrote:
> > > +            switch (TCG_TARGET_CALL_ARG_I64) {
> > > +            case TCG_CALL_ARG_EVEN:
> > 
> > On a s390x host with gcc-11.0.1-0.3.1.ibm.fc34.s390x I get:
> > 
> > FAILED: libqemu-aarch64-softmmu.fa.p/tcg_tcg.c.o
> > ../tcg/tcg.c: In function ‘init_call_layout’:
> > ../tcg/tcg.c:739:13: error: case value ‘1’ not in enumerated type
> > [-Werror=switch]
> >    739 |             case TCG_CALL_ARG_EVEN:
> >        |             ^~~~
> > 
> > The following helps:
> 
> Yes, I found and fixed this since.
> 
> > --- a/tcg/tcg.c
> > +++ b/tcg/tcg.c
> > @@ -735,7 +735,7 @@ static void init_call_layout(TCGHelperInfo
> > *info)
> >               break;
> >   
> >           case TCG_TYPE_I64:
> > -            switch (TCG_TARGET_CALL_ARG_I64) {
> > +            switch ((TCGCallArgumentKind)TCG_TARGET_CALL_ARG_I64)
> > {
> >               case TCG_CALL_ARG_EVEN:
> >                   layout_arg_even(&cum);
> >                   /* fall through */
> > 
> > This looks like a gcc bug to me.
> 
> The gcc "bug" is only in not being sufficiently verbose.  It should
> say something about 
> *differing* enumerated types, and perhaps name them.
> 
> Back in patch 20, tcg/s390x/tcg-target.h,
> 
> -#define TCG_TARGET_CALL_ARG_I64         TCG_CALL_RET_NORMAL
> +#define TCG_TARGET_CALL_ARG_I64         TCG_CALL_ARG_NORMAL
> 
> 
> r~

I looked at this line and completely missed the RET vs ARG difference.
Your diff fixes the issue for me too, of course.
Thanks!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]