public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/40009]  New: altivec __builtin_vec_ctu has wrong tyes
@ 2009-05-03 11:05 rguenth at gcc dot gnu dot org
  2009-05-03 11:06 ` [Bug target/40009] " rguenth at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-03 11:05 UTC (permalink / raw)
  To: gcc-bugs

It should have an unsigned vector result

  def_builtin (MASK_ALTIVEC, "__builtin_vec_ctu", opaque_ftype_opaque_int,
ALTIVEC_BUILTIN_VEC_CTU);

this casues

FAIL: gcc.c-torture/compile/pr39943.c  -O3 -fomit-frame-pointer  (internal
compiler error)
FAIL: gcc.c-torture/compile/pr39943.c  -O3 -fomit-frame-pointer  (test for
excess errors)
FAIL: gcc.c-torture/compile/pr39943.c  -O3 -fomit-frame-pointer -funroll-loops 
(internal compiler error)
FAIL: gcc.c-torture/compile/pr39943.c  -O3 -fomit-frame-pointer -funroll-loops 
(test for excess errors)
FAIL: gcc.c-torture/compile/pr39943.c  -O3 -fomit-frame-pointer
-funroll-all-loops -finline-functions  (internal compiler error)
FAIL: gcc.c-torture/compile/pr39943.c  -O3 -fomit-frame-pointer
-funroll-all-loops -finline-functions  (test for excess errors)
FAIL: gcc.c-torture/compile/pr39943.c  -O3 -g  (internal compiler error)
FAIL: gcc.c-torture/compile/pr39943.c  -O3 -g  (test for excess errors)

The failure is:

[karma] f90/bug% gcc45 -O3
/opt/gcc/_gcc_clean/gcc/testsuite/gcc.c-torture/compile/pr39943.c
/opt/gcc/_gcc_clean/gcc/testsuite/gcc.c-torture/compile/pr39943.c: In function
'gl_fog_index_pixels':
/opt/gcc/_gcc_clean/gcc/testsuite/gcc.c-torture/compile/pr39943.c:1: error:
invalid conversion in gimple call
vector unsigned int

__vector signed int

# .MEM_98 = VDEF <.MEM_97>
vect_var_.47_88 = __builtin_altivec_vctuxs (vect_var_.46_87);


-- 
           Summary: altivec __builtin_vec_ctu has wrong tyes
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org
GCC target triplet: powerpc*-*-*


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


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

* [Bug target/40009] altivec __builtin_vec_ctu has wrong tyes
  2009-05-03 11:05 [Bug target/40009] New: altivec __builtin_vec_ctu has wrong tyes rguenth at gcc dot gnu dot org
@ 2009-05-03 11:06 ` rguenth at gcc dot gnu dot org
  2009-05-03 11:12 ` rguenth at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-03 11:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2009-05-03 11:06 -------
Looking at rs6000.c likely many more builtins are affected.


-- 


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


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

* [Bug target/40009] altivec __builtin_vec_ctu has wrong tyes
  2009-05-03 11:05 [Bug target/40009] New: altivec __builtin_vec_ctu has wrong tyes rguenth at gcc dot gnu dot org
  2009-05-03 11:06 ` [Bug target/40009] " rguenth at gcc dot gnu dot org
@ 2009-05-03 11:12 ` rguenth at gcc dot gnu dot org
  2009-05-03 11:16 ` rguenth at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-03 11:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2009-05-03 11:12 -------
Huh.  It uses build_opaque_vector_type, but

/* Nonzero in an IDENTIFIER_NODE if the name is a local alias, whose
   uses are to be substituted for uses of the TREE_CHAINed identifier.  */
#define TYPE_VECTOR_OPAQUE(NODE) \
  (VECTOR_TYPE_CHECK (NODE)->base.deprecated_flag)

WTF??

It looks like frontend concept - see c-common.c:vector_targets_convertible_p.

Why is this frontend specific when a _backend_ sets it?  What semantics
is it supposed to have - yeah well, proper documentation for the flag
would have been a start...


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bonzini at gnu dot org


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


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

* [Bug target/40009] altivec __builtin_vec_ctu has wrong tyes
  2009-05-03 11:05 [Bug target/40009] New: altivec __builtin_vec_ctu has wrong tyes rguenth at gcc dot gnu dot org
  2009-05-03 11:06 ` [Bug target/40009] " rguenth at gcc dot gnu dot org
  2009-05-03 11:12 ` rguenth at gcc dot gnu dot org
@ 2009-05-03 11:16 ` rguenth at gcc dot gnu dot org
  2009-05-03 11:18 ` rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-03 11:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2009-05-03 11:16 -------
IMHO the frontend should, for TYPE_VECTOR_OPAQUE "conversions" emit
VIEW_CONVERT_EXPRs to honour GIMPLE/GENERIC type system requirements.


-- 


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


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

* [Bug target/40009] altivec __builtin_vec_ctu has wrong tyes
  2009-05-03 11:05 [Bug target/40009] New: altivec __builtin_vec_ctu has wrong tyes rguenth at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-05-03 11:16 ` rguenth at gcc dot gnu dot org
@ 2009-05-03 11:18 ` rguenth at gcc dot gnu dot org
  2009-05-03 12:11 ` bonzini at gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-03 11:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2009-05-03 11:18 -------
For the case in question, vctuxs doesn't look like an instruction that
has an opaque return type.


-- 


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


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

* [Bug target/40009] altivec __builtin_vec_ctu has wrong tyes
  2009-05-03 11:05 [Bug target/40009] New: altivec __builtin_vec_ctu has wrong tyes rguenth at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2009-05-03 11:18 ` rguenth at gcc dot gnu dot org
@ 2009-05-03 12:11 ` bonzini at gnu dot org
  2009-05-03 13:29 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bonzini at gnu dot org @ 2009-05-03 12:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from bonzini at gnu dot org  2009-05-03 12:11 -------
In many cases, opaque types are used in the prototypes just to avoid warnings.

You're right that the front-end should insert VIEW_CONVERT_EXPRs.


-- 


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


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

* [Bug target/40009] altivec __builtin_vec_ctu has wrong tyes
  2009-05-03 11:05 [Bug target/40009] New: altivec __builtin_vec_ctu has wrong tyes rguenth at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2009-05-03 12:11 ` bonzini at gnu dot org
@ 2009-05-03 13:29 ` rguenth at gcc dot gnu dot org
  2009-05-03 14:00 ` bonzini at gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-03 13:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2009-05-03 13:29 -------
Ok, so the builtins should have a proper, but opaque vector type (like for
VEC_CTU it should be an unsigned vector type, not a signed one).

Thus, the TYPE_VECTOR_OPAQUE description should read like

/* Nonzero in a VECTOR_TYPE if the frontends should not emit warnings
   about missing conversions to other vector types of the same size.  */
#define TYPE_VECTOR_OPAQUE(NODE) \
  (VECTOR_TYPE_CHECK (NODE)->base.deprecated_flag)

?


-- 


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


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

* [Bug target/40009] altivec __builtin_vec_ctu has wrong tyes
  2009-05-03 11:05 [Bug target/40009] New: altivec __builtin_vec_ctu has wrong tyes rguenth at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2009-05-03 13:29 ` rguenth at gcc dot gnu dot org
@ 2009-05-03 14:00 ` bonzini at gnu dot org
  2009-05-03 14:25 ` bonzini at gnu dot org
  2009-05-03 14:34 ` bonzini at gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: bonzini at gnu dot org @ 2009-05-03 14:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from bonzini at gnu dot org  2009-05-03 14:00 -------
> Ok, so the builtins should have a proper, but opaque vector type (like for
> VEC_CTU it should be an unsigned vector type, not a signed one).

No, there's no reason to have >1 opaque vector type for a single mode (or even
for a single width).

BTW, the opaque vector types were actually invented for SPE, and only later
recycled for the implementation of Altivec.

> Nonzero in a VECTOR_TYPE if the frontends should not emit warnings
> about missing conversions to other vector types of the same size.

Yes, will commit a patch to change it.


-- 


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


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

* [Bug target/40009] altivec __builtin_vec_ctu has wrong tyes
  2009-05-03 11:05 [Bug target/40009] New: altivec __builtin_vec_ctu has wrong tyes rguenth at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2009-05-03 14:00 ` bonzini at gnu dot org
@ 2009-05-03 14:25 ` bonzini at gnu dot org
  2009-05-03 14:34 ` bonzini at gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: bonzini at gnu dot org @ 2009-05-03 14:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from bonzini at gnu dot org  2009-05-03 14:25 -------
What's remaining was already in the database.

*** This bug has been marked as a duplicate of 30210 ***


-- 

bonzini at gnu dot org changed:

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


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


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

* [Bug target/40009] altivec __builtin_vec_ctu has wrong tyes
  2009-05-03 11:05 [Bug target/40009] New: altivec __builtin_vec_ctu has wrong tyes rguenth at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2009-05-03 14:25 ` bonzini at gnu dot org
@ 2009-05-03 14:34 ` bonzini at gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: bonzini at gnu dot org @ 2009-05-03 14:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from bonzini at gnu dot org  2009-05-03 14:34 -------
To be more specific, the builtin call is created by the vectorizer, and the
vectorizer is quite careless in matching types.  The front-end *does* insert
VIEW_CONVERT_EXPRs and so does rs6000-c.c.


-- 


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


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

end of thread, other threads:[~2009-05-03 14:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-03 11:05 [Bug target/40009] New: altivec __builtin_vec_ctu has wrong tyes rguenth at gcc dot gnu dot org
2009-05-03 11:06 ` [Bug target/40009] " rguenth at gcc dot gnu dot org
2009-05-03 11:12 ` rguenth at gcc dot gnu dot org
2009-05-03 11:16 ` rguenth at gcc dot gnu dot org
2009-05-03 11:18 ` rguenth at gcc dot gnu dot org
2009-05-03 12:11 ` bonzini at gnu dot org
2009-05-03 13:29 ` rguenth at gcc dot gnu dot org
2009-05-03 14:00 ` bonzini at gnu dot org
2009-05-03 14:25 ` bonzini at gnu dot org
2009-05-03 14:34 ` bonzini at 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).