public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/20290] New: Miscompilation on ppc with -Os
@ 2005-03-02 20:33 jakub at gcc dot gnu dot org
  2005-03-02 20:40 ` [Bug rtl-optimization/20290] [4.0 Regression] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-03-02 20:33 UTC (permalink / raw)
  To: gcc-bugs

extern void abort (void);

void
check (unsigned int *l)
{
  int i;
  for (i = 0; i < 288; i++)
    if (l[i] != 7 + (i < 256 || i >= 280) + (i >= 144 && i < 256))
      abort ();
}

int
main (void)
{
  int i;
  unsigned int l[288];

  for (i = 0; i < 144; i++)
    l[i] = 8;
  for (; i < 256; i++)
    l[i] = 9;
  for (; i < 280; i++)
    l[i] = 7;
  for (; i < 288; i++)
    l[i] = 8;
  check (l);
  return 0;
}

is miscompiled on ppc with -m32 -Os.  l[256] is never set.  From initial looking
at the dumps it seems that a final value of i after the loop was miscomputed
as 257 instead of the correct 256.

-- 
           Summary: Miscompilation on ppc with -Os
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: powerpc-redhat-linux


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


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

end of thread, other threads:[~2005-04-02 17:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-02 20:33 [Bug rtl-optimization/20290] New: Miscompilation on ppc with -Os jakub at gcc dot gnu dot org
2005-03-02 20:40 ` [Bug rtl-optimization/20290] [4.0 Regression] " pinskia at gcc dot gnu dot org
2005-03-02 20:44 ` [Bug middle-end/20290] [4.0/4.1 " pinskia at gcc dot gnu dot org
2005-03-02 21:17 ` jakub at gcc dot gnu dot org
2005-03-02 23:09 ` jakub at gcc dot gnu dot org
2005-03-02 23:12 ` jakub at gcc dot gnu dot org
2005-03-02 23:15 ` rakdver at gcc dot gnu dot org
2005-03-04 14:58 ` [Bug middle-end/20290] [4.0/4.1 Regression] Miscompilation on ppc/arm " pinskia at gcc dot gnu dot org
2005-03-20 18:34 ` [Bug rtl-optimization/20290] " aoliva at redhat dot com
2005-03-31 21:46 ` rth at gcc dot gnu dot org
2005-04-02 16:54 ` cvs-commit at gcc dot gnu dot org
2005-04-02 16:54 ` cvs-commit at gcc dot gnu dot org
2005-04-02 17:02 ` aoliva 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).