public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/45232]  New: Several passes introduce undefined overflow
@ 2010-08-08 12:31 rguenth at gcc dot gnu dot org
  2010-08-08 12:35 ` [Bug tree-optimization/45232] " rguenth at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-08-08 12:31 UTC (permalink / raw)
  To: gcc-bugs

Fold:

extern void abort (void);
int i = 1;
int main()
{
 if ((i - 1) - (-__INT_MAX__ - 1) != (-__INT_MAX__ - 1))
   abort ();
 return 0;
}

Forwprop (and reassoc with -fno-tree-forwprop) at -O1:

extern void abort (void);
int i = 1;
int main()
{
 int j = i - 1;
 j = j - (-__INT_MAX__ - 1);
 if (j != (-__INT_MAX__ - 1))
   abort ();
 return 0;
}

Not so VRP itself (it doesn't derive ranges from VARYING +- CST for
signed arithmetic).


-- 
           Summary: Several passes introduce undefined overflow
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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


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

end of thread, other threads:[~2010-08-12 10:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-08 12:31 [Bug tree-optimization/45232] New: Several passes introduce undefined overflow rguenth at gcc dot gnu dot org
2010-08-08 12:35 ` [Bug tree-optimization/45232] " rguenth at gcc dot gnu dot org
2010-08-08 12:55 ` [Bug tree-optimization/45232] Tree reassociation introduces " rguenth at gcc dot gnu dot org
2010-08-08 22:42 ` ebotcazou at gcc dot gnu dot org
2010-08-10  9:24 ` [Bug tree-optimization/45232] [4.6 regression] tree " rguenth at gcc dot gnu dot org
2010-08-12 10:38 ` rguenth at gcc dot gnu dot org
2010-08-12 10:38 ` rguenth 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).