From db7f771921b133b9f9b5f99fe277be63a413e0f0 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 5 Jun 2009 23:12:07 -0700 Subject: use cc provided xlog2 instead of system log2. (on plan 9 cc calls it log2, but that conflicts here.) the difference is that xlog2 returns -1 on non powers of 2. 8c was rewriting /10 into /8. R=ken OCL=29968 CL=29968 --- src/cmd/8c/cgen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cmd/8c/cgen.c') diff --git a/src/cmd/8c/cgen.c b/src/cmd/8c/cgen.c index 8c5bf7b15..1df03ef50 100644 --- a/src/cmd/8c/cgen.c +++ b/src/cmd/8c/cgen.c @@ -346,7 +346,7 @@ cgen(Node *n, Node *nn) c = r->vconst; if(c < 0) c = -c; - v = log2(c); + v = xlog2(c); if(v < 0) break; /* fall thru */ @@ -609,7 +609,7 @@ cgen(Node *n, Node *nn) c = r->vconst; if(c < 0) c = -c; - v = log2(c); + v = xlog2(c); if(v < 0) break; /* fall thru */ -- cgit v1.2.3