public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/27449]  New: transfer intrinsic does not work on strongly aligned systems
@ 2006-05-05 17:55 sje at cup dot hp dot com
  2006-05-07 10:30 ` [Bug fortran/27449] transfer intrinsic does not work on strict " pault at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: sje at cup dot hp dot com @ 2006-05-05 17:55 UTC (permalink / raw)
  To: gcc-bugs

gfortran.dg/transfer_array_intrinsic_2.f90 fails on hppa64-hp-hpux11.11, I
created a cut down test case and the cutdown test fails on hppa64-hp-hpux11.11
and ia64-hp-hpux11.23.  On IA64 it fails in 32 and 64 bit modes.  I think the
problem is with alignment since the program is dying on an 8 byte load of a 4
byte aligned address.  I looked at trans-intrinsic.c but was not able to
exactly identify where the bad code was coming from.  All the targets where I
get the failure require 8 byte alignment of 8 byte loads.

Test case:

   character(8) :: ch(1) = (/"lmnoPQRS"/)
   integer(8) :: ic(1)

   integer :: i = 1
   integer :: q

   q = TRANSFER(i, q)
   ic = transfer (ch, ic)
end


-- 
           Summary: transfer intrinsic does not work on strongly aligned
                    systems
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sje at cup dot hp dot com
  GCC host triplet: hppa64-hp-hpux11.11


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


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

* [Bug fortran/27449] transfer intrinsic does not work on strict aligned systems
  2006-05-05 17:55 [Bug fortran/27449] New: transfer intrinsic does not work on strongly aligned systems sje at cup dot hp dot com
@ 2006-05-07 10:30 ` pault at gcc dot gnu dot org
  2006-05-14 12:12 ` pault at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-05-07 10:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pault at gcc dot gnu dot org  2006-05-07 10:30 -------
I am sure that this is the same as PR27155, which I undertook to fix.  It's on
the list of urgent things to do.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-05-07 10:30:27
               date|                            |


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


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

* [Bug fortran/27449] transfer intrinsic does not work on strict aligned systems
  2006-05-05 17:55 [Bug fortran/27449] New: transfer intrinsic does not work on strongly aligned systems sje at cup dot hp dot com
  2006-05-07 10:30 ` [Bug fortran/27449] transfer intrinsic does not work on strict " pault at gcc dot gnu dot org
@ 2006-05-14 12:12 ` pault at gcc dot gnu dot org
  2006-05-21  6:58 ` hjl at lucon dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-05-14 12:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pault at gcc dot gnu dot org  2006-05-14 12:12 -------
(In reply to comment #1)
> I am sure that this is the same as PR27155, which I undertook to fix.

I don't quite know what made me so sure but would be grateful if you would try
out the patch for pr27155.  I don't thinks that it is the fix for this PR but,
given your problem, I would be curious to know what your system does with it.

I think that we will have to have a stab at a bit of long distance debugging;
do you subscribe to #gcc by any chance?

Paul


-- 


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


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

* [Bug fortran/27449] transfer intrinsic does not work on strict aligned systems
  2006-05-05 17:55 [Bug fortran/27449] New: transfer intrinsic does not work on strongly aligned systems sje at cup dot hp dot com
  2006-05-07 10:30 ` [Bug fortran/27449] transfer intrinsic does not work on strict " pault at gcc dot gnu dot org
  2006-05-14 12:12 ` pault at gcc dot gnu dot org
@ 2006-05-21  6:58 ` hjl at lucon dot org
  2006-05-21  6:59 ` hjl at lucon dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hjl at lucon dot org @ 2006-05-21  6:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from hjl at lucon dot org  2006-05-21 06:58 -------
*** Bug 27633 has been marked as a duplicate of this bug. ***


-- 

hjl at lucon dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl at lucon dot org


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


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

* [Bug fortran/27449] transfer intrinsic does not work on strict aligned systems
  2006-05-05 17:55 [Bug fortran/27449] New: transfer intrinsic does not work on strongly aligned systems sje at cup dot hp dot com
                   ` (2 preceding siblings ...)
  2006-05-21  6:58 ` hjl at lucon dot org
@ 2006-05-21  6:59 ` hjl at lucon dot org
  2006-05-21  8:21 ` pault at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hjl at lucon dot org @ 2006-05-21  6:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hjl at lucon dot org  2006-05-21 06:59 -------
It also happens on Linux/ia64.


-- 

hjl at lucon dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   GCC host triplet|hppa64-hp-hpux11.11         |
 GCC target triplet|STRICT_ALGINED              |


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


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

* [Bug fortran/27449] transfer intrinsic does not work on strict aligned systems
  2006-05-05 17:55 [Bug fortran/27449] New: transfer intrinsic does not work on strongly aligned systems sje at cup dot hp dot com
                   ` (3 preceding siblings ...)
  2006-05-21  6:59 ` hjl at lucon dot org
@ 2006-05-21  8:21 ` pault at gcc dot gnu dot org
  2006-05-21  8:24 ` pault at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-05-21  8:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2006-05-21 08:21 -------
I have just realised that there is a simple fix for this.

It is my use of the scalarizer to perform the actual transfer that is the
source of the problem.  One of you or Bo suggested using memcpy.  That is what
I will try. My understanding is that adding the memcpy to se->pre or post and
having se->expr == NULL, should effect the transfer without generating a
scalarizer loop.

Would you be prepared to try a patch, in a day or two?

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   GCC host triplet|                            |hppa64-hp-hpux11.11
 GCC target triplet|                            |STRICT_ALGINED


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


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

* [Bug fortran/27449] transfer intrinsic does not work on strict aligned systems
  2006-05-05 17:55 [Bug fortran/27449] New: transfer intrinsic does not work on strongly aligned systems sje at cup dot hp dot com
                   ` (4 preceding siblings ...)
  2006-05-21  8:21 ` pault at gcc dot gnu dot org
@ 2006-05-21  8:24 ` pault at gcc dot gnu dot org
  2006-05-21 14:00 ` pault at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-05-21  8:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pault at gcc dot gnu dot org  2006-05-21 08:24 -------
HJ

Would you also be prepared to try a patch, in a day or two?

Paul


-- 


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


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

* [Bug fortran/27449] transfer intrinsic does not work on strict aligned systems
  2006-05-05 17:55 [Bug fortran/27449] New: transfer intrinsic does not work on strongly aligned systems sje at cup dot hp dot com
                   ` (5 preceding siblings ...)
  2006-05-21  8:24 ` pault at gcc dot gnu dot org
@ 2006-05-21 14:00 ` pault at gcc dot gnu dot org
  2006-05-21 16:57 ` hjl at lucon dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-05-21 14:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pault at gcc dot gnu dot org  2006-05-21 13:59 -------
Created an attachment (id=11491)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11491&action=view)
Patch for this PR and PR27155

This is a belt-and-braces fix that uses memcpy to effect the transfer. I will
look for a more efficient solution, which I think will involve a new library
function.  In the mean time, I believe that the patch will fix your problem.

Regtests on FC5/Athlon1700

Could one or, preferably, both of you try out the patch, please?

Paul 


-- 


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


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

* [Bug fortran/27449] transfer intrinsic does not work on strict aligned systems
  2006-05-05 17:55 [Bug fortran/27449] New: transfer intrinsic does not work on strongly aligned systems sje at cup dot hp dot com
                   ` (6 preceding siblings ...)
  2006-05-21 14:00 ` pault at gcc dot gnu dot org
@ 2006-05-21 16:57 ` hjl at lucon dot org
  2006-05-22 14:57 ` sje at cup dot hp dot com
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hjl at lucon dot org @ 2006-05-21 16:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from hjl at lucon dot org  2006-05-21 16:57 -------
The proposed patch works Linux/ia64:

http://gcc.gnu.org/ml/gcc-testresults/2006-05/msg01188.html

The visual inspection shows memcpy is used instead of ld8.


-- 


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


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

* [Bug fortran/27449] transfer intrinsic does not work on strict aligned systems
  2006-05-05 17:55 [Bug fortran/27449] New: transfer intrinsic does not work on strongly aligned systems sje at cup dot hp dot com
                   ` (7 preceding siblings ...)
  2006-05-21 16:57 ` hjl at lucon dot org
@ 2006-05-22 14:57 ` sje at cup dot hp dot com
  2006-05-25 13:02 ` pault at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: sje at cup dot hp dot com @ 2006-05-22 14:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from sje at cup dot hp dot com  2006-05-22 14:56 -------
The proposed patch fixed the failure of transfer_array_intrinsic_2.f90 on my
hppa64-hp-hpux11.11 system and I saw no regressions.  I also had no regressions
on the other systems I build nightly (hppa1.1-hp-hpux11.11, ia64-hp-hpux11.23,
and ia64-debian-linux-gnu).


-- 


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


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

* [Bug fortran/27449] transfer intrinsic does not work on strict aligned systems
  2006-05-05 17:55 [Bug fortran/27449] New: transfer intrinsic does not work on strongly aligned systems sje at cup dot hp dot com
                   ` (8 preceding siblings ...)
  2006-05-22 14:57 ` sje at cup dot hp dot com
@ 2006-05-25 13:02 ` pault at gcc dot gnu dot org
  2006-05-26  5:09 ` pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-05-25 13:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pault at gcc dot gnu dot org  2006-05-25 13:02 -------
Thanks, gents.

I am just going to ping the list and will commit tomorrow morning, no matter
what.

Paul


-- 


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


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

* [Bug fortran/27449] transfer intrinsic does not work on strict aligned systems
  2006-05-05 17:55 [Bug fortran/27449] New: transfer intrinsic does not work on strongly aligned systems sje at cup dot hp dot com
                   ` (9 preceding siblings ...)
  2006-05-25 13:02 ` pault at gcc dot gnu dot org
@ 2006-05-26  5:09 ` pault at gcc dot gnu dot org
  2006-05-28 19:48 ` [Bug fortran/27449] transfer intrinsic does not work on strict aligned systems (fixed in trunk) pault at gcc dot gnu dot org
  2006-06-14 14:44 ` pault at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-05-26  5:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from pault at gcc dot gnu dot org  2006-05-26 05:09 -------
Subject: Bug 27449

Author: pault
Date: Fri May 26 05:09:18 2006
New Revision: 114127

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114127
Log:
2006-05-26  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/27709
        * resolve.c (find_array_spec): Add gfc_symbol, derived, and
        use to track repeated component references.

        PR fortran/27155
        PR fortran/27449
        * trans-intrinsic.c (gfc_conv_intrinsic_array_transfer): Use
        se->string_length throughout and use memcpy to populate the
        expression returned to the scalarizer.
        (gfc_size_in_bytes): New function.

2006-05-26  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/27709
        * gfortran.dg/spec_expr_4.f90: New test.

        PR fortran/27155
        * gfortran.dg/transfer_array_intrinsic_4.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/spec_expr_4.f90
    trunk/gcc/testsuite/gfortran.dg/transfer_array_intrinsic_4.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/trans-intrinsic.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/27449] transfer intrinsic does not work on strict aligned systems (fixed in trunk)
  2006-05-05 17:55 [Bug fortran/27449] New: transfer intrinsic does not work on strongly aligned systems sje at cup dot hp dot com
                   ` (10 preceding siblings ...)
  2006-05-26  5:09 ` pault at gcc dot gnu dot org
@ 2006-05-28 19:48 ` pault at gcc dot gnu dot org
  2006-06-14 14:44 ` pault at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-05-28 19:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from pault at gcc dot gnu dot org  2006-05-28 19:47 -------
Subject: Bug 27449

Author: pault
Date: Sun May 28 19:46:22 2006
New Revision: 114173

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114173
Log:
2006-05-28  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/25082
        * resolve.c (resolve_code): Add error condition that the return
        expression must be scalar.

        PR fortran/27411
        * matchexp.c (gfc_get_parentheses): New function.
        (match_primary): Remove inline code and call above.
        * gfortran.h: Provide prototype for gfc_get_parentheses.
        * resolve.c (resolve_array_ref): Call the above, when start is a
        derived type variable array reference.

        PR fortran/27613
        * primary.c (gfc_match_rvalue): Test if symbol represents a
        direct recursive function reference.  Error if array valued,
        go to function0 otherwise.

        PR fortran/25746
        * interface.c (gfc_extend_assign): Use new EXEC_ASSIGN_CALL.
        * gfortran.h : Put EXEC_ASSIGN_CALL in enum.
        * trans-stmt.c (gfc_conv_elemental_dependencies): New function.
        (gfc_trans_call): Call it.  Add new boolian argument to flag
        need for dependency checking. Assert intent OUT and IN for arg1
        and arg2.
        (gfc_trans_forall_1): Use new code EXEC_ASSIGN_CALL.
        trans-stmt.h : Modify prototype of gfc_trans_call.
        trans.c (gfc_trans_code): Add call for EXEC_ASSIGN_CALL.
        st.c (gfc_free_statement): Free actual for EXEC_ASSIGN_CALL.
        * dependency.c (gfc_check_fncall_dependency): Don't check other
        against itself.

        PR fortran/27584
        * check.c (gfc_check_associated): Replace NULL assert with an
        error message, since it is possible to generate bad code that
        has us fall through to here..

        PR fortran/19015
        * iresolve.c (maxloc, minloc): If DIM is not present, pass the
        rank of ARRAY as the shape of the result.  Otherwise, pass the
        shape of ARRAY, less the dimension DIM.
        (maxval, minval): The same, when DIM is present, otherwise no
        change.

        PR fortran/27709
        * resolve.c (find_array_spec): Add gfc_symbol, derived, and
        use to track repeated component references.

        PR fortran/27155
        PR fortran/27449
        * trans-intrinsic.c (gfc_conv_intrinsic_array_transfer): Use
        se->string_length throughout and use memcpy to populate the
        expression returned to the scalarizer.
        (gfc_size_in_bytes): New function.

        * trans-intrinsic.c (gfc_conv_associated): If pointer in first
        arguments has zero array length of zero string length, return
        false.

2006-05-28  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/25082
        * gfortran.dg/scalar_return_1.f90: New test.

        PR fortran/27411
        * gfortran.dg/derived_comp_array_ref_1.f90: New test.

        PR fortran/25746
        * gfortran.dg/elemental_subroutine_3.f90: New test.

        PR fortran/27584
        * gfortran.dg/associated_target_1.f90: New test.

        PR fortran/19015
        * gfortran.dg/maxloc_shape_1.f90: New test.

        PR fortran/27613
        * gfortran.dg/recursive_reference_1.f90: New test.

        PR fortran/27709
        * gfortran.dg/spec_expr_4.f90: New test.

        PR fortran/27155
        * gfortran.dg/transfer_array_intrinsic_4.f90: New test.

        * gfortran.dg/associated_2.f90: New test.

Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/check.c
    branches/gcc-4_1-branch/gcc/fortran/gfortran.h
    branches/gcc-4_1-branch/gcc/fortran/interface.c
    branches/gcc-4_1-branch/gcc/fortran/iresolve.c
    branches/gcc-4_1-branch/gcc/fortran/matchexp.c
    branches/gcc-4_1-branch/gcc/fortran/primary.c
    branches/gcc-4_1-branch/gcc/fortran/resolve.c
    branches/gcc-4_1-branch/gcc/fortran/st.c
    branches/gcc-4_1-branch/gcc/fortran/trans-intrinsic.c
    branches/gcc-4_1-branch/gcc/fortran/trans-stmt.c
    branches/gcc-4_1-branch/gcc/fortran/trans-stmt.h
    branches/gcc-4_1-branch/gcc/fortran/trans.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/27449] transfer intrinsic does not work on strict aligned systems (fixed in trunk)
  2006-05-05 17:55 [Bug fortran/27449] New: transfer intrinsic does not work on strongly aligned systems sje at cup dot hp dot com
                   ` (11 preceding siblings ...)
  2006-05-28 19:48 ` [Bug fortran/27449] transfer intrinsic does not work on strict aligned systems (fixed in trunk) pault at gcc dot gnu dot org
@ 2006-06-14 14:44 ` pault at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-06-14 14:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from pault at gcc dot gnu dot org  2006-06-14 14:26 -------
This, of course, was fixed on both trunk and 4.1.

Paul


-- 

pault at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2006-06-14 14:26 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-05 17:55 [Bug fortran/27449] New: transfer intrinsic does not work on strongly aligned systems sje at cup dot hp dot com
2006-05-07 10:30 ` [Bug fortran/27449] transfer intrinsic does not work on strict " pault at gcc dot gnu dot org
2006-05-14 12:12 ` pault at gcc dot gnu dot org
2006-05-21  6:58 ` hjl at lucon dot org
2006-05-21  6:59 ` hjl at lucon dot org
2006-05-21  8:21 ` pault at gcc dot gnu dot org
2006-05-21  8:24 ` pault at gcc dot gnu dot org
2006-05-21 14:00 ` pault at gcc dot gnu dot org
2006-05-21 16:57 ` hjl at lucon dot org
2006-05-22 14:57 ` sje at cup dot hp dot com
2006-05-25 13:02 ` pault at gcc dot gnu dot org
2006-05-26  5:09 ` pault at gcc dot gnu dot org
2006-05-28 19:48 ` [Bug fortran/27449] transfer intrinsic does not work on strict aligned systems (fixed in trunk) pault at gcc dot gnu dot org
2006-06-14 14:44 ` pault 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).