Re: [[PING][PATCH]] Use TREE_CODE to check for void return type in SIMD function clones for OpenMP.
Kevin Stefanov <[email protected]> Tue, 4 Aug 2026 11:37:11 +0300
| Newsgroups | gmane.comp.gcc.patches |
|---|---|
| Message-ID | <CABfNUPGXSY4rjsOVqG4yCfEuM1aWVhT7-2WmVLu6MEnEcmKOWw@mail.gmail.com> |
Okay, will get to doing that. Thank you! Kev On Tue, Aug 4, 2026 at 2:57=E2=80=AFAM Andrea Pinski <[email protected]> wrote: > > On Mon, Aug 3, 2026 at 10:30=E2=80=AFAM Kevin Stefanov > <[email protected]> wrote: > > > > This change fixes an issue where functions > > decorated with: > > pragma omp declare simd > > that return void via a typedef would crash > > GCC with an ICE while compiling a program > > containing such a function, by comparing the > > TREE_CODE of the type to VOID_TYPE instead of > > directly comparing to void_type_node. > > > > gcc/ > > * omp-simd-clone.cc (simd_clone_adjust_return_type): Use TREE_C= ODE > > and VOID_TYPE when checking for void return type in adjusted functions. > > (simd_clone_adjust): Likewise. > > > > Signed-off-by: Kevin Stefanov <[email protected]> > > --- > > Hi all, > > > > Just a ping for this patch of mine. > > It fixes the ICE reported in the bugzilla item: > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111856 > > > > The test openMP program no longer crashes GCC. > > > > No merge conflicts with trunk as of 3rd August 2026. > > Boostrapped and regression tested on > > x86_64-pc-linux-gnu with enable-languages=3Dall. > > > > gcc/omp-simd-clone.cc | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/gcc/omp-simd-clone.cc b/gcc/omp-simd-clone.cc > > index 7564846fac4..2f4cfcccb17 100644 > > --- a/gcc/omp-simd-clone.cc > > +++ b/gcc/omp-simd-clone.cc > > @@ -715,7 +715,7 @@ simd_clone_adjust_return_type (struct cgraph_node *= node) > > tree t; > > > > /* Adjust the function return type. */ > > - if (orig_rettype =3D=3D void_type_node) > > + if (TREE_CODE (orig_rettype) =3D=3D VOID_TYPE) > > return; > > You should use VOID_TYPE_P instead. Yes I know it is not used > everywhere but it is better to use it. > OK with that change and an added testcase. > > Thanks, > Andrea > > > > t =3D TREE_TYPE (TREE_TYPE (fndecl)); > > if (INTEGRAL_TYPE_P (t) || POINTER_TYPE_P (t)) > > @@ -1370,7 +1370,7 @@ simd_clone_adjust (struct cgraph_node *node) > > simd_clone_adjust_argument_types (node); > > targetm.simd_clone.adjust (node); > > tree retval =3D NULL_TREE; > > - if (orig_rettype !=3D void_type_node) > > + if (TREE_CODE (orig_rettype) !=3D VOID_TYPE) > > { > > poly_uint64 veclen; > > if (INTEGRAL_TYPE_P (orig_rettype) || POINTER_TYPE_P (orig_retty= pe)) > > -- > > 2.55.0 > >