public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/35889]  New: spu_check_builtin_parm function fails on templates.
@ 2008-04-09 15:17 rbertran at ac dot upc dot edu
  2008-04-09 15:21 ` [Bug c++/35889] " rbertran at ac dot upc dot edu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rbertran at ac dot upc dot edu @ 2008-04-09 15:17 UTC (permalink / raw)
  To: gcc-bugs

Hello,

I'm using gcc4.3.0 for compiling cell binaries on a x86 platform.
I've some benchmarks that use c++ templates like:

template < typename T> inline
T rot_veci( T v, int n )
{
return (T) si_rotqbyi( (vector signed char)v, n );
}

When compiling, I get the following error:

error: si_rotqbyi expects an integer literal in the range [-64, 127].

So, I suppose that gcc is not able to know the value of the 'n' parameter.
Then, the builtins intrinsics checks for the literal range and raise the
error.

I've been googling and I found references [1][2] about this problem (or
similar problem). I guess that the problem comes from the
spu_check_builtin_parm function in gcc/config/spu/spu.c . I have reported
the problem to IBM cell forums, too.

Thanks in advance,
Salut!

[1] http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00130.html
[2] http://gcc.gnu.org/ml/gcc-patches/2006-12/txt00000.txt


-- 
           Summary: spu_check_builtin_parm function fails on templates.
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rbertran at ac dot upc dot edu
 GCC build triplet: x86-linux-gnu
  GCC host triplet: x86-linux-gnu
GCC target triplet: spu-elf


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


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

* [Bug c++/35889] spu_check_builtin_parm function fails on templates.
  2008-04-09 15:17 [Bug c++/35889] New: spu_check_builtin_parm function fails on templates rbertran at ac dot upc dot edu
@ 2008-04-09 15:21 ` rbertran at ac dot upc dot edu
  2008-04-09 15:25 ` rbertran at ac dot upc dot edu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rbertran at ac dot upc dot edu @ 2008-04-09 15:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rbertran at ac dot upc dot edu  2008-04-09 15:20 -------
Created an attachment (id=15456)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15456&action=view)
Temp file generated when -save-temps flag is set


-- 


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


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

* [Bug c++/35889] spu_check_builtin_parm function fails on templates.
  2008-04-09 15:17 [Bug c++/35889] New: spu_check_builtin_parm function fails on templates rbertran at ac dot upc dot edu
  2008-04-09 15:21 ` [Bug c++/35889] " rbertran at ac dot upc dot edu
@ 2008-04-09 15:25 ` rbertran at ac dot upc dot edu
  2008-04-09 15:26 ` rbertran at ac dot upc dot edu
  2008-12-29  2:30 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: rbertran at ac dot upc dot edu @ 2008-04-09 15:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rbertran at ac dot upc dot edu  2008-04-09 15:24 -------
Command executed:

spu-g++ -ffreestanding -Wall -ffast-math -fno-rtti -fno-exceptions
--function-sections --data-sections -fsigned-char -I -I../.. -I../../include
-I./org -I. `pkg-config --cflags opencv` -I/usr/spu/include
-I../../cellsdk/spu/include -c cvHaarDetectObjects_spu.cpp -o
obj/cvHaarDetectObjects_spu.ospu -save-temps


-- 


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


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

* [Bug c++/35889] spu_check_builtin_parm function fails on templates.
  2008-04-09 15:17 [Bug c++/35889] New: spu_check_builtin_parm function fails on templates rbertran at ac dot upc dot edu
  2008-04-09 15:21 ` [Bug c++/35889] " rbertran at ac dot upc dot edu
  2008-04-09 15:25 ` rbertran at ac dot upc dot edu
@ 2008-04-09 15:26 ` rbertran at ac dot upc dot edu
  2008-12-29  2:30 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: rbertran at ac dot upc dot edu @ 2008-04-09 15:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rbertran at ac dot upc dot edu  2008-04-09 15:25 -------
Created an attachment (id=15457)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15457&action=view)
Temp file generated when -save-temps flag is set


-- 


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


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

* [Bug c++/35889] spu_check_builtin_parm function fails on templates.
  2008-04-09 15:17 [Bug c++/35889] New: spu_check_builtin_parm function fails on templates rbertran at ac dot upc dot edu
                   ` (2 preceding siblings ...)
  2008-04-09 15:26 ` rbertran at ac dot upc dot edu
@ 2008-12-29  2:30 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-29  2:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2008-12-29 02:28 -------
If you are using the specific intrinsics, you need to use a literal n here.

Try:
template < typename T> inline
T rot_veci( T v, const int n ) __atrribute__((always_inline))


template < typename T> inline
T rot_veci( T v, const int n )
{
return (T) si_rotqbyi( (qword)v, n );
}

Other wise you can use the generic intrinsics which will then do the correct
thing.


This is not a bug really because by default GCC does not do any constant prop
or inlining at -O0 except functions marked as always_inline with a const marked
argument.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-12-29  2:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-09 15:17 [Bug c++/35889] New: spu_check_builtin_parm function fails on templates rbertran at ac dot upc dot edu
2008-04-09 15:21 ` [Bug c++/35889] " rbertran at ac dot upc dot edu
2008-04-09 15:25 ` rbertran at ac dot upc dot edu
2008-04-09 15:26 ` rbertran at ac dot upc dot edu
2008-12-29  2:30 ` pinskia at gcc dot gnu dot 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).