[[PING][PATCH]] Use TREE_CODE to check for void return type in SIMD function clones for OpenMP.
Kevin Stefanov <[email protected]> Mon, 3 Aug 2026 20:23:22 +0300
| Newsgroups | gmane.comp.gcc.patches |
|---|---|
| Message-ID | <[email protected]> |
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_CODE 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=111856 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=all. 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 == void_type_node) + if (TREE_CODE (orig_rettype) == VOID_TYPE) return; t = 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 = NULL_TREE; - if (orig_rettype != void_type_node) + if (TREE_CODE (orig_rettype) != VOID_TYPE) { poly_uint64 veclen; if (INTEGRAL_TYPE_P (orig_rettype) || POINTER_TYPE_P (orig_rettype)) -- 2.55.0