public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/21024] New: Type mismatch in a comparison.
@ 2005-04-14 16:19 kazu at cs dot umass dot edu
  2005-04-14 16:48 ` [Bug c/21024] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-04-14 16:19 UTC (permalink / raw)
  To: gcc-bugs

Consider:

extern void *bar (void);

int
foo (unsigned int *p)
{
  const void *r = bar ();

  if (r >= (const void *) *p)
    return 1;

  return 0;
}

t03.generic looks like so.

foo (p)
{
  void * D.1155;
  unsigned int D.1156;
  int D.1157;
  const void * r;

  D.1155 = bar ();
  r = D.1155;
  D.1156 = *p;
  if (D.1156 <= r)
    {
      D.1157 = 1;
      return D.1157;
    }
  else
    {
      
    }
  D.1157 = 0;
  return D.1157;
}

Note that "if (D.1156 <= r)" has a type mismatch, namely an integer type
v.s. a pointer type.

This PR is the real cause of PR 21021.

-- 
           Summary: Type mismatch in a comparison.
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kazu at cs dot umass dot edu
                CC: dnovillo at redhat dot com,gcc-bugs at gcc dot gnu dot
                    org
OtherBugsDependingO 21021
             nThis:


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


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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-14 16:19 [Bug c/21024] New: Type mismatch in a comparison kazu at cs dot umass dot edu
2005-04-14 16:48 ` [Bug c/21024] " pinskia at gcc dot gnu dot org
2005-04-15 16:38 ` [Bug c/21024] fold generates a comparison of two operands whose types do not match kazu at cs dot umass dot edu
2005-04-16 14:07 ` [Bug middle-end/21024] " kazu at cs dot umass dot edu
2005-04-17  1:38 ` cvs-commit at gcc dot gnu dot org
2005-04-17  1:41 ` kazu at cs dot umass dot edu
2005-04-20  2:06 ` 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).