http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58209
Bug ID: 58209
Summary: ICE in extract_range_from_binary_expr, at
tree-vrp.c:2294
Product: gcc
Version: 4.7.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: doko at gcc dot gnu.org
seen with 4.6.4, 4.7.3, 4.8.1 and trunk with -O2, lowering to -O1 works around
the issue.
$ gcc-4.7 -c -O2 foo.c
foo.c: In function 'pow2_s':
foo.c:3:7: internal compiler error: in build2_stat, at tree.c:3785
Please submit a full bug report,
with preprocessed source if appropriate.
$ /usr/lib/gcc-snapshot/bin/gcc -c -O2 foo.c
foo.c: In function 'pow2_s':
foo.c:25:1: error: invalid (pointer) operands to plus/minus
}
^
acc_tmp_14 = add_acc_5 + _1;
foo.c:25:1: internal compiler error: verify_gimple failed
Please submit a full bug report,
$ cat foo.c
#include <stdint.h>
void *pow2_s(void *arg)
{
intptr_t n = (intptr_t)arg;
if (n == 0)
return (void *)1;
n--;
intptr_t s1 = (intptr_t)pow2_s((void *)n);
intptr_t s2 = (intptr_t)pow2_s((void *)n);
return (void *)(s1 + s2);
}
int main(void)
{
intptr_t n = 5;
pow2_s((void *)n);
return 0;
}