[Bug middle-end/45819] [4.5 Regression] unexpected unaligned access to volatile int

2011-07-22 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45819

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2011.07.22 09:49:13
 AssignedTo|unassigned at gcc dot   |rguenth at gcc dot gnu.org
   |gnu.org |
 Ever Confirmed|0   |1

--- Comment #10 from Richard Guenther rguenth at gcc dot gnu.org 2011-07-22 
09:49:13 UTC ---
Testing a fix for the volatile issue in comment #9.

I can't reproduce anything wrong with the testcase from the initial comment,
that looks like a target / expander issue.

The issues probably should have had different bugs instead of lumping them
together here.


[Bug middle-end/45819] [4.5 Regression] unexpected unaligned access to volatile int

2011-07-22 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45819

--- Comment #11 from Richard Guenther rguenth at gcc dot gnu.org 2011-07-22 
11:55:33 UTC ---
Author: rguenth
Date: Fri Jul 22 11:55:30 2011
New Revision: 176623

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=176623
Log:
2011-07-22  Richard Guenther  rguent...@suse.de

PR tree-optimization/45819
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Properly
preserve volatile and notrap flags.

* gcc.dg/pr45819.c: New testcase.

Added:
trunk/gcc/testsuite/gcc.dg/pr45819.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-forwprop.c


[Bug middle-end/45819] [4.5 Regression] unexpected unaligned access to volatile int

2011-07-22 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45819

--- Comment #12 from Richard Guenther rguenth at gcc dot gnu.org 2011-07-22 
12:19:25 UTC ---
Author: rguenth
Date: Fri Jul 22 12:19:21 2011
New Revision: 176624

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=176624
Log:
2011-07-22  Richard Guenther  rguent...@suse.de

PR tree-optimization/45819
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Properly
preserve volatile and notrap flags.

* gcc.dg/pr45819.c: New testcase.

Added:
branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/pr45819.c
Modified:
branches/gcc-4_6-branch/gcc/ChangeLog
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
branches/gcc-4_6-branch/gcc/tree-ssa-forwprop.c


[Bug middle-end/45819] [4.5 Regression] unexpected unaligned access to volatile int

2011-07-22 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45819

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|NEW
 AssignedTo|rguenth at gcc dot gnu.org  |unassigned at gcc dot
   ||gnu.org

--- Comment #13 from Richard Guenther rguenth at gcc dot gnu.org 2011-07-22 
12:20:30 UTC ---
Comment #9 should be fixed now.  That leaves the initial report which I
can't reproduce - thus, not mine anymore.

Please someone verify comment #9 on arm.


[Bug middle-end/45819] [4.5 Regression] unexpected unaligned access to volatile int

2011-07-22 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45819

--- Comment #14 from Richard Guenther rguenth at gcc dot gnu.org 2011-07-22 
12:21:30 UTC ---
Oh, the initial testcase was invalid anyway.


[Bug middle-end/45819] [4.5 Regression] unexpected unaligned access to volatile int

2011-07-22 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45819

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID

--- Comment #15 from Richard Guenther rguenth at gcc dot gnu.org 2011-07-22 
12:25:01 UTC ---
struct ehci_regs {  
char x; 
unsigned int port_status[0];
} __attribute__ ((packed)); 
//} __attribute__ ((packed,aligned(__alignof__(int; 

struct ehci_hcd{
struct ehci_regs *regs; 
};  

int ehci_hub_control (  
 struct ehci_hcd *ehci, 
 int wIndex 
) { 
 unsigned int *status_reg = ehci-regs-port_status[wIndex];   
 return *(volatile unsigned int *)status_reg;   
}

this one is invalid as well, with or without the aligned attribute.

ehci-regs-port_status[wIndex] _is_ unaligned.  I don't think there
is currently a way to tell GCC that the struct layout of ehci_regs is
packed but port_status is properly aligned to the natural alignment of int.


[Bug middle-end/45819] [4.5 Regression] unexpected unaligned access to volatile int

2011-06-09 Thread raj.khem at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45819

Khem Raj raj.khem at gmail dot com changed:

   What|Removed |Added

 CC||raj.khem at gmail dot com

--- Comment #9 from Khem Raj raj.khem at gmail dot com 2011-06-09 06:47:01 
UTC ---
here is another testcase which generates loadbytes with gcc 4.6 but works as
expected with gcc 4.5 on arm. gcc are latest from respective branches. and it
fails irrespective of having -fstrict-volatile-bitfields or not.

struct ehci_regs {  
char x; 
unsigned int port_status[0];
} __attribute__ ((packed)); 
//} __attribute__ ((packed,aligned(__alignof__(int; 

struct ehci_hcd{
struct ehci_regs *regs; 
};  

int ehci_hub_control (  
 struct ehci_hcd *ehci, 
 int wIndex 
) { 
 unsigned int *status_reg = ehci-regs-port_status[wIndex];   
 return *(volatile unsigned int *)status_reg;   
}


[Bug middle-end/45819] [4.5 Regression] unexpected unaligned access to volatile int

2011-04-28 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45819

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|4.5.3   |4.5.4

--- Comment #8 from Richard Guenther rguenth at gcc dot gnu.org 2011-04-28 
14:51:01 UTC ---
GCC 4.5.3 is being released, adjusting target milestone.


[Bug middle-end/45819] [4.5 Regression] unexpected unaligned access to volatile int

2011-02-22 Thread anemo at mba dot ocn.ne.jp
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45819

--- Comment #7 from Atsushi Nemoto anemo at mba dot ocn.ne.jp 2011-02-22 
13:04:10 UTC ---
(In reply to comment #5)
 arm-linux-gnueabi-gcc-4.6.0-20101124 works fine (generates ldr instruction),

It seems that was a side-effect of -fstrict-volatile-bitfields which was
enabled
by default on ARM EABI.
With -fno-strict-volatile-bitfields, arm-linux-gnueabi-gcc-4.6.0-20110222
generates
four ldrb instructions.


[Bug middle-end/45819] [4.5 Regression] unexpected unaligned access to volatile int

2010-12-16 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45819

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|4.5.2   |4.5.3

--- Comment #6 from Richard Guenther rguenth at gcc dot gnu.org 2010-12-16 
13:02:50 UTC ---
GCC 4.5.2 is being released, adjusting target milestone.


[Bug middle-end/45819] [4.5 Regression] unexpected unaligned access to volatile int

2010-11-24 Thread anemo at mba dot ocn.ne.jp
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45819

--- Comment #5 from Atsushi Nemoto anemo at mba dot ocn.ne.jp 2010-11-24 
14:34:00 UTC ---
(In reply to comment #4)
 Can someone check if 4.6 is really not affected?

arm-linux-gnueabi-gcc-4.6.0-20101124 works fine (generates ldr instruction),
but mipsel-linux-gcc-4.6.0-20101124 still generates lbu (load-byte-unsigned)
instructions.


[Bug middle-end/45819] [4.5 Regression] unexpected unaligned access to volatile int

2010-11-12 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45819

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P2

--- Comment #4 from Richard Guenther rguenth at gcc dot gnu.org 2010-11-12 
13:57:45 UTC ---
Can someone check if 4.6 is really not affected?


[Bug middle-end/45819] [4.5 Regression] unexpected unaligned access to volatile int

2010-09-30 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45819

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |4.5.2


[Bug middle-end/45819] [4.5 Regression] unexpected unaligned access to volatile int

2010-09-29 Thread anemo at mba dot ocn.ne.jp
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45819

--- Comment #3 from Atsushi Nemoto anemo at mba dot ocn.ne.jp 2010-09-30 
02:06:18 UTC ---
(In reply to comment #1)
 As a matter of clean implementation I suggest to do
 
 struct st {
 int ptr;
 } __attribute__ ((packed,aligned(__alignof__(int;

I confirmed this fixes the problem.
But fixing all packed structure in linux kernel like this would be so hard, I
think.