public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/46562] New: CCP currently needs iteration for &a[i]
@ 2010-11-19 15:45 rguenth at gcc dot gnu.org
  2010-11-19 15:50 ` [Bug tree-optimization/46562] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-19 15:45 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: CCP currently needs iteration for &a[i]
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: rguenth@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org


static int a[4];
int foo(void)
{
  int i = 1;
  int *p = &a[i];
  return *p;
}

compiled with the C++ FE (to yield an ARRAY_REF) shows that CCP needs
to iterate to figure out that p is a constant (and thus fold the read
from a[1]).


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

end of thread, other threads:[~2011-03-24 11:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-19 15:45 [Bug tree-optimization/46562] New: CCP currently needs iteration for &a[i] rguenth at gcc dot gnu.org
2010-11-19 15:50 ` [Bug tree-optimization/46562] " rguenth at gcc dot gnu.org
2010-11-19 16:04 ` rguenth at gcc dot gnu.org
2010-11-23 16:28 ` rguenth at gcc dot gnu.org
2010-11-24 13:45 ` rguenth at gcc dot gnu.org
2011-03-24 11:46 ` rguenth at gcc dot gnu.org
2011-03-24 12:11 ` rguenth 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).