From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3715 invoked by alias); 6 Mar 2014 13:28:39 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 3700 invoked by uid 89); 6 Mar 2014 13:28:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,UNSUBSCRIBE_BODY autolearn=no version=3.3.2 X-HELO: out3-smtp.messagingengine.com Received: from out3-smtp.messagingengine.com (HELO out3-smtp.messagingengine.com) (66.111.4.27) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 06 Mar 2014 13:28:36 +0000 Received: from compute5.internal (compute5.nyi.mail.srv.osa [10.202.2.45]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 4DDF4210F0 for ; Thu, 6 Mar 2014 08:28:34 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Thu, 06 Mar 2014 08:28:34 -0500 Received: from [129.199.97.229] (unknown [129.199.97.229]) by mail.messagingengine.com (Postfix) with ESMTPA id C0A98C007AE; Thu, 6 Mar 2014 08:28:33 -0500 (EST) Message-ID: <53187801.9090209@grosser.es> Date: Thu, 06 Mar 2014 13:28:00 -0000 From: Tobias Grosser User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Roman Gareev , gcc-graphite@googlegroups.com CC: GCC Mailing List Subject: Re: asking your advice about bug References: <15de9e2a-10f5-4a5e-8621-3c27bf3ce290@googlegroups.com> <52EF8E94.4010708@grosser.es> <06fe5f6f-1914-49d8-84fe-0e6849e2ee04@googlegroups.com> <52F2344B.1070200@grosser.es> <400c1fca-ab51-48ac-883c-a57c9f742237@googlegroups.com> <52FECDEA.50604@grosser.es> <2dfaa7b0-4a9e-443e-8307-394083fe9777@googlegroups.com> In-Reply-To: <2dfaa7b0-4a9e-443e-8307-394083fe9777@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2014-03/txt/msg00107.txt.bz2 On 02/17/2014 06:50 PM, Roman Gareev wrote: > > > Hi Tobias, > > > thanks for the answer! > > > I think that the segfault is being caused by NULL arguments being passedto compute_deps > by loop_level_carries_dependences.*This is **causing **an* *assignment of** > NULL values to the following parameters of **compute_deps:* must_raw_no_source, > may_raw_no_source, must_war_no_source, may_war_no_source, > must_waw_no_source, may_waw_no_source. They are being passed to subtract_commutative_associative_deps > and dereferenced in the following statements: > > > *must_raw_no_source = isl_union_map_subtract (*must_raw_no_source, > x_must_raw_no_source); > > > *may_raw_no_source = isl_union_map_subtract (*may_raw_no_source, > x_may_raw_no_source); > > > *must_war_no_source = isl_union_map_subtract (*must_war_no_source, > x_must_war_no_source); > > > *may_war_no_source = isl_union_map_subtract (*may_war_no_source, > x_may_war_no_source); > > > *must_waw_no_source = isl_union_map_subtract (*must_waw_no_source, > x_must_waw_no_source); > > > *may_waw_no_source = isl_union_map_subtract (*may_waw_no_source, > x_may_waw_no_source); > > > This is the reason of segfault. (All functions mentioned above are located > in gcc/graphite-dependences.c) > > > I think that this can be solved by the addition to > subtract_commutative_associative_deps of NULL checking of the following > variables: must_raw_no_source, may_raw_no_source, must_war_no_source, > may_war_no_source, must_waw_no_source, may_waw_no_source. I've implemented > this in the patch, which can be found below. > > > Tested x86_64-unknown-linux-gnu, applying to revisions 189156, 207802 > (svn://gcc.gnu.org/svn/gcc/trunk) and 207802 > (svn://gcc.gnu.org/svn/gcc/branches/ibm/gcc-4_8-branch) > > > Thanks for your answers and advice, Sven! > > > -- > > Roman Gareev > > -- --- You received this message because you are subscribed to the > Google Groups "GCC GRAPHITE" group. To unsubscribe from this group and > stop receiving emails from it, send an email to > gcc-graphite+unsubscribe@googlegroups.com. For more options, visit > https://groups.google.com/groups/opt_out. > > > patch > > > diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c > index b0f8680..002e3d1 100644 > --- a/gcc/graphite-dependences.c > +++ b/gcc/graphite-dependences.c > @@ -424,24 +424,83 @@ subtract_commutative_associative_deps (scop_p scop, > &x_may_waw_no_source); > gcc_assert (res == 0); > > - *must_raw = isl_union_map_subtract (*must_raw, x_must_raw); > - *may_raw = isl_union_map_subtract (*may_raw, x_may_raw); > - *must_raw_no_source = isl_union_map_subtract (*must_raw_no_source, > - x_must_raw_no_source); > - *may_raw_no_source = isl_union_map_subtract (*may_raw_no_source, > - x_may_raw_no_source); > - *must_war = isl_union_map_subtract (*must_war, x_must_war); > - *may_war = isl_union_map_subtract (*may_war, x_may_war); > - *must_war_no_source = isl_union_map_subtract (*must_war_no_source, > - x_must_war_no_source); > - *may_war_no_source = isl_union_map_subtract (*may_war_no_source, > - x_may_war_no_source); > - *must_waw = isl_union_map_subtract (*must_waw, x_must_waw); > - *may_waw = isl_union_map_subtract (*may_waw, x_may_waw); > - *must_waw_no_source = isl_union_map_subtract (*must_waw_no_source, > - x_must_waw_no_source); > - *may_waw_no_source = isl_union_map_subtract (*may_waw_no_source, > - x_may_waw_no_source); > + if (must_raw) > + *must_raw = isl_union_map_subtract (*must_raw, x_must_raw); > + else > + isl_union_map_free (x_must_raw); > + > + if (may_raw) > + *may_raw = isl_union_map_subtract (*may_raw, x_may_raw); > + else > + isl_union_map_free (x_may_raw); In my understanding, it is sufficient to guard the no_source statements, no? > + > + if (must_raw_no_source) > + { > + *must_raw_no_source = isl_union_map_subtract (*must_raw_no_source, > + x_must_raw_no_source); > + } > + else > + isl_union_map_free (x_must_raw_no_source); Could you remove the '{' '}' around the first statement? > + > + if (may_raw_no_source) > + { > + *may_raw_no_source = isl_union_map_subtract (*may_raw_no_source, > + x_may_raw_no_source); > + } > + else > + isl_union_map_free (x_may_raw_no_source); Could you remove the '{' '}' around the first statement? > + if (must_war) > + *must_war = isl_union_map_subtract (*must_war, x_must_war); > + else > + isl_union_map_free (x_must_war); > + > + if (may_war) > + *may_war = isl_union_map_subtract (*may_war, x_may_war); > + else > + isl_union_map_free (x_may_war); Those do not seem to be necessary, no? > + > + if (must_war_no_source) > + { > + *must_war_no_source = isl_union_map_subtract (*must_war_no_source, > + x_must_war_no_source); > + } > + else > + isl_union_map_free (x_must_war_no_source); > + > + if (may_war_no_source) > + { > + *may_war_no_source = isl_union_map_subtract (*may_war_no_source, > + x_may_war_no_source); > + } > + else > + isl_union_map_free (x_may_war_no_source); Could you remove the '{' '}' around the first statement? > + > + if (must_waw) > + *must_waw = isl_union_map_subtract (*must_waw, x_must_waw); > + else > + isl_union_map_free (x_must_waw); > + > + if (may_waw) > + *may_waw = isl_union_map_subtract (*may_waw, x_may_waw); > + else > + isl_union_map_free (x_may_waw); Those do not seem to be necessary, no? > + > + if (must_waw_no_source) > + { > + *must_waw_no_source = isl_union_map_subtract (*must_waw_no_source, > + x_must_waw_no_source); > + } > + else > + isl_union_map_free (x_must_waw_no_source); > + > + if (may_waw_no_source) > + { > + *may_waw_no_source = isl_union_map_subtract (*may_waw_no_source, > + x_may_waw_no_source); > + } > + else > + isl_union_map_free (x_may_waw_no_source); Could you remove the '{' '}' around the first statement? Otherwise, the patch looks good. To commit this patch, could you please provide a ChangeLog entry as well as a commit message that _briefly_ describes the findings mentioned in you last email and submit this patch to gcc-patches? Thanks again, Tobias