public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/20922] New: missed always false conditional
@ 2005-04-09 21:36 pinskia at gcc dot gnu dot org
  2005-04-10 21:02 ` [Bug tree-optimization/20922] " pinskia at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-09 21:36 UTC (permalink / raw)
  To: gcc-bugs

The following function should just "return 1":
int f(int i)
{
  int i1 = i -2;
  if (i1 > i)
    return 0;
  return 1;
}
We miss this on the tree level, I found this while look into the following fortran code:
SUBROUTINE d ( a, b,n)
IMPLICIT NONE
INTEGER :: n
REAL,DIMENSION(n) :: a
REAL,DIMENSION(n) :: b
b(n-2:n) = sqrt(a(n-2:n))
END SUBROUTINE d


In final_cleanup, we have:
  D.679 = *n;
  S.2 = D.679 - 2;
  if (D.679 < S.2) goto L.1; else goto <L7>;

-- 
           Summary: missed always false conditional
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, TREE
          Severity: enhancement
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-04-25  1:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-09 21:36 [Bug tree-optimization/20922] New: missed always false conditional pinskia at gcc dot gnu dot org
2005-04-10 21:02 ` [Bug tree-optimization/20922] " pinskia at gcc dot gnu dot org
2005-04-10 21:03 ` pinskia at gcc dot gnu dot org
2005-04-10 21:06 ` pinskia at gcc dot gnu dot org
2005-04-10 22:00 ` kazu at cs dot umass dot edu
2005-04-10 23:43 ` pinskia at gcc dot gnu dot org
2005-04-11 19:50 ` pinskia at gcc dot gnu dot org
2005-04-16 17:12 ` phython at gcc dot gnu dot org
2005-04-18 15:18 ` cvs-commit at gcc dot gnu dot org
2005-04-18 15:20 ` phython at gcc dot gnu dot org
2005-04-18 15:38 ` pinskia at gcc dot gnu dot org
2005-04-25  0:38 ` markus at oberhumer dot com
2005-04-25  0:40 ` pinskia at gcc dot gnu dot org
2005-04-25  0:42 ` jim dot morrison at gmail dot com
2005-04-25  1:01 ` markus at oberhumer dot com

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).