public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/27633]  New: Fortran accesses char array as integer
@ 2006-05-16 21:56 hjl at lucon dot org
  2006-05-16 22:20 ` [Bug fortran/27633] Fortran accesses char array as integer with transfer pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hjl at lucon dot org @ 2006-05-16 21:56 UTC (permalink / raw)
  To: gcc-bugs

I got unaligned access on ia64 for

gcc/testsuite/gfortran.dg/transfer_array_intrinsic_2.f90

For

     96    subroutine test3 (ch1, ch2, ch3, clen)
     97      integer clen
     98      character(8) :: ch1(:)
     99      character(*) :: ch2(2)
    100      character(clen) :: ch3(2)
    101      character(8) :: cntrl(2) = (/"lmnoPQRS","LMNOpqrs"/)
    102      integer(8) :: ic(2)
    103      ic = transfer (cntrl, ic)

Gfortran generates code like

(insn 1785 1391 2163 80
/net/gnu-13/export/gnu/src/gcc-4.1/gcc/gcc/testsuite/gfortran.dg/transfer_array_intrinsic_2.f90:103
(set (reg/f:DI 14 r14 [orig:406 D.2542 ] [406])
        (plus:DI (high:DI (symbol_ref:DI ("cntrl.1064") [flags 0x2] <var_decl
0x200000000361da20 cntrl>))
            (reg:DI 1 r1))) 76 {*load_symptr_high} (nil)
    (nil))
...
(insn 1786 2163 2164 80
/net/gnu-13/export/gnu/src/gcc-4.1/gcc/gcc/testsuite/gfortran.dg/transfer_array_intrinsic_2.f90:103
(set (reg/f:DI 14 r14 [orig:406 D.2542 ] [406])
        (lo_sum:DI (reg/f:DI 14 r14 [orig:406 D.2542 ] [406])
            (symbol_ref:DI ("cntrl.1064") [flags 0x2] <var_decl
0x200000000361da20 cntrl>))) 77 {*load_symptr_low} (nil)
    (nil))
...
(insn 1395 2164 2165 80
/net/gnu-13/export/gnu/src/gcc-4.1/gcc/gcc/testsuite/gfortran.dg/transfer_array_intrinsic_2.f90:103
(set (reg:DI 15 r15 [1139])
        (mem/s/j:DI (post_inc:DI (reg/f:DI 14 r14 [orig:406 D.2542 ] [406])) [0
S8 A64])) 5 {*movdi_internal} (insn_list:REG_DEP_TRUE 1392 (nil))
    (expr_list:REG_INC (reg/f:DI 14 r14 [orig:406 D.2542 ] [406])
        (nil)))

So cntrl is read as 64bit integer.


-- 
           Summary: Fortran accesses char array as integer
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl at lucon dot org


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


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

* [Bug fortran/27633] Fortran accesses char array as integer with transfer
  2006-05-16 21:56 [Bug fortran/27633] New: Fortran accesses char array as integer hjl at lucon dot org
@ 2006-05-16 22:20 ` pinskia at gcc dot gnu dot org
  2006-05-17 19:03 ` pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-16 22:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-05-16 22:19 -------
I already mentioned before it should be using VIEW_CONVERT_EXPR instead of an
address and a NOP_EXPR but nobody listened to me in the orginal bug report.

Note this effects both strict alignment targets and aliasing.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2006-05-16 22:19:40
               date|                            |
            Summary|Fortran accesses char array |Fortran accesses char array
                   |as integer                  |as integer with transfer


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


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

* [Bug fortran/27633] Fortran accesses char array as integer with transfer
  2006-05-16 21:56 [Bug fortran/27633] New: Fortran accesses char array as integer hjl at lucon dot org
  2006-05-16 22:20 ` [Bug fortran/27633] Fortran accesses char array as integer with transfer pinskia at gcc dot gnu dot org
@ 2006-05-17 19:03 ` pault at gcc dot gnu dot org
  2006-05-21  5:47 ` pault at gcc dot gnu dot org
  2006-05-21  6:58 ` hjl at lucon dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-05-17 19:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pault at gcc dot gnu dot org  2006-05-17 19:03 -------
(In reply to comment #1)
> I already mentioned before it should be using VIEW_CONVERT_EXPR instead of an
> address and a NOP_EXPR but nobody listened to me in the orginal bug report.
> 
> Note this effects both strict alignment targets and aliasing.
> 
Maybe I listened, Andrew, but did not understand.  Tell me what this means and
I will happily do something about it. As it is, you are blinding me with
backendisms.

Paul


-- 


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


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

* [Bug fortran/27633] Fortran accesses char array as integer with transfer
  2006-05-16 21:56 [Bug fortran/27633] New: Fortran accesses char array as integer hjl at lucon dot org
  2006-05-16 22:20 ` [Bug fortran/27633] Fortran accesses char array as integer with transfer pinskia at gcc dot gnu dot org
  2006-05-17 19:03 ` pault at gcc dot gnu dot org
@ 2006-05-21  5:47 ` pault at gcc dot gnu dot org
  2006-05-21  6:58 ` hjl at lucon dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-05-21  5:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pault at gcc dot gnu dot org  2006-05-21 05:47 -------
I believe this to be the same as PR27449.

I have a fix in mind that I will try over the next few days (see PR27449)

Paul


-- 

pault at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/27633] Fortran accesses char array as integer with transfer
  2006-05-16 21:56 [Bug fortran/27633] New: Fortran accesses char array as integer hjl at lucon dot org
                   ` (2 preceding siblings ...)
  2006-05-21  5:47 ` pault at gcc dot gnu dot org
@ 2006-05-21  6:58 ` hjl at lucon dot org
  3 siblings, 0 replies; 5+ messages in thread
From: hjl at lucon dot org @ 2006-05-21  6:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hjl at lucon dot org  2006-05-21 06:58 -------
It is the same as PR 27449.

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


-- 

hjl at lucon dot org changed:

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


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


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

end of thread, other threads:[~2006-05-21  6:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-16 21:56 [Bug fortran/27633] New: Fortran accesses char array as integer hjl at lucon dot org
2006-05-16 22:20 ` [Bug fortran/27633] Fortran accesses char array as integer with transfer pinskia at gcc dot gnu dot org
2006-05-17 19:03 ` pault at gcc dot gnu dot org
2006-05-21  5:47 ` pault at gcc dot gnu dot org
2006-05-21  6:58 ` hjl at lucon 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).