[PATCH] Fix PR 12092, ICE (FP exception, divide by zero) when using -fprefetch-loop-arrays

Andrew Pinski pinskia@physics.uc.edu
Mon Sep 8 05:31:00 GMT 2003


The problem is PREFETCH_BLOCK as defined as ix86_cost->prefetch_block 
which is zero at
this point because we are tuning for i486 (which does not have prefetch 
at all) but our
arch is pentium4 which does have prefetch so we try to use prefetch but 
we need to
figure out if it is good to prefetch so we do a divide on 
PREFETCH_BLOCK but since
PREFETCH_BLOCK is zero here, we get an floating exception.

Here is a patch to avoid the floating exceptions by checking for a zero 
PREFETCH_BLOCK
before dividing.

OK?

ChangeLog:
	* loop.c (emit_prefetch_instructions): Check for zero
	PREFETCH_BLOCK when dividing by it.

Patch:

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: loop.patch.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030908/6cda02cc/attachment.txt>
-------------- next part --------------


Thanks,
Andrew Pinski


More information about the Gcc-patches mailing list