https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113611

            Bug ID: 113611
           Summary: [14 Regression] gcc.dg/pr110279-1.c fails on cross
                    build since gcc-14-5779-g746344dd538
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thiago.bauermann at linaro dot org
                CC: dizhao at os dot amperecomputing.com
  Target Milestone: ---
            Target: arm-linux-gnueabihf

After commit g:746344dd5380 ("swap ops in reassoc to reduce cross backedge
FMA") the following failure started appearing on cross builds of 32 bits Arm:

Running gcc:gcc.dg/dg.exp ...
FAIL: gcc.dg/pr110279-1.c scan-tree-dump-times widening_mul "Generated FMA" 3

We're seeing it with toolchains built with --host=x86_64-linux-gnu and targets
arm-linux-gnueabihf and arm-none-eabi. Both targets with and without
--with-mode=thumb.

Interestingly, with a native compiler (with --host=arm-linux-gnueabihf and
--target=arm-linux-gnueabihf) I can't reproduce the problem.

I tested on today's trunk (commit ffeab69e1ffc) and the failures are still
present.

Here's how to reproduce on an x86_64-linux machine with
--target=arm-linux-gnueabihf:

1. Build and install GCC:

$ ~/src/gcc/configure" \
    SHELL=/bin/bash \
    --with-gnu-as \
    --with-gnu-ld \
    --disable-libmudflap \
    --enable-lto \
    --enable-shared \
    --without-included-gettext \
    --enable-nls \
    --with-system-zlib \
    --disable-sjlj-exceptions \
    --enable-gnu-unique-object \
    --enable-linker-build-id \
    --disable-libstdcxx-pch \
    --enable-c99 \
    --enable-clocale=gnu \
    --enable-libstdcxx-debug \
    --enable-long-long \
    --with-cloog=no \
    --with-ppl=no \
    --with-isl=no \
    --disable-multilib \
    --with-float=hard \
    --with-fpu=vfpv3-d16 \
    --with-tune=cortex-a9 \
    --with-arch=armv7-a \
    --enable-threads=posix \
    --enable-multiarch \
    --enable-libstdcxx-time=yes \
    --enable-gnu-indirect-function \
    --with-sysroot=/var/tmp/sysroot-arm-linux-gnueabihf \
    --enable-checking=yes \
    --disable-bootstrap \
    --enable-languages=default \
    --prefix=/tmp/arm-linux-gnueabihf \
    --build=x86_64-pc-linux-gnu \
    --host=x86_64-pc-linux-gnu \
    --target=arm-linux-gnueabihf \
&& make \
        SHELL=/bin/bash \
        -w \
        -j $(nproc) \
        CFLAGS_FOR_BUILD="-pipe -g -O2" \
        CXXFLAGS_FOR_BUILD="-pipe -g -O2" \
        LDFLAGS_FOR_BUILD="-static-libgcc" \
        MAKEINFOFLAGS=--force \
        BUILD_INFO="" \
        MAKEINFO=echo \
&& make install

2. Finally, use it to compile the problematic .c file:

$ /tmp/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
/home/bauermann/src/gcc/gcc/testsuite/gcc.dg/pr110279-1.c
-fdiagnostics-plain-output -Ofast --param avoid-fma-max-bits=512 --param
tree-reassoc-width=4 -fdump-tree-widening_mul-details -S -o pr110279-1.s
$ grep "Generated FMA" pr110279-1.c.215t.widening_mul || echo FAIL
FAIL

Reply via email to