public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/13240] New: wrong alignment of automatic adjustable DOUBLE PRECISION array
@ 2003-11-30 16:48 gcc-bug at vogtner dot de
  2003-11-30 16:49 ` [Bug fortran/13240] " gcc-bug at vogtner dot de
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: gcc-bug at vogtner dot de @ 2003-11-30 16:48 UTC (permalink / raw)
  To: gcc-bugs

The base address of a local (automatic) adjustable DOUBLE PRECISION
array ist not properly aligned. Please take a look into the files
enclosed. The program reports:

ADDRESS OF DBLE : BFDFF54C

indicating that the local array is only a multiple of 4 instead
of 8 bytes.

As a workaround a tried -mpreferred-stack-boundary=n for some n.
Only for n = 2 and 3 (in case of GCC 3.2.2 and 3.3.2) and only for n = 2
in case of GCC 2.95.3 the array is correctly aligned.

-- 
           Summary: wrong alignment of automatic adjustable DOUBLE PRECISION
                    array
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc-bug at vogtner dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug fortran/13240] wrong alignment of automatic adjustable DOUBLE PRECISION array
  2003-11-30 16:48 [Bug fortran/13240] New: wrong alignment of automatic adjustable DOUBLE PRECISION array gcc-bug at vogtner dot de
@ 2003-11-30 16:49 ` gcc-bug at vogtner dot de
  2003-11-30 16:50 ` gcc-bug at vogtner dot de
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: gcc-bug at vogtner dot de @ 2003-11-30 16:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gcc-bug at vogtner dot de  2003-11-30 16:49 -------
Created an attachment (id=5241)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5241&action=view)
test program (FORTRAN)


-- 


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


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

* [Bug fortran/13240] wrong alignment of automatic adjustable DOUBLE PRECISION array
  2003-11-30 16:48 [Bug fortran/13240] New: wrong alignment of automatic adjustable DOUBLE PRECISION array gcc-bug at vogtner dot de
  2003-11-30 16:49 ` [Bug fortran/13240] " gcc-bug at vogtner dot de
@ 2003-11-30 16:50 ` gcc-bug at vogtner dot de
  2003-11-30 19:21 ` [Bug fortran/13240] [g77] " pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: gcc-bug at vogtner dot de @ 2003-11-30 16:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gcc-bug at vogtner dot de  2003-11-30 16:50 -------
Created an attachment (id=5242)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5242&action=view)
shell script to run tests


-- 


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


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

* [Bug fortran/13240] [g77] wrong alignment of automatic adjustable DOUBLE PRECISION array
  2003-11-30 16:48 [Bug fortran/13240] New: wrong alignment of automatic adjustable DOUBLE PRECISION array gcc-bug at vogtner dot de
  2003-11-30 16:49 ` [Bug fortran/13240] " gcc-bug at vogtner dot de
  2003-11-30 16:50 ` gcc-bug at vogtner dot de
@ 2003-11-30 19:21 ` pinskia at gcc dot gnu dot org
  2003-11-30 19:28 ` toon at moene dot indiv dot nluug dot nl
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-30 19:21 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
            Summary|wrong alignment of automatic|[g77] wrong alignment of
                   |adjustable DOUBLE PRECISION |automatic adjustable DOUBLE
                   |array                       |PRECISION array


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


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

* [Bug fortran/13240] [g77] wrong alignment of automatic adjustable DOUBLE PRECISION array
  2003-11-30 16:48 [Bug fortran/13240] New: wrong alignment of automatic adjustable DOUBLE PRECISION array gcc-bug at vogtner dot de
                   ` (2 preceding siblings ...)
  2003-11-30 19:21 ` [Bug fortran/13240] [g77] " pinskia at gcc dot gnu dot org
@ 2003-11-30 19:28 ` toon at moene dot indiv dot nluug dot nl
  2003-11-30 20:27 ` gcc-bug at vogtner dot de
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: toon at moene dot indiv dot nluug dot nl @ 2003-11-30 19:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From toon at moene dot indiv dot nluug dot nl  2003-11-30 19:28 -------
Could you try with the compiler flag -malign-double to get double
precision variables aligned on 8-byte boundaries ?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug fortran/13240] [g77] wrong alignment of automatic adjustable DOUBLE PRECISION array
  2003-11-30 16:48 [Bug fortran/13240] New: wrong alignment of automatic adjustable DOUBLE PRECISION array gcc-bug at vogtner dot de
                   ` (3 preceding siblings ...)
  2003-11-30 19:28 ` toon at moene dot indiv dot nluug dot nl
