Re: Division by ZERO on GIMPLE?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/08/13 05:16, Bin.Cheng wrote:
On Sun, Dec 8, 2013 at 9:29 AM, Ian Lance Taylor <iant@xxxxxxxxxx> wrote:
On Sat, Dec 7, 2013 at 1:48 AM, Bin.Cheng <amker.cheng@xxxxxxxxx> wrote:

I just found some GIMPLE like below is generated during boostrap gcc
for x86, tree-vect-loop.c


   <bb 637>:
   # group_size_1432 = PHI <1(497), group_size_1017(660)>
   # scalar_dest_1287 = PHI <scalar_dest_1228(497), scalar_dest_1012(660)>
   ratio_1497 = group_size_1432 / 0;
   goto <bb 501>;

The compilation ends fine, but what is the division by 0?

Pretty hard to say without more information.  I just tried, and I
don't see it myself.  I would guess that some optimization split out
the ratio == 0 case for some reason.

It disappeared with Richard's checkin r205730.  Also I am not sure is
why the rest of compiler can live with that code.
Well, in an ideal world we'd detect this, isolate the path, emit a trap after the /0, remove all the outgoing edges and issue a warning. I'll put it on the TODO list.

As long as the compiler doesn't try to evaluate that code, then it should not cause an problems. It's not significantly different than if there was a divide by an SSA_NAME where the SSA_NAME might have the value zero.

jeff




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux