public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/18631] New: missing error messages passing vectors with -mno-altivec -mabi=altivec
@ 2004-11-23 16:48 janis187 at us dot ibm dot com
  2004-11-24  6:18 ` [Bug target/18631] [4.0 Regression] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: janis187 at us dot ibm dot com @ 2004-11-23 16:48 UTC (permalink / raw)
  To: gcc-bugs

The AltiVec variant of the PowerPC 64-bit ABI specifies that types that
map to hardware vectors are passed in vector registers.  There used to
be error messages for passing vectors by value or returning vectors
from functions if AltiVec support was on but the non-AltiVec ABI was
used.  For this code:
                                                                                
typedef int __attribute__((vector_size(16))) vec;
extern vec v1;
vec ret (void) { return v1; }
void pass (vec v) { v1 = v; }
                                                                                
GCC 3.4.3 with -mno-altivec -mabi=altivec gives:
                                                                                
bug.c: In function `ret':
bug.c:3: error: Cannot return value in vector register because altivec
instructions are disabled, use -maltivec to enable them.
bug.c: In function `pass':
bug.c:4: error: Cannot pass argument in vector register because altivec
instructions are disabled, use -maltivec to enable them.
                                                                                
Mainline GCC no longer gives these errors, starting with this patch
from Paolo Bonzini on July 22:
                                                                                
http://gcc.gnu.org/ml/gcc-cvs/2004-07/msg01111.html
                                                                                
At the time the checks are made for the error message, the type of the
argument or return value is TImode, not a vector type.
                                                                                
This is a regression from 3.4 compilers.

-- 
           Summary: missing error messages passing vectors with -mno-altivec
                    -mabi=altivec
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: janis187 at us dot ibm dot com
                CC: bonzini at gcc dot gnu dot org,gcc-bugs at gcc dot gnu
                    dot org
GCC target triplet: powerpc*-*-linux*


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


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

* [Bug target/18631] [4.0 Regression] missing error messages passing vectors with -mno-altivec -mabi=altivec
  2004-11-23 16:48 [Bug target/18631] New: missing error messages passing vectors with -mno-altivec -mabi=altivec janis187 at us dot ibm dot com
@ 2004-11-24  6:18 ` pinskia at gcc dot gnu dot org
  2004-11-24 16:53 ` janis187 at us dot ibm dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-24  6:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-24 06:18 -------
Confirmed, I really don't think this should be an error as on darwin like ppc64-linux the ABI defaults to 
the altivec ABI so there is no way to return "generic" vector on darwin or ppc64-linux.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2004-11-24 06:18:55
               date|                            |
            Summary|missing error messages      |[4.0 Regression] missing
                   |passing vectors with -mno-  |error messages passing
                   |altivec -mabi=altivec       |vectors with -mno-altivec -
                   |                            |mabi=altivec
   Target Milestone|---                         |4.0.0


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


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

* [Bug target/18631] [4.0 Regression] missing error messages passing vectors with -mno-altivec -mabi=altivec
  2004-11-23 16:48 [Bug target/18631] New: missing error messages passing vectors with -mno-altivec -mabi=altivec janis187 at us dot ibm dot com
  2004-11-24  6:18 ` [Bug target/18631] [4.0 Regression] " pinskia at gcc dot gnu dot org
@ 2004-11-24 16:53 ` janis187 at us dot ibm dot com
  2005-04-21  4:57 ` [Bug target/18631] [4.0/4.1 " mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: janis187 at us dot ibm dot com @ 2004-11-24 16:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From janis187 at us dot ibm dot com  2004-11-24 16:53 -------
Oops, in the submission I said "There used to be error messages for passing
vectors by value or returning vectors from functions if AltiVec support was on
but the non-AltiVec ABI was used."  That should be: There used to be error
messages ... if AltiVec support was not on and the AltiVec ABI was used.

The AltiVec ABI says that vectors that map to hardware vectors are passed in
vector registers.  That variant of the ABI is the default but can be turned
off with -mabi=no-altivec, which is useful for binary compatibility with
modules that will be used on multiple types of PowerPC-64 hardware.  The ABI
doesn't cover generic vectors that don't map to hardware vectors, but GCC
passes them by reference for either variant of the ABI.  It probably doesn't
specifically cover the case of generic vectors that map to hardware vectors
when AltiVec support isn't enabled, but that seems surprising enough that it
ought to continue to be an error.

I personally think it ought to be an error to pass any synthetic vector by
value unless it is specifically covered by the ABI, but that's another mess
that no one wants to touch.

-- 


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


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

* [Bug target/18631] [4.0/4.1 Regression] missing error messages passing vectors with -mno-altivec -mabi=altivec
  2004-11-23 16:48 [Bug target/18631] New: missing error messages passing vectors with -mno-altivec -mabi=altivec janis187 at us dot ibm dot com
  2004-11-24  6:18 ` [Bug target/18631] [4.0 Regression] " pinskia at gcc dot gnu dot org
  2004-11-24 16:53 ` janis187 at us dot ibm dot com
@ 2005-04-21  4:57 ` mmitchel at gcc dot gnu dot org
  2005-07-08  1:36 ` mmitchel at gcc dot gnu dot org
  2005-09-27 16:01 ` mmitchel at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-04-21  4:57 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.0                       |4.0.1


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


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

* [Bug target/18631] [4.0/4.1 Regression] missing error messages passing vectors with -mno-altivec -mabi=altivec
  2004-11-23 16:48 [Bug target/18631] New: missing error messages passing vectors with -mno-altivec -mabi=altivec janis187 at us dot ibm dot com
                   ` (2 preceding siblings ...)
  2005-04-21  4:57 ` [Bug target/18631] [4.0/4.1 " mmitchel at gcc dot gnu dot org
@ 2005-07-08  1:36 ` mmitchel at gcc dot gnu dot org
  2005-09-27 16:01 ` mmitchel at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-07-08  1:36 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.1                       |4.0.2


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


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

* [Bug target/18631] [4.0/4.1 Regression] missing error messages passing vectors with -mno-altivec -mabi=altivec
  2004-11-23 16:48 [Bug target/18631] New: missing error messages passing vectors with -mno-altivec -mabi=altivec janis187 at us dot ibm dot com
                   ` (3 preceding siblings ...)
  2005-07-08  1:36 ` mmitchel at gcc dot gnu dot org
@ 2005-09-27 16:01 ` mmitchel at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:01 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.2                       |4.0.3


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


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

end of thread, other threads:[~2005-09-27 15:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-23 16:48 [Bug target/18631] New: missing error messages passing vectors with -mno-altivec -mabi=altivec janis187 at us dot ibm dot com
2004-11-24  6:18 ` [Bug target/18631] [4.0 Regression] " pinskia at gcc dot gnu dot org
2004-11-24 16:53 ` janis187 at us dot ibm dot com
2005-04-21  4:57 ` [Bug target/18631] [4.0/4.1 " mmitchel at gcc dot gnu dot org
2005-07-08  1:36 ` mmitchel at gcc dot gnu dot org
2005-09-27 16:01 ` mmitchel 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).