public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/51782] New: Missing address-space information leads to wrong code
@ 2012-01-07 12:03 gjl at gcc dot gnu.org
  2012-01-07 12:04 ` [Bug tree-optimization/51782] " gjl at gcc dot gnu.org
                   ` (29 more replies)
  0 siblings, 30 replies; 31+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-01-07 12:03 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51782
           Summary: Missing address-space information leads to wrong code
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: addr-space, wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gjl@gcc.gnu.org
                CC: eric.weddington@atmel.com
            Target: avr


This is a bug with named address spaces trunk gcc 4.7 for the following source.

struct rgb { char r, g, b; };

char read_rgb_ok (const __pgm struct rgb *s)
{
    return s->r + s->g  + s->b;
}

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

    return t.r + t.g  + t.b;
}

Reading through *s must happen by means of LPM instructions (reading from
flash) and not by menas of LD instructions (reading from RAM).

However, the second function reads from RAM.


== Command Line ==

avr-gcc a-bug.c -S -Os -mmcu=avr4 -dp -fverbose-asm -v \
    -fdump-tree-optimized -fdump-tree-original -fdump-rtl-expand
-fdump-tree-gimple


== configure ==

Generated from 4.7.0 sources (HEAD) from 2012-01-03 SVN 182900

Target: avr
Configured with: ../../gcc.gnu.org/trunk/configure --target=avr
--prefix=/local/gnu/install/gcc-4.7-mingw32 --host=i386-mingw32
--build=i686-linux-gnu --enable-languages=c,c++ --disable-nls --disable-shared
--disable-lto --disable-checking --disable-libquadmath --with-dwarf2
Thread model: single
gcc version 4.7.0 20120102 (experimental) (GCC)


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

end of thread, other threads:[~2012-02-22 10:55 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-07 12:03 [Bug tree-optimization/51782] New: Missing address-space information leads to wrong code gjl at gcc dot gnu.org
2012-01-07 12:04 ` [Bug tree-optimization/51782] " gjl at gcc dot gnu.org
2012-01-07 12:06 ` gjl at gcc dot gnu.org
2012-01-07 12:08 ` gjl at gcc dot gnu.org
2012-01-07 12:10 ` gjl at gcc dot gnu.org
2012-01-07 12:11 ` gjl at gcc dot gnu.org
2012-01-07 12:12 ` gjl at gcc dot gnu.org
2012-01-07 12:17 ` gjl at gcc dot gnu.org
2012-01-09 12:05 ` rguenth at gcc dot gnu.org
2012-01-09 20:30 ` gjl at gcc dot gnu.org
2012-01-12 16:19 ` gjl at gcc dot gnu.org
2012-01-12 17:18 ` [Bug tree-optimization/51782] -ftree-sra: Missing address-space information leads to wrong jamborm at gcc dot gnu.org
2012-01-12 18:09 ` gjl at gcc dot gnu.org
2012-01-17 15:26 ` rguenth at gcc dot gnu.org
2012-01-18  9:34 ` gjl at gcc dot gnu.org
2012-01-25 19:18 ` gjl at gcc dot gnu.org
2012-02-17 13:06 ` jamborm at gcc dot gnu.org
2012-02-17 18:01 ` jamborm at gcc dot gnu.org
2012-02-17 18:52 ` jamborm at gcc dot gnu.org
2012-02-19 10:16 ` gjl at gcc dot gnu.org
2012-02-20  9:43 ` rguenther at suse dot de
2012-02-20 17:57 ` jamborm at gcc dot gnu.org
2012-02-20 20:15 ` rguenther at suse dot de
2012-02-21 10:14 ` gjl at gcc dot gnu.org
2012-02-21 10:41 ` [Bug middle-end/51782] " jamborm at gcc dot gnu.org
2012-02-21 10:41 ` jamborm at gcc dot gnu.org
2012-02-21 11:51 ` dominiq at lps dot ens.fr
2012-02-21 11:58 ` gjl at gcc dot gnu.org
2012-02-21 13:20 ` jamborm at gcc dot gnu.org
2012-02-22 10:55 ` jamborm at gcc dot gnu.org
2012-02-22 11:00 ` jamborm at gcc dot gnu.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).