From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4382 invoked by alias); 9 Dec 2013 03:26:51 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 4365 invoked by uid 89); 9 Dec 2013 03:26:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Dec 2013 03:26:48 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB93Qfrh028081 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 8 Dec 2013 22:26:41 -0500 Received: from stumpy.slc.redhat.com (ovpn-113-102.phx2.redhat.com [10.3.113.102]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rB93Qemx021211; Sun, 8 Dec 2013 22:26:40 -0500 Message-ID: <52A53870.5000804@redhat.com> Date: Mon, 09 Dec 2013 03:26:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: "Bin.Cheng" , Ian Lance Taylor CC: "gcc-help@gcc.gnu.org" , Richard Biener Subject: Re: Division by ZERO on GIMPLE? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00061.txt.bz2 On 12/08/13 05:16, Bin.Cheng wrote: > On Sun, Dec 8, 2013 at 9:29 AM, Ian Lance Taylor wrote: >> On Sat, Dec 7, 2013 at 1:48 AM, Bin.Cheng wrote: >>> >>> I just found some GIMPLE like below is generated during boostrap gcc >>> for x86, tree-vect-loop.c >>> >>> >>> : >>> # group_size_1432 = PHI <1(497), group_size_1017(660)> >>> # scalar_dest_1287 = PHI >>> ratio_1497 = group_size_1432 / 0; >>> goto ; >>> >>> 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