[Bug tree-optimization/51782] Missing address-space information leads to wrong code

2012-01-12 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51782

Georg-Johann Lay gjl at gcc dot gnu.org changed:

   What|Removed |Added

 CC||mjambor at suse dot cz

--- Comment #9 from Georg-Johann Lay gjl at gcc dot gnu.org 2012-01-12 
16:19:14 UTC ---
(In reply to comment #7)
 Please figure out where the address-space information is lost.

Is -f[no-]tree-sra enough information to find the bug for someone familiar with
RSA?

Here is an even simpler test case:

struct rgb { char r; };

char read_rgb_bug (const __pgm struct rgb *s)
{
struct rgb t = *s;

return t.r;
}


[Bug tree-optimization/51782] Missing address-space information leads to wrong code

2012-01-09 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51782

--- Comment #7 from Richard Guenther rguenth at gcc dot gnu.org 2012-01-09 
12:04:30 UTC ---
Please figure out where the address-space information is lost.


[Bug tree-optimization/51782] Missing address-space information leads to wrong code

2012-01-09 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51782

--- Comment #8 from Georg-Johann Lay gjl at gcc dot gnu.org 2012-01-09 
20:30:35 UTC ---
It's scalar replacement of aggregates:

With -O1 code is wrong.
With -O1 -fno-tree-sra code is correct.


[Bug tree-optimization/51782] Missing address-space information leads to wrong code

2012-01-07 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51782

Georg-Johann Lay gjl at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2012-01-07
 CC||flamorce at videotron dot
   ||ca
   Target Milestone|--- |4.7.0
 Ever Confirmed|0   |1


[Bug tree-optimization/51782] Missing address-space information leads to wrong code

2012-01-07 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51782

--- Comment #1 from Georg-Johann Lay gjl at gcc dot gnu.org 2012-01-07 
12:05:20 UTC ---
Created attachment 26262
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=26262
a-bug.c

C source file triggering the bug.


[Bug tree-optimization/51782] Missing address-space information leads to wrong code

2012-01-07 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51782

--- Comment #2 from Georg-Johann Lay gjl at gcc dot gnu.org 2012-01-07 
12:08:25 UTC ---
Created attachment 26263
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=26263
a-bug.s (assembler output)

read_rgb_ok uses LPM instructions to read data (okay)
read_rgb_bug uses LD/LDD instructions to read data (wrong)


[Bug tree-optimization/51782] Missing address-space information leads to wrong code

2012-01-07 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51782

--- Comment #3 from Georg-Johann Lay gjl at gcc dot gnu.org 2012-01-07 
12:09:41 UTC ---
Created attachment 26264
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=26264
a-bug.c.003t.original

a-bug.c.003t.original tree-dump, FYI


[Bug tree-optimization/51782] Missing address-space information leads to wrong code

2012-01-07 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51782

--- Comment #4 from Georg-Johann Lay gjl at gcc dot gnu.org 2012-01-07 
12:11:03 UTC ---
Created attachment 26265
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=26265
a-bug.c.004t.gimple

a-bug.c.004t.gimple tree-dump, FYI


[Bug tree-optimization/51782] Missing address-space information leads to wrong code

2012-01-07 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51782

--- Comment #5 from Georg-Johann Lay gjl at gcc dot gnu.org 2012-01-07 
12:11:50 UTC ---
Created attachment 26266
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=26266
a-bug.c.149t.optimized

a-bug.c.149t.optimized tree dump, FYI


[Bug tree-optimization/51782] Missing address-space information leads to wrong code

2012-01-07 Thread gjl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51782

--- Comment #6 from Georg-Johann Lay gjl at gcc dot gnu.org 2012-01-07 
12:17:21 UTC ---
Created attachment 26267
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=26267
a-bug.c.150r.expand

a-bug.c.150r.expand RTL dump, FYI

As you can see in read_rgb_ok that move insns 8, 9, 13 are reading from AS1
which is __pgm. This code is correct

In read_rgb_bug, insns 8, 9 and 13 are reading from generic address space
brcause there is no address space information. This code is wrong.