public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16882] New: overloading confused by const vector arguments
@ 2004-08-04 22:19 janis187 at us dot ibm dot com
  2004-09-24 12:50 ` [Bug c++/16882] [4.0 Regression] " bonzini at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: janis187 at us dot ibm dot com @ 2004-08-04 22:19 UTC (permalink / raw)
  To: gcc-bugs

Some of the <altivec.h> functionality no longer works from C++.  I've only
tried it on powerpc-linux, but it fails using generic vectors so is probably
target-independent.  This test case shows the problem using generic vectors.
                                                                               
                
#define vector __attribute__((vector_size(16)))
                                                                               
                
vector signed int vld (int a1, const vector signed int *a2) { return *a2; }
vector signed short vld (int a1, const vector signed short *a2) { return *a2; }
vector signed char vld (int a1, const vector signed char *a2) { return *a2; }
                                                                               
                
extern int i;
extern vector signed short vss;
extern vector signed short *vssp;
extern const vector signed short *cvssp;
                                                                               
                
void foo ()
{
  vss = vld(i, vssp);
  vss = vld(i, cvssp);
}
                                                                               
                
Output from this test using mainline built last night:
                                                                               
                
elm3b11% /opt/gcc-nightly/mline-20040804/bin/g++ -c vecld2.C
vecld2.C: In function `void foo()':
vecld2.C:14: error: call of overloaded `vld(int&, short int __vector__*&)' is
ambiguous
vecld2.C:3: note: candidates are: int __vector__ vld(int, const int __vector__*)
vecld2.C:4: note:                 short int __vector__ vld(int, const short int
__vector__*)
vecld2.C:5: note:                 signed char __vector__ vld(int, const signed
char __vector__*) 
                                                                               
              
The test starts failing with the following patch:
2004-07-21  Paolo Bonzini  <bonzini@gnu.org>
                                                                               
                
        * c-common.c (vector_types_convertible_p): Use vector types'
        TYPE_SIZE and TREE_TYPE instead of their mode.
        * convert.c (convert_to_integer): Likewise.
        (convert_to_vector): Likewise.
        * fold-const.c (fold_convert): Likewise.
        * varasm.c (output_constant): Likewise.
        * expr.c (store_constructor): Split ARRAY_TYPE and VECTOR_TYPE.
        Allow a VECTOR_TYPE initializer to be made of several vectors.
        For ARRAY_TYPEs and VECTOR_TYPES, simplify a bit the handling
        of cleared and need_to_clear, and use fold_convert.
        * c-typeck.c (build_binary_op): Do not use RDIV_EXPR for
        integer vectors.
                                                                               
                
cp:
                                                                               
                
2004-07-21  Paolo Bonzini  <bonzini@gnu.org>
                                                                               
                
       * typeck.c (build_binary_op): Do not use RDIV_EXPR for
       integer vectors.

-- 
           Summary: overloading confused by const vector arguments
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: janis187 at us dot ibm dot com
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: powerpc-unknown-linux-gnu


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


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

* [Bug c++/16882] [4.0 Regression] overloading confused by const vector arguments
  2004-08-04 22:19 [Bug c++/16882] New: overloading confused by const vector arguments janis187 at us dot ibm dot com
@ 2004-09-24 12:50 ` bonzini at gcc dot gnu dot org
  2004-11-19 23:23 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2004-09-24 12:50 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |bonzini at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/16882] [4.0 Regression] overloading confused by const vector arguments
  2004-08-04 22:19 [Bug c++/16882] New: overloading confused by const vector arguments janis187 at us dot ibm dot com
  2004-09-24 12:50 ` [Bug c++/16882] [4.0 Regression] " bonzini at gcc dot gnu dot org
@ 2004-11-19 23:23 ` mmitchel at gcc dot gnu dot org
  2004-11-24 10:07 ` cvs-commit at gcc dot gnu dot org
  2004-11-24 12:46 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-11-19 23:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-11-19 23:23 -------
Paolo, this patch is OK.

-- 


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


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

* [Bug c++/16882] [4.0 Regression] overloading confused by const vector arguments
  2004-08-04 22:19 [Bug c++/16882] New: overloading confused by const vector arguments janis187 at us dot ibm dot com
  2004-09-24 12:50 ` [Bug c++/16882] [4.0 Regression] " bonzini at gcc dot gnu dot org
  2004-11-19 23:23 ` mmitchel at gcc dot gnu dot org
@ 2004-11-24 10:07 ` cvs-commit at gcc dot gnu dot org
  2004-11-24 12:46 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-11-24 10:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-11-24 10:07 -------
Subject: Bug 16882

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	bonzini@gcc.gnu.org	2004-11-24 10:06:55

Modified files:
	gcc            : ChangeLog tree.c 
	gcc/cp         : ChangeLog call.c typeck.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/conversion: simd1.C 

Log message:
	2004-11-24  Paolo Bonzini  <bonzini@gnu.org>
	
	PR c++/16882
	
	* tree.c (make_vector_type): Move qualifiers to the vector type,
	use the inner type's main variant and build a main variant for
	the vector type if necessary.
	(type_hash_eq): Check a vector type's TYPE_VECTOR_SUBPARTS.
	
	cp:
	2004-11-24  Paolo Bonzini  <bonzini@gnu.org>
	
	PR c++/16882
	
	* call.c (standard_conversion): Move check for conversions between
	vector pointers...
	* typeck.c (ptr_reasonably_similar): ... here.
	
	testsuite:
	2004-11-24  Paolo Bonzini  <bonzini@gnu.org>
	
	PR c++/16882
	
	* g++.dg/conversion/simd1.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6507&r2=2.6508
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.c.diff?cvsroot=gcc&r1=1.449&r2=1.450
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4488&r2=1.4489
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.519&r2=1.520
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.597&r2=1.598
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4636&r2=1.4637
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/conversion/simd1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c++/16882] [4.0 Regression] overloading confused by const vector arguments
  2004-08-04 22:19 [Bug c++/16882] New: overloading confused by const vector arguments janis187 at us dot ibm dot com
                   ` (2 preceding siblings ...)
  2004-11-24 10:07 ` cvs-commit at gcc dot gnu dot org
@ 2004-11-24 12:46 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-24 12:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-24 12:46 -------
Fixed.

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


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


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

end of thread, other threads:[~2004-11-24 12:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-04 22:19 [Bug c++/16882] New: overloading confused by const vector arguments janis187 at us dot ibm dot com
2004-09-24 12:50 ` [Bug c++/16882] [4.0 Regression] " bonzini at gcc dot gnu dot org
2004-11-19 23:23 ` mmitchel at gcc dot gnu dot org
2004-11-24 10:07 ` cvs-commit at gcc dot gnu dot org
2004-11-24 12:46 ` 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).