public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/20466] New: Missed invalidation of known memory contents in flow2...
@ 2005-03-14  3:22 hp at gcc dot gnu dot org
  2005-03-14  3:23 ` [Bug rtl-optimization/20466] " hp at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: hp at gcc dot gnu dot org @ 2005-03-14  3:22 UTC (permalink / raw)
  To: gcc-bugs

... causes invalid removal of memory write.  The following test-case will be
committed as gcc.c-torture/execute/prXXXXXX-1.c; it is miscompiled at -O2.
The first assignment to **ipp is removed in .flow2.  This bug has been there
since at least 3.2.1.

void f (int **, int *, int *, int **, int **) __attribute__ ((__noinline__));
void
f (int **ipp, int *i1p, int *i2p, int **i3, int **i4)
{
  **ipp = *i1p;
  *ipp = i2p;
  *i3 = *i4;
  **ipp = 99;
}

extern void exit (int);
extern void abort (void);

int main (void)
{
  int i = 42, i1 = 66, i2 = 1, i3 = -1, i4 = 55;
  int *ip = &i;
  int *i3p = &i3;
  int *i4p = &i4;
  
  f (&ip, &i1, &i2, &i3p, &i4p);
  if (i != 66 || ip != &i2 || i2 != 99 || i3 != -1 || i3p != i4p || i4 != 55)
    abort ();
  exit (0);
}

-- 
           Summary: Missed invalidation of known memory contents in flow2...
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hp at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: cris-*


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


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

end of thread, other threads:[~2005-04-20  2:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-14  3:22 [Bug rtl-optimization/20466] New: Missed invalidation of known memory contents in flow2 hp at gcc dot gnu dot org
2005-03-14  3:23 ` [Bug rtl-optimization/20466] " hp at gcc dot gnu dot org
2005-03-14  3:26 ` pinskia at gcc dot gnu dot org
2005-03-14  4:28 ` hp at gcc dot gnu dot org
2005-03-16  1:43 ` hp at gcc dot gnu dot org
2005-04-08 23:18 ` cvs-commit at gcc dot gnu dot org
2005-04-08 23:21 ` cvs-commit at gcc dot gnu dot org
2005-04-08 23:24 ` hp at gcc dot gnu dot org
2005-04-20  2:35 ` pinskia 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).