public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/57054] New: Compilation with -O3 passes, with -O2 fails (ARM/NEON)
@ 2013-04-24  9:22 nizamov.shawkat at gmail dot com
  2013-04-24  9:23 ` [Bug c/57054] " nizamov.shawkat at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: nizamov.shawkat at gmail dot com @ 2013-04-24  9:22 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57054

             Bug #: 57054
           Summary: Compilation with -O3 passes, with -O2 fails (ARM/NEON)
    Classification: Unclassified
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: nizamov.shawkat@gmail.com


While learning ARM/NEON I found what seems to be a bug in GCC/ARM. 

The compilation of the same function fails with:

==========================
gcc -c -fPIC -fwrapv -O2 -fno-strict-aliasing -I/usr/include/python2.7
-march=armv7-a -mfpu=neon -mtune=cortex-a8 -fomit-frame-pointer -save-temps
bug.c                                                                          
==========================

and succeeds when -O2 is changed to -O3. 



The error message is:
==========================
In file included from bug.c:1:0:
/usr/lib/gcc/arm-linux-gnueabihf/4.7/include/arm_neon.h: In function ‘streamV’:
/usr/lib/gcc/arm-linux-gnueabihf/4.7/include/arm_neon.h:4994:48: error:
argument must be a constant
/usr/lib/gcc/arm-linux-gnueabihf/4.7/include/arm_neon.h:4994: confused by
earlier errors, bailing out
==========================


It seems that problem is connected with these intrinsics: 

vget_lane_u8(vector, lane) 
vgetq_lane_u16(vector, lane)

when the "lane" is specified as a variable, and not as a constant. 


==========================
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.7/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.7.3-1ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm
--enable-plugin --with-system-zlib --enable-objc-gc --with-cloog
--enable-cloog-backend=ppl --disable-cloog-version-check
--disable-ppl-version-check --enable-multiarch --enable-multilib
--disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16
--with-float=hard --with-mode=thumb --disable-werror --enable-checking=release
--build=arm-linux-gnueabihf --host=arm-linux-gnueabihf
--target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) 
==========================

I am using the Beagleboard XM, with a Ubuntu Raring on it (kernel is custom
compiled).
>From gcc-bugs-return-420864-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Apr 24 09:23:02 2013
Return-Path: <gcc-bugs-return-420864-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 1880 invoked by alias); 24 Apr 2013 09:23:02 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 1810 invoked by uid 48); 24 Apr 2013 09:22:59 -0000
From: "nizamov.shawkat at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/57054] Compilation with -O3 passes, with -O2 fails (ARM/NEON)
Date: Wed, 24 Apr 2013 09:23:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: nizamov.shawkat at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57054-4-mHG35n6xON@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57054-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57054-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg02009.txt.bz2
Content-length: 234


http://gcc.gnu.org/bugzilla/show_bug.cgi?idW054

--- Comment #1 from nizamov.shawkat at gmail dot com 2013-04-24 09:22:59 UTC ---
Created attachment 29926
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id)926
save-temps


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

* [Bug c/57054] Compilation with -O3 passes, with -O2 fails (ARM/NEON)
  2013-04-24  9:22 [Bug c/57054] New: Compilation with -O3 passes, with -O2 fails (ARM/NEON) nizamov.shawkat at gmail dot com
@ 2013-04-24  9:23 ` nizamov.shawkat at gmail dot com
  2013-04-24 17:35 ` [Bug target/57054] " pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: nizamov.shawkat at gmail dot com @ 2013-04-24  9:23 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57054

--- Comment #2 from nizamov.shawkat at gmail dot com 2013-04-24 09:23:48 UTC ---
Created attachment 29927
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29927
Preprocessed source stored into file, please attach this to your bugreport.


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

* [Bug target/57054] Compilation with -O3 passes, with -O2 fails (ARM/NEON)
  2013-04-24  9:22 [Bug c/57054] New: Compilation with -O3 passes, with -O2 fails (ARM/NEON) nizamov.shawkat at gmail dot com
  2013-04-24  9:23 ` [Bug c/57054] " nizamov.shawkat at gmail dot com
@ 2013-04-24 17:35 ` pinskia at gcc dot gnu.org
  2013-04-25 15:40 ` rearnsha at gcc dot gnu.org
  2024-03-23 21:24 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-04-24 17:35 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57054

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |error-recovery,
                   |                            |ice-on-invalid-code
          Component|c                           |target

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-04-24 17:35:45 UTC ---
The error message is correct, according to the ARM manual these intrinsic
require a constant value.  The reason why it works at -O3 is because the loop
is fully unrolled.


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

* [Bug target/57054] Compilation with -O3 passes, with -O2 fails (ARM/NEON)
  2013-04-24  9:22 [Bug c/57054] New: Compilation with -O3 passes, with -O2 fails (ARM/NEON) nizamov.shawkat at gmail dot com
  2013-04-24  9:23 ` [Bug c/57054] " nizamov.shawkat at gmail dot com
  2013-04-24 17:35 ` [Bug target/57054] " pinskia at gcc dot gnu.org
@ 2013-04-25 15:40 ` rearnsha at gcc dot gnu.org
  2024-03-23 21:24 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2013-04-25 15:40 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57054

Richard Earnshaw <rearnsha at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |arm
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-04-25
     Ever Confirmed|0                           |1

--- Comment #4 from Richard Earnshaw <rearnsha at gcc dot gnu.org> 2013-04-25 15:40:00 UTC ---
Andrew is right.  Nevertheless, we shouldn't ICE after such an error.


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

* [Bug target/57054] Compilation with -O3 passes, with -O2 fails (ARM/NEON)
  2013-04-24  9:22 [Bug c/57054] New: Compilation with -O3 passes, with -O2 fails (ARM/NEON) nizamov.shawkat at gmail dot com
                   ` (2 preceding siblings ...)
  2013-04-25 15:40 ` rearnsha at gcc dot gnu.org
@ 2024-03-23 21:24 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-23 21:24 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |6.0
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=63870
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed in GCC 6 by the patches that were done for PR 63870.

So closing.

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

end of thread, other threads:[~2024-03-23 21:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-24  9:22 [Bug c/57054] New: Compilation with -O3 passes, with -O2 fails (ARM/NEON) nizamov.shawkat at gmail dot com
2013-04-24  9:23 ` [Bug c/57054] " nizamov.shawkat at gmail dot com
2013-04-24 17:35 ` [Bug target/57054] " pinskia at gcc dot gnu.org
2013-04-25 15:40 ` rearnsha at gcc dot gnu.org
2024-03-23 21:24 ` pinskia 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).