From: Richard Biener Date: Fri, 28 Nov 2025 09:06:58 +0000 (+0100) Subject: tree-optimization/122844 - bogus reduction chain detection X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c90563edba3a7e9b5a25ef2f031cf909c2926214;p=thirdparty%2Fgcc.git tree-optimization/122844 - bogus reduction chain detection We may not strip sign-conversions around MIN/MAX operations. PR tree-optimization/122844 * tree-vect-slp.cc (vect_analyze_slp_reduc_chain): Only try stripping sign conversions around ops where this is valid. * gcc.dg/vect/vect-pr122844.c: New testcase. --- diff --git a/gcc/testsuite/gcc.dg/vect/vect-pr122844.c b/gcc/testsuite/gcc.dg/vect/vect-pr122844.c new file mode 100644 index 00000000000..52da3ec4cb3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-pr122844.c @@ -0,0 +1,34 @@ +#include "tree-vect.h" + +short c = 2; +short l = 6; +unsigned char m; +int k; +int a = -1; +unsigned long long t[2][2]; + +static void b( short c, int k, short l, unsigned m) +{ + for( signed x=0; x<2; x++) + for( int ab=0; abstmt; if (!is_gimple_assign (stmt)