public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/53538] New: Compile error with ARM NEON intrinsics and certain compile flags
@ 2012-05-31 11:13 ahelm at gmx dot net
  2012-05-31 16:28 ` [Bug target/53538] " pinskia at gcc dot gnu.org
  2012-05-31 16:31 ` jakub at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: ahelm at gmx dot net @ 2012-05-31 11:13 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53538
           Summary: Compile error with ARM NEON intrinsics and certain
                    compile flags
    Classification: Unclassified
           Product: gcc
           Version: 4.5.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ahelm@gmx.net


Created attachment 27529
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27529
test program

The attached test program fails to compile with the following command line
(cross compiling for ARM neon on Ubuntu):

gcc -c test_an_bug.c -o test_an_bug.o -O2 -g -Wall -march=armv7-a
-mlittle-endian -mfloat-abi=hard -mfpu=neon -mtp=cp15 -mthumb

Error message:

In file included from test_an_bug.c:2:0:
[...]/4.5/include/arm_neon.h: In function 'main':
[...]/4.5/include/arm_neon.h:4968:49: error: argument must be a constant
[...]/4.5/include/arm_neon.h:4968: confused by earlier errors, bailing out

However it builds without warning when either:
1) use -O3 instead of -O2 or
2) use -funroll-loops
3) if you move the intrinsic (vget_lane_u16) outside the for loop
4) if you use literals instead of the variable j

I haven't found any detailed documentation on the use of this intrinsic, but it
looks a bit odd if it only accepts literals as parameters. 
At what point did we give up pass-by-value for int?
And it certainly is odd that it compiles fine with different optimization
levels...

Note 1: This is not the original code, it is the minimum test program I derived
from it.

Note 2: It seems to fail on all compiler versions from 4.5 to 4.7 I've tried.


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

* [Bug target/53538] Compile error with ARM NEON intrinsics and certain compile flags
  2012-05-31 11:13 [Bug c/53538] New: Compile error with ARM NEON intrinsics and certain compile flags ahelm at gmx dot net
@ 2012-05-31 16:28 ` pinskia at gcc dot gnu.org
  2012-05-31 16:31 ` jakub at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-05-31 16:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-05-31 16:24:43 UTC ---
They are defined by the ARM compiler which has them documented here:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0491c/BABJFCGC.html

With either -funroll-loops or -O3 (which enables sometimes full unrolling), the
compiler is able to figure out the argument j is a constant as it duplicates it
4 times.


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

* [Bug target/53538] Compile error with ARM NEON intrinsics and certain compile flags
  2012-05-31 11:13 [Bug c/53538] New: Compile error with ARM NEON intrinsics and certain compile flags ahelm at gmx dot net
  2012-05-31 16:28 ` [Bug target/53538] " pinskia at gcc dot gnu.org
@ 2012-05-31 16:31 ` jakub at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-05-31 16:31 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-05-31 16:28:32 UTC ---
Well, that confused by earlier errors, bailing out (i.e. ICE without release
checking) is still a compiler bug, bad error recovery.


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

end of thread, other threads:[~2012-05-31 16:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-31 11:13 [Bug c/53538] New: Compile error with ARM NEON intrinsics and certain compile flags ahelm at gmx dot net
2012-05-31 16:28 ` [Bug target/53538] " pinskia at gcc dot gnu.org
2012-05-31 16:31 ` jakub 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).