public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/17949] New: Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set)
@ 2004-10-12 17:21 sje at cup dot hp dot com
  2004-10-12 17:25 ` [Bug tree-optimization/17949] [4.0 Regression] " pinskia 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 @ 2004-10-12 17:21 UTC (permalink / raw)
  To: gcc-bugs

IA64 sets STRICT_ALIGNMENT to 1 but the tree loop optimizer is converting byte
loads into a unaligned word load (and thus creating an unaligned access).

The attached program compiles and runs with no optimization, fails with -O1 and
works with -O1 -fno-tree-loop-optimize.  With -O1 running the executable core
dumps on IA64 HP-UX and gives an "Unaligned Access" error message on IA64 Linux.

Test case:

    typedef struct
    {
        short i __attribute__ ((packed));
        int f[2] __attribute__ ((packed));
    } A;

    A a;
    int i;

    main ()
    {
        int j;
        for (j = 0; j < 2; j++)
                i += a.f[j];
    }

-- 
           Summary: Tree loop optimization generates unaligned access
                    (STRICT_ALIGNMENT is set)
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sje at cup dot hp dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: ia64-hp-hpux11.23
  GCC host triplet: ia64-hp-hpux11.23
GCC target triplet: ia64-hp-hpux11.23


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


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

* [Bug tree-optimization/17949] [4.0 Regression] Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set)
  2004-10-12 17:21 [Bug tree-optimization/17949] New: Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set) sje at cup dot hp dot com
@ 2004-10-12 17:25 ` pinskia at gcc dot gnu dot org
  2004-12-05  5:01 ` pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-12 17:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-12 17:25 -------
Confirmed, this is caused by IV-OPTS.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rakdver at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2004-10-12 17:25:25
               date|                            |
            Summary|Tree loop optimization      |[4.0 Regression] Tree loop
                   |generates unaligned access  |optimization generates
                   |(STRICT_ALIGNMENT is set)   |unaligned access
                   |                            |(STRICT_ALIGNMENT is set)
   Target Milestone|---                         |4.0.0


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


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

* [Bug tree-optimization/17949] [4.0 Regression] Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set)
  2004-10-12 17:21 [Bug tree-optimization/17949] New: Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set) sje at cup dot hp dot com
  2004-10-12 17:25 ` [Bug tree-optimization/17949] [4.0 Regression] " pinskia at gcc dot gnu dot org
@ 2004-12-05  5:01 ` pinskia at gcc dot gnu dot org
  2004-12-20 11:50 ` steven at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-05  5:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-05 05:01 -------
What we should do create a new type for the same alignment of the struct/array.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|ia64-hp-hpux11.23           |
   GCC host triplet|ia64-hp-hpux11.23           |
 GCC target triplet|ia64-hp-hpux11.23           |ia64-*-*, sparc*-*-*


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


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

* [Bug tree-optimization/17949] [4.0 Regression] Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set)
  2004-10-12 17:21 [Bug tree-optimization/17949] New: Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set) sje at cup dot hp dot com
  2004-10-12 17:25 ` [Bug tree-optimization/17949] [4.0 Regression] " pinskia at gcc dot gnu dot org
  2004-12-05  5:01 ` pinskia at gcc dot gnu dot org
@ 2004-12-20 11:50 ` steven at gcc dot gnu dot org
  2004-12-20 12:49 ` falk at debian dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-12-20 11:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2004-12-20 11:50 -------
Does this affect *all* STRICT_ALIGNMENT targets?  If so, we should
definitely get this one fixed soonish:

alpha/alpha.h:#define STRICT_ALIGNMENT 1
arc/arc.h:#define STRICT_ALIGNMENT 1
arm/arm.h:#define STRICT_ALIGNMENT 1
fr30/fr30.h:#define STRICT_ALIGNMENT 1
frv/frv.h:#define STRICT_ALIGNMENT 1
h8300/h8300.h:#define STRICT_ALIGNMENT 1
i860/i860.h:#define STRICT_ALIGNMENT 1
ia64/ia64.h:#define STRICT_ALIGNMENT 1
iq2000/iq2000.h:#define STRICT_ALIGNMENT 1
m32r/m32r.h:#define STRICT_ALIGNMENT 1
mcore/mcore.h:#define STRICT_ALIGNMENT 1
mips/mips.h:#define STRICT_ALIGNMENT 1
mmix/mmix.h:#define STRICT_ALIGNMENT 1
mn10300/mn10300.h:#define STRICT_ALIGNMENT 1
ns32k/ns32k.h:#define STRICT_ALIGNMENT 1
pa/pa.h:#define STRICT_ALIGNMENT 1
pdp11/pdp11.h:#define STRICT_ALIGNMENT 1
sh/sh.h:#define STRICT_ALIGNMENT 1
sparc/sparc.h:#define STRICT_ALIGNMENT 1
stormy16/stormy16.h:#define STRICT_ALIGNMENT 1
xtensa/xtensa.h:#define STRICT_ALIGNMENT 1


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P1


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


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

* [Bug tree-optimization/17949] [4.0 Regression] Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set)
  2004-10-12 17:21 [Bug tree-optimization/17949] New: Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set) sje at cup dot hp dot com
                   ` (2 preceding siblings ...)
  2004-12-20 11:50 ` steven at gcc dot gnu dot org
@ 2004-12-20 12:49 ` falk at debian dot org
  2004-12-20 13:35 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: falk at debian dot org @ 2004-12-20 12:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From falk at debian dot org  2004-12-20 12:49 -------
(In reply to comment #3)
> Does this affect *all* STRICT_ALIGNMENT targets? 

I can at least reproduce it on Alpha.


-- 


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


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

* [Bug tree-optimization/17949] [4.0 Regression] Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set)
  2004-10-12 17:21 [Bug tree-optimization/17949] New: Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set) sje at cup dot hp dot com
                   ` (3 preceding siblings ...)
  2004-12-20 12:49 ` falk at debian dot org
@ 2004-12-20 13:35 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
  2004-12-20 14:00 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rakdver at atrey dot karlin dot mff dot cuni dot cz @ 2004-12-20 13:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rakdver at atrey dot karlin dot mff dot cuni dot cz  2004-12-20 13:35 -------
Subject: Re:  [4.0 Regression] Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set)

> Does this affect *all* STRICT_ALIGNMENT targets?

Yes, it should.


-- 


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


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

* [Bug tree-optimization/17949] [4.0 Regression] Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set)
  2004-10-12 17:21 [Bug tree-optimization/17949] New: Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set) sje at cup dot hp dot com
                   ` (4 preceding siblings ...)
  2004-12-20 13:35 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
@ 2004-12-20 14:00 ` pinskia at gcc dot gnu dot org
  2004-12-26 17:16 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-20 14:00 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
 GCC target triplet|ia64-*-*, sparc*-*-*        |ia64-*-*, sparc*-*-*,
                   |                            |alpha*-*-*


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


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

* [Bug tree-optimization/17949] [4.0 Regression] Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set)
  2004-10-12 17:21 [Bug tree-optimization/17949] New: Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set) sje at cup dot hp dot com
                   ` (5 preceding siblings ...)
  2004-12-20 14:00 ` pinskia at gcc dot gnu dot org
@ 2004-12-26 17:16 ` pinskia at gcc dot gnu dot org
  2004-12-26 17:17 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-26 17:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-26 17:16 -------
*** Bug 19083 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |danglin at gcc dot gnu dot
                   |                            |org


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


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

* [Bug tree-optimization/17949] [4.0 Regression] Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set)
  2004-10-12 17:21 [Bug tree-optimization/17949] New: Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set) sje at cup dot hp dot com
                   ` (6 preceding siblings ...)
  2004-12-26 17:16 ` pinskia at gcc dot gnu dot org
@ 2004-12-26 17:17 ` pinskia at gcc dot gnu dot org
  2004-12-30 22:30 ` rakdver at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-26 17:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-26 17:17 -------
This also effects hppa*-*-*.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
 GCC target triplet|ia64-*-*, sparc*-*-*,       |ia64-*-*, sparc*-*-*,
                   |alpha*-*-*                  |alpha*-*-* hppa*-*-*


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


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

* [Bug tree-optimization/17949] [4.0 Regression] Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set)
  2004-10-12 17:21 [Bug tree-optimization/17949] New: Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set) sje at cup dot hp dot com
                   ` (7 preceding siblings ...)
  2004-12-26 17:17 ` pinskia at gcc dot gnu dot org
@ 2004-12-30 22:30 ` rakdver at gcc dot gnu dot org
  2004-12-31 19:15 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2004-12-30 22:30 UTC (permalink / raw)
  To: gcc-bugs



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


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


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

* [Bug tree-optimization/17949] [4.0 Regression] Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set)
  2004-10-12 17:21 [Bug tree-optimization/17949] New: Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set) sje at cup dot hp dot com
                   ` (8 preceding siblings ...)
  2004-12-30 22:30 ` rakdver at gcc dot gnu dot org
@ 2004-12-31 19:15 ` pinskia at gcc dot gnu dot org
  2005-01-01 16:28 ` dave at hiauly1 dot hia dot nrc dot ca
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-31 19:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-31 19:15 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-12/msg02156.html>.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug tree-optimization/17949] [4.0 Regression] Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set)
  2004-10-12 17:21 [Bug tree-optimization/17949] New: Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set) sje at cup dot hp dot com
                   ` (9 preceding siblings ...)
  2004-12-31 19:15 ` pinskia at gcc dot gnu dot org
@ 2005-01-01 16:28 ` dave at hiauly1 dot hia dot nrc dot ca
  2005-01-12  0:06 ` cvs-commit at gcc dot gnu dot org
  2005-01-12  0:07 ` rakdver at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: dave at hiauly1 dot hia dot nrc dot ca @ 2005-01-01 16:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dave at hiauly1 dot hia dot nrc dot ca  2005-01-01 16:28 -------
Subject: Re:  [4.0 Regression] Tree loop optimiza

> Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-12/msg02156.html>.

Fixes the testsuite failure on hppa2.0w-hp-hpux11.11.  No regressions
seen.

Thanks,
Dave


-- 


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


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

* [Bug tree-optimization/17949] [4.0 Regression] Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set)
  2004-10-12 17:21 [Bug tree-optimization/17949] New: Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set) sje at cup dot hp dot com
                   ` (10 preceding siblings ...)
  2005-01-01 16:28 ` dave at hiauly1 dot hia dot nrc dot ca
@ 2005-01-12  0:06 ` cvs-commit at gcc dot gnu dot org
  2005-01-12  0:07 ` rakdver at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-12  0:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-01-12 00:06 -------
Subject: Bug 17949

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rakdver@gcc.gnu.org	2005-01-12 00:05:56

Modified files:
	gcc            : ChangeLog tree-ssa-loop-ivopts.c 

Log message:
	PR tree-optimization/17949
	* tree-ssa-loop-ivopts.c (may_be_unaligned_p): New function.
	(find_interesting_uses_address): Use it.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7097&r2=2.7098
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-loop-ivopts.c.diff?cvsroot=gcc&r1=2.39&r2=2.40



-- 


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


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

* [Bug tree-optimization/17949] [4.0 Regression] Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set)
  2004-10-12 17:21 [Bug tree-optimization/17949] New: Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set) sje at cup dot hp dot com
                   ` (11 preceding siblings ...)
  2005-01-12  0:06 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-12  0:07 ` rakdver at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2005-01-12  0:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rakdver at gcc dot gnu dot org  2005-01-12 00:07 -------
Fixed.

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


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


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

end of thread, other threads:[~2005-01-12  0:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-12 17:21 [Bug tree-optimization/17949] New: Tree loop optimization generates unaligned access (STRICT_ALIGNMENT is set) sje at cup dot hp dot com
2004-10-12 17:25 ` [Bug tree-optimization/17949] [4.0 Regression] " pinskia at gcc dot gnu dot org
2004-12-05  5:01 ` pinskia at gcc dot gnu dot org
2004-12-20 11:50 ` steven at gcc dot gnu dot org
2004-12-20 12:49 ` falk at debian dot org
2004-12-20 13:35 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
2004-12-20 14:00 ` pinskia at gcc dot gnu dot org
2004-12-26 17:16 ` pinskia at gcc dot gnu dot org
2004-12-26 17:17 ` pinskia at gcc dot gnu dot org
2004-12-30 22:30 ` rakdver at gcc dot gnu dot org
2004-12-31 19:15 ` pinskia at gcc dot gnu dot org
2005-01-01 16:28 ` dave at hiauly1 dot hia dot nrc dot ca
2005-01-12  0:06 ` cvs-commit at gcc dot gnu dot org
2005-01-12  0:07 ` rakdver 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).