@ 2003-11-30 20:27 ` gcc-bug at vogtner dot de
  2003-11-30 20:31 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: gcc-bug at vogtner dot de @ 2003-11-30 20:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gcc-bug at vogtner dot de  2003-11-30 20:27 -------
test.sh does already test -malign-double:

/usrB/softw1/3.3.2-2.3.2/bin/g77

misalignment:
g77  : ADDRESS OF DBLE : BFDFF56C
g77  -O: ADDRESS OF DBLE : BFDFF57C
g77  -O1: ADDRESS OF DBLE : BFDFF57C
g77  -O2: ADDRESS OF DBLE : BFDFF56C
g77  -O3: ADDRESS OF DBLE : BFDFF56C
g77  -O4: ADDRESS OF DBLE : BFDFF56C
g77 -malign-double : ADDRESS OF DBLE : BFDFF56C
g77 -malign-double -O: ADDRESS OF DBLE : BFDFF57C
g77 -malign-double -O1: ADDRESS OF DBLE : BFDFF57C
g77 -malign-double -O2: ADDRESS OF DBLE : BFDFF56C
g77 -malign-double -O3: ADDRESS OF DBLE : BFDFF56C
g77 -malign-double -O4: ADDRESS OF DBLE : BFDFF56C

workaround:  [this is all mit malign-double:]
g77 -mprefStckBndry=2: ADDRESS OF DBLE : BFDFF570
g77 -mprefStckBndry=3: ADDRESS OF DBLE : BFDFF570
g77 -mprefStckBndry=4: ADDRESS OF DBLE : BFDFF56C
g77 -mprefStckBndry=5: ADDRESS OF DBLE : BFDFF55C
g77 -mprefStckBndry=6: ADDRESS OF DBLE : BFDFF55C
g77 -mprefStckBndry=7: ADDRESS OF DBLE : BFDFF4DC
g77 -mprefStckBndry=8: ADDRESS OF DBLE : BFDFF3DC


-- 


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


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

* [Bug fortran/13240] [g77] wrong alignment of automatic adjustable DOUBLE PRECISION array
  2003-11-30 16:48 [Bug fortran/13240] New: wrong alignment of automatic adjustable DOUBLE PRECISION array gcc-bug at vogtner dot de
                   ` (4 preceding siblings ...)
  2003-11-30 20:27 ` gcc-bug at vogtner dot de
@ 2003-11-30 20:31 ` pinskia at gcc dot gnu dot org
  2003-11-30 21:20 ` gcc-bug at vogtner dot de
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-30 20:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-30 20:31 -------
This is a dup of bug 10395, the problem is that main is not aligned correctly at all, other functions 
are okay.

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

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


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


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

* [Bug fortran/13240] [g77] wrong alignment of automatic adjustable DOUBLE PRECISION array
  2003-11-30 16:48 [Bug fortran/13240] New: wrong alignment of automatic adjustable DOUBLE PRECISION array gcc-bug at vogtner dot de
                   ` (5 preceding siblings ...)
  2003-11-30 20:31 ` pinskia at gcc dot gnu dot org
@ 2003-11-30 21:20 ` gcc-bug at vogtner dot de
  2003-11-30 21:22 ` gcc-bug at vogtner dot de
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: gcc-bug at vogtner dot de @ 2003-11-30 21:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gcc-bug at vogtner dot de  2003-11-30 21:20 -------
This is hard to believe! I have modified the program. The mis-alignment only
occurs, if adjustable arrays are used. I don't think that #10395 applies here.

#> g77 -malign-double g77-3.3.2-misaligned-dp-array-bug-1.f 
#> a.out 
08049D20
0A049D20
0C049D20
ADDRESS OF DBLE : BFFFF548 <-- scalar dp variable: OK
ADDRESS OF DBLE : BFFFF520 <-- automatic array (fixed size): OK
ADDRESS OF DBLE : BFFFE4FC <-- adjustable array: mis-aligned
ADDRESS OF DBLE : BFDFE4FC <-- adjustable array: mis-aligned

now:

#> g77 -malign-double -mpreferred-stack-boundary=3
g77-3.3.2-misaligned-dp-array-bug-1.f 
#> a.out 
08049D40
0A049D40
0C049D40
ADDRESS OF DBLE : BFFFF550
ADDRESS OF DBLE : BFFFF530
ADDRESS OF DBLE : BFFFE510 <-- OK
ADDRESS OF DBLE : BFDFE500 <-- OK

and also ok is preferred stack boundary of 2.

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


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


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

* [Bug fortran/13240] [g77] wrong alignment of automatic adjustable DOUBLE PRECISION array
  2003-11-30 16:48 [Bug fortran/13240] New: wrong alignment of automatic adjustable DOUBLE PRECISION array gcc-bug at vogtner dot de
                   ` (6 preceding siblings ...)
  2003-11-30 21:20 ` gcc-bug at vogtner dot de
@ 2003-11-30 21:22 ` gcc-bug at vogtner dot de
  2003-12-30  7:00 ` bdavis9659 at comcast dot net
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: gcc-bug at vogtner dot de @ 2003-11-30 21:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gcc-bug at vogtner dot de  2003-11-30 21:22 -------
Created an attachment (id=5245)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5245&action=view)
new test case


-- 


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


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

* [Bug fortran/13240] [g77] wrong alignment of automatic adjustable DOUBLE PRECISION array
  2003-11-30 16:48 [Bug fortran/13240] New: wrong alignment of automatic adjustable DOUBLE PRECISION array gcc-bug at vogtner dot de
                   ` (7 preceding siblings ...)
  2003-11-30 21:22 ` gcc-bug at vogtner dot de
@ 2003-12-30  7:00 ` bdavis9659 at comcast dot net
  2003-12-30  8:32 ` bdavis9659 at comcast dot net
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bdavis9659 at comcast dot net @ 2003-12-30  7:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bdavis9659 at comcast dot net  2003-12-30 03:45 -------
Created an attachment (id=5380)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5380&action=view)
Candidate test for inclusion into g77 testsuite

This is the smallest example that I could make to demonstrate this problem. 
Calls "abort" on failure.  Ready to be include in f77 test suite.

-- 


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


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

* [Bug fortran/13240] [g77] wrong alignment of automatic adjustable DOUBLE PRECISION array
  2003-11-30 16:48 [Bug fortran/13240] New: wrong alignment of automatic adjustable DOUBLE PRECISION array gcc-bug at vogtner dot de
                   ` (8 preceding siblings ...)
  2003-12-30  7:00 ` bdavis9659 at comcast dot net
@ 2003-12-30  8:32 ` bdavis9659 at comcast dot net
  2003-12-30  9:47 ` pinskia at gcc dot gnu dot org
  2003-12-30 16:14 ` toon at moene dot indiv dot nluug dot nl
  11 siblings, 0 replies; 13+ messages in thread
From: bdavis9659 at comcast dot net @ 2003-12-30  8:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bdavis9659 at comcast dot net  2003-12-30 03:50 -------
Looks like this has been fixed.  Original test case's work fine with:

GNU Fortran (GCC) 3.4.0 20031229 (experimental)

and they sure failed with gcc-3.2.2


--bud davis

-- 


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


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

* [Bug fortran/13240] [g77] wrong alignment of automatic adjustable DOUBLE PRECISION array
  2003-11-30 16:48 [Bug fortran/13240] New: wrong alignment of automatic adjustable DOUBLE PRECISION array gcc-bug at vogtner dot de
                   ` (9 preceding siblings ...)
  2003-12-30  8:32 ` bdavis9659 at comcast dot net
@ 2003-12-30  9:47 ` pinskia at gcc dot gnu dot org
  2003-12-30 16:14 ` toon at moene dot indiv dot nluug dot nl
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-30  9:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-30 04:20 -------
Fixed for 3.4.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.4.0


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


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

* [Bug fortran/13240] [g77] wrong alignment of automatic adjustable DOUBLE PRECISION array
  2003-11-30 16:48 [Bug fortran/13240] New: wrong alignment of automatic adjustable DOUBLE PRECISION array gcc-bug at vogtner dot de
                   ` (10 preceding siblings ...)
  2003-12-30  9:47 ` pinskia at gcc dot gnu dot org
@ 2003-12-30 16:14 ` toon at moene dot indiv dot nluug dot nl
  11 siblings, 0 replies; 13+ messages in thread
From: toon at moene dot indiv dot nluug dot nl @ 2003-12-30 16:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From toon at moene dot indiv dot nluug dot nl  2003-12-30 13:45 -------
The test suite entry is OK with me.  Can you commit it ?

Thanks,

-- 


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


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

end of thread, other threads:[~2003-12-30 13:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-30 16:48 [Bug fortran/13240] New: wrong alignment of automatic adjustable DOUBLE PRECISION array gcc-bug at vogtner dot de
2003-11-30 16:49 ` [Bug fortran/13240] " gcc-bug at vogtner dot de
2003-11-30 16:50 ` gcc-bug at vogtner dot de
2003-11-30 19:21 ` [Bug fortran/13240] [g77] " pinskia at gcc dot gnu dot org
2003-11-30 19:28 ` toon at moene dot indiv dot nluug dot nl
2003-11-30 20:27 ` gcc-bug at vogtner dot de
2003-11-30 20:31 ` pinskia at gcc dot gnu dot org
2003-11-30 21:20 ` gcc-bug at vogtner dot de
2003-11-30 21:22 ` gcc-bug at vogtner dot de
2003-12-30  7:00 ` bdavis9659 at comcast dot net
2003-12-30  8:32 ` bdavis9659 at comcast dot net
2003-12-30  9:47 ` pinskia at gcc dot gnu dot org
2003-12-30 16:14 ` toon at moene dot indiv dot nluug dot nl

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).