http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53773
Bug #: 53773 Summary: Vectorizer generates non-canonical multiplies Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: wschm...@gcc.gnu.org CC: berg...@vnet.ibm.com, rguent...@suse.de There are two tests in the regression testsuite for which the vectorizer generates GIMPLE multiplies that are not canonical. Specifically, they generate multiplies where rhs1 is a constant and rhs2 is an SSA name. The two tests are: (1) gcc.dg/vect/pr50451.c (2) gfortran.dg/pr17143.f90 For (1), the generated GIMPLE includes: integral_7 = 10 * integral_17; ... decimal_8 = 10 * decimal_18; For (2): i.3_3 = 2 * prephitmp.9_23; Probably best just to run these tests from the test suite to reproduce, but here are the commands I used. Example invocation for (1): /home/wschmidt/gcc/build/gcc-mainline-slsrpt1a-debug/gcc/xgcc -B/home/wschmidt/gcc/build/gcc-mainline-slsrpt1a-debug/gcc/ /home/wschmidt/gcc/gcc-mainline-slsrpt1a/gcc/testsuite/gcc.dg/vect/pr50451.c -fno-diagnostics-show-caret -flto -maltivec -mvsx -mno-allow-movmisalign -ftree-vectorize -fno-vect-cost-model -fno-common -O2 -fdump-tree-vect-details -S -m64 -o pr50451.s Example invocation for (2): /home/wschmidt/gcc/install/gcc-mainline-slsrpt1a-debug/bin/gfortran -B/home/wschmidt/gcc/build/gcc-mainline-slsrpt1a-debug/gcc/testsuite/gfortran3/../../ -B/home/wschmidt/gcc/build/gcc-mainline-slsrpt1a-debug/powerpc64-linux/32/libgfortran/ /home/wschmidt/gcc/gcc-mainline-slsrpt1a/gcc/testsuite/gfortran.dg/pr17143.f90 -fno-diagnostics-show-caret -O3 -fomit-frame-pointer -std=legacy -B/home/wschmidt/gcc/build/gcc-mainline-slsrpt1a-debug/powerpc64-linux/32/libgfortran/.libs -L/home/wschmidt/gcc/build/gcc-mainline-slsrpt1a-debug/powerpc64-linux/32/libgfortran/.libs -L/home/wschmidt/gcc/build/gcc-mainline-slsrpt1a-debug/powerpc64-linux/32/libgfortran/.libs -lm -m32 -o ./pr17143.exe