When compiling this sample code
int myvar;

int foo(int mynum)
{
    if ((((void *)0) ==
         (
          myvar & ((1U<<0) << mynum)
         )
         )
        && (mynum > 0)
        )
      {
        return 1;
      }
    return 0;
}

with GCC-4.1.1, 4.1.2, 4.2.2, I get:
internal compiler error: in compare_values_warnv, at tree-vrp.c:701

It occurs only when compiling at -O2, -O3 or -Os, not at -O1.

If I remove the (void*) cast, compilation is successful.


-- 
           Summary: ICE in in compare_values_warnv, at tree-vrp.c:701
           Product: gcc
           Version: 4.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: christophe dot lyon at st dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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

Reply via email to