public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/96682] New: Arm: Wrong code generated for MVE with -O1 and above optimization options.
@ 2020-08-18 16:44 sripar01 at gcc dot gnu.org
  2020-08-18 16:44 ` [Bug c/96682] " sripar01 at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: sripar01 at gcc dot gnu.org @ 2020-08-18 16:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96682
           Summary: Arm: Wrong code generated for MVE with -O1 and above
                    optimization options.
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sripar01 at gcc dot gnu.org
  Target Milestone: ---
            Target: arm

Created attachment 49074
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49074&action=edit
test case

$ arm-none-eabi -v
Using built-in specs.
COLLECT_GCC=../MVE_PUBLIC/gcc-arm-none-eabi-10-2020-q2-preview/bin/arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/media/sripar01/2tb_work/MVE_PUBLIC/gcc-arm-none-eabi-10-2020-q2-preview/bin/../lib/gcc/arm-none-eabi/10.1.1/lto-wrapper
Target: arm-none-eabi
Configured with:
/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-13_20200625_1593044217/src/gcc/configure
--target=arm-none-eabi
--prefix=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-13_20200625_1593044217/install-native
--libexecdir=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-13_20200625_1593044217/install-native/lib
--infodir=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-13_20200625_1593044217/install-native/share/doc/gcc-arm-none-eabi/info
--mandir=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-13_20200625_1593044217/install-native/share/doc/gcc-arm-none-eabi/man
--htmldir=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-13_20200625_1593044217/install-native/share/doc/gcc-arm-none-eabi/html
--pdfdir=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-13_20200625_1593044217/install-native/share/doc/gcc-arm-none-eabi/pdf
--enable-languages=c,c++ --enable-plugins --disable-decimal-float
--disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath
--disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared
--disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib
--with-headers=yes --with-python-dir=share/gcc-arm-none-eabi
--with-sysroot=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-13_20200625_1593044217/install-native/arm-none-eabi
--build=x86_64-linux-gnu --host=x86_64-linux-gnu
--with-gmp=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-13_20200625_1593044217/build-native/host-libs/usr
--with-mpfr=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-13_20200625_1593044217/build-native/host-libs/usr
--with-mpc=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-13_20200625_1593044217/build-native/host-libs/usr
--with-isl=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-13_20200625_1593044217/build-native/host-libs/usr
--with-libelf=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-13_20200625_1593044217/build-native/host-libs/usr
--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm'
--with-pkgversion='GNU Arm Embedded Toolchain 10-2020-q2-preview'
--with-multilib-list=rmprofile,aprofile
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.1.1 20200529 (release) (GNU Arm Embedded Toolchain
10-2020-q2-preview)

$ arm-none-eabi-gcc bug.c -mfloat-abi=hard -march=armv8.1-m.main+mve.fp -O3 -c
x.i:65:1: warning: return type defaults to 'int' [-Wimplicit-int]
   65 | fn1(__fp16 *pSrc) {
      | ^~~
/tmp/ccOTL3zZ.s: Assembler messages:
/tmp/ccOTL3zZ.s:40: Error: instruction does not support writeback -- `vldr.16
s15,[r0]!'


vldr.16 and vstr.16 does not support write back for MVE, wrong code-gen for the
attached test case bug.c.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c/96682] Arm: Wrong code generated for MVE with -O1 and above optimization options.
  2020-08-18 16:44 [Bug c/96682] New: Arm: Wrong code generated for MVE with -O1 and above optimization options sripar01 at gcc dot gnu.org
@ 2020-08-18 16:44 ` sripar01 at gcc dot gnu.org
  2020-08-19 12:23 ` cvs-commit at gcc dot gnu.org
  2020-10-19 12:21 ` [Bug target/96682] " sripar01 at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: sripar01 at gcc dot gnu.org @ 2020-08-18 16:44 UTC (permalink / raw)
  To: gcc-bugs

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

SRINATH PARVATHANENI <sripar01 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-08-18

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c/96682] Arm: Wrong code generated for MVE with -O1 and above optimization options.
  2020-08-18 16:44 [Bug c/96682] New: Arm: Wrong code generated for MVE with -O1 and above optimization options sripar01 at gcc dot gnu.org
  2020-08-18 16:44 ` [Bug c/96682] " sripar01 at gcc dot gnu.org
@ 2020-08-19 12:23 ` cvs-commit at gcc dot gnu.org
  2020-10-19 12:21 ` [Bug target/96682] " sripar01 at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-08-19 12:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Joe Ramsay
<joeramsay@gcc.gnu.org>:

https://gcc.gnu.org/g:10e0d2010f0597e6ae7efb88142b8820608c585e

commit r10-8643-g10e0d2010f0597e6ae7efb88142b8820608c585e
Author: Joe Ramsay <joe.ramsay@arm.com>
Date:   Wed Jul 29 14:04:28 2020 +0100

    arm: Enable no-writeback vldr.16/vstr.16.

    There was previously no way to specify that a register operand cannot
    have any writeback modifiers, and as a result the argument to vldr.16
    and vstr.16 could be erroneously output with post-increment. This
    change adds a constraint which forbids all writeback, and
    selects it in the relevant case for vldr.16 and vstr.16

    gcc/ChangeLog:

            PR target/96682
            * config/arm/arm-protos.h (arm_coproc_mem_operand_no_writeback):
            Declare prototype.
            (arm_mve_mode_and_operands_type_check): Declare prototype.
            * config/arm/arm.c (arm_coproc_mem_operand): Refactor to use
            _arm_coproc_mem_operand.
            (arm_coproc_mem_operand_wb): New function to cover full, limited
            and no writeback.
            (arm_coproc_mem_operand_no_writeback): New constraint for memory
            operand with no writeback.
            (arm_print_operand): Extend 'E' specifier for memory operand
            that does not support writeback.
            (arm_mve_mode_and_operands_type_check): New constraint check for
            MVE memory operands.
            * config/arm/constraints.md: Add Uj constraint for VFP vldr.16
            and vstr.16.
            * config/arm/vfp.md (*mov_load_vfp_hf16): New pattern for
            vldr.16.
            (*mov_store_vfp_hf16): New pattern for vstr.16.
            (*mov<mode>_vfp_<mode>16): Remove MVE moves.

    gcc/testsuite/ChangeLog:

            PR target/96682
            * gcc.target/arm/mve/intrinsics/mve-vldstr16-no-writeback.c: New
test.

    (cherry picked from commit 9f6abd2db90151c8966d2d2718ab8c299abf1105)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/96682] Arm: Wrong code generated for MVE with -O1 and above optimization options.
  2020-08-18 16:44 [Bug c/96682] New: Arm: Wrong code generated for MVE with -O1 and above optimization options sripar01 at gcc dot gnu.org
  2020-08-18 16:44 ` [Bug c/96682] " sripar01 at gcc dot gnu.org
  2020-08-19 12:23 ` cvs-commit at gcc dot gnu.org
@ 2020-10-19 12:21 ` sripar01 at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: sripar01 at gcc dot gnu.org @ 2020-10-19 12:21 UTC (permalink / raw)
  To: gcc-bugs

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

SRINATH PARVATHANENI <sripar01 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #2 from SRINATH PARVATHANENI <sripar01 at gcc dot gnu.org> ---
Pushed fix to trunk and gcc-10 branches.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-19 12:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18 16:44 [Bug c/96682] New: Arm: Wrong code generated for MVE with -O1 and above optimization options sripar01 at gcc dot gnu.org
2020-08-18 16:44 ` [Bug c/96682] " sripar01 at gcc dot gnu.org
2020-08-19 12:23 ` cvs-commit at gcc dot gnu.org
2020-10-19 12:21 ` [Bug target/96682] " sripar01 at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).