public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/27302]  New: Fold does not fold i < j == j > i to 1
@ 2006-04-25 10:27 rguenth at gcc dot gnu dot org
  2006-04-25 18:31 ` [Bug middle-end/27302] Fold does not fold (i < j) == (j > i) " pinskia 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 @ 2006-04-25 10:27 UTC (permalink / raw)
  To: gcc-bugs

For the testcase

int foo(int i, int j)
{
  return (i < j) == (j > i);
}

fold does not fold the expression to 1, but instead to
  i < j ^ j > i
which should be done as a last resort only.  fold_comparison does not
handle the original tree either, nor does operand_equal_p see that both
operands of the EQ_EXPR are "equal".


-- 
           Summary: Fold does not fold i < j == j > i to 1
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: middle-end
        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=27302


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

end of thread, other threads:[~2007-02-06 12:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-25 10:27 [Bug middle-end/27302] New: Fold does not fold i < j == j > i to 1 rguenth at gcc dot gnu dot org
2006-04-25 18:31 ` [Bug middle-end/27302] Fold does not fold (i < j) == (j > i) " pinskia at gcc dot gnu dot org
2006-05-06 13:52 ` rguenth at gcc dot gnu dot org
2006-05-10 10:22 ` rguenth at gcc dot gnu dot org
2006-05-10 11:03 ` rguenth at gcc dot gnu dot org
2006-05-15 19:38 ` patchapp at dberlin dot org
2007-02-06 12:39 ` 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).