public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/35219]  New: zdotu (copy of BLAS version) works in x86, x86_64, segfaults in arm.
@ 2008-02-16 18:40 akumar at ee dot iitm dot ac dot in
  2008-02-16 18:52 ` [Bug fortran/35219] " fxcoudert at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: akumar at ee dot iitm dot ac dot in @ 2008-02-16 18:40 UTC (permalink / raw)
  To: gcc-bugs

Hi!

The following programs are built like this:

gfortran -c zdotu.f -ggdb
g++ -c ztest.cpp -ggdb
g++ -o ztest zdotu.o ztest.o

The generated ztest segfaults on ARM on line 37 of zdotu.f with SIGSEGV, while
it is perfect on other arches.

Thanks!

Kumar

zdotu.f
-------
      DOUBLE COMPLEX FUNCTION ZDOTU(N,ZX,INCX,ZY,INCY)
*     .. Scalar Arguments ..
      INTEGER INCX,INCY,N
*     ..
*     .. Array Arguments ..
      DOUBLE COMPLEX ZX(*),ZY(*)
*     ..
*
*  Purpose
*  =======
*
*     ZDOTU forms the dot product of two vectors.
*
*  Further Details
*  ===============
*
*     jack dongarra, 3/11/78.
*     modified 12/3/93, array(1) declarations changed to array(*)
*
*     .. Local Scalars ..
      DOUBLE COMPLEX ZTEMP
      INTEGER I,IX,IY
*     ..
      ZTEMP = (0.0d0,0.0d0)
      ZDOTU = (0.0d0,0.0d0)
      IF (N.LE.0) RETURN
      IF (INCX.EQ.1 .AND. INCY.EQ.1) GO TO 20
*
*        code for unequal increments or equal increments
*          not equal to 1
*
      IX = 1
      IY = 1
      IF (INCX.LT.0) IX = (-N+1)*INCX + 1
      IF (INCY.LT.0) IY = (-N+1)*INCY + 1
      DO 10 I = 1,N
          ZTEMP = ZTEMP + ZX(IX)*ZY(IY)
          IX = IX + INCX
          IY = IY + INCY
   10 CONTINUE
      ZDOTU = ZTEMP
      RETURN
*
*        code for both increments equal to 1
*
   20 DO 30 I = 1,N
          ZTEMP = ZTEMP + ZX(I)*ZY(I)
   30 CONTINUE
      ZDOTU = ZTEMP
      RETURN
      END

ztest.cpp
---------
#include <complex>

typedef std::complex<double> cdouble;
extern "C" {
        cdouble zdotu_(const int *, const cdouble *, const int *,
                       const cdouble *, const int *);
}
int main() {
        int incr = 1;
        int size = 6;
        cdouble a[] = {cdouble( 0.7219, 0.8871), cdouble( 0.7073,-0.7953),
                       cdouble( 0.2610, 0.4325), cdouble(-0.0565,-0.0719),
                       cdouble( 0.7277,-0.9754), cdouble(-0.3780, 1.0718)};
        cdouble b[] = {cdouble(-0.0821,+0.8410), cdouble(-0.0749, 0.0729),
                       cdouble(-0.6094,-0.2975), cdouble( 0.2106,-0.2026),
                       cdouble( 0.1043,-0.8300), cdouble( 0.0806, 0.3698)};
        cdouble x_ref(-2.01767031,-0.45861365);
        cdouble x = zdotu_(&size, a, &incr, b, &incr);
        return (std::abs(x - x_ref) < 1e-6) ? 0 : 1;
}


-- 
           Summary: zdotu (copy of BLAS version) works in x86, x86_64,
                    segfaults in arm.
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: akumar at ee dot iitm dot ac dot in
 GCC build triplet: arm-linux-gnu
  GCC host triplet: arm-linux-gnu
GCC target triplet: arm-linux-gnu


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


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

* [Bug fortran/35219] zdotu (copy of BLAS version) works in x86, x86_64, segfaults in arm.
  2008-02-16 18:40 [Bug fortran/35219] New: zdotu (copy of BLAS version) works in x86, x86_64, segfaults in arm akumar at ee dot iitm dot ac dot in
@ 2008-02-16 18:52 ` fxcoudert at gcc dot gnu dot org
  2008-02-16 19:08 ` pinskia at gcc dot gnu dot org
  2008-11-05 15:50 ` jason at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-02-16 18:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from fxcoudert at gcc dot gnu dot org  2008-02-16 18:51 -------
*** Bug 35220 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug fortran/35219] zdotu (copy of BLAS version) works in x86, x86_64, segfaults in arm.
  2008-02-16 18:40 [Bug fortran/35219] New: zdotu (copy of BLAS version) works in x86, x86_64, segfaults in arm akumar at ee dot iitm dot ac dot in
  2008-02-16 18:52 ` [Bug fortran/35219] " fxcoudert at gcc dot gnu dot org
@ 2008-02-16 19:08 ` pinskia at gcc dot gnu dot org
  2008-11-05 15:50 ` jason at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-02-16 19:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-02-16 19:07 -------
cdouble zdotu_
Will never work as cdouble is a struct and the way it will returned is
different from _Complex double and fortran's complex.


-- 

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=35219


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

* [Bug fortran/35219] zdotu (copy of BLAS version) works in x86, x86_64, segfaults in arm.
  2008-02-16 18:40 [Bug fortran/35219] New: zdotu (copy of BLAS version) works in x86, x86_64, segfaults in arm akumar at ee dot iitm dot ac dot in
  2008-02-16 18:52 ` [Bug fortran/35219] " fxcoudert at gcc dot gnu dot org
  2008-02-16 19:08 ` pinskia at gcc dot gnu dot org
@ 2008-11-05 15:50 ` jason at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-11-05 15:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jason at gcc dot gnu dot org  2008-11-05 15:49 -------
Subject: Bug 35219

Author: jason
Date: Wed Nov  5 15:48:01 2008
New Revision: 141612

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141612
Log:
        PR c++/35219
        * cp-tree.h: Fix DECL_NONSTATIC_MEMBER_P to handle member template
        functions.

Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

end of thread, other threads:[~2008-11-05 15:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-16 18:40 [Bug fortran/35219] New: zdotu (copy of BLAS version) works in x86, x86_64, segfaults in arm akumar at ee dot iitm dot ac dot in
2008-02-16 18:52 ` [Bug fortran/35219] " fxcoudert at gcc dot gnu dot org
2008-02-16 19:08 ` pinskia at gcc dot gnu dot org
2008-11-05 15:50 ` jason 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).