From patchwork Tue Jan 22 16:49:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 214600 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 1FDC62C0082 for ; Wed, 23 Jan 2013 03:49:44 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1359478185; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Subject:Message-ID:Reply-To: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=sKP46n6Ua42/AUVxY1Z2 FDi66kI=; b=iTbi+5FFlKSaBQ0kIHSrpa5WEAU0E8r3p7DEJvfo9m9a/wHQkfhm rjHNpO9z5B51/cGNy+g21YhGmhglfG8NJ5iNPJvXWd3W1cEjYT32hN+qMQrOeTJS 7crZ0b5rozNCb5Vg1j/nylaWsJK3Mq3Ke/mVKBHioMJlFEJ0+QNzqhA= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=eoJacBROyFWuLR77dYlVwCYzxw6I31vUhKa5nx5vLJpFuR0i5w6V9+K0yI7rJT 38bu4F+EsIbicMDQOWB6iNbZvngS3q1XgcXdARJJE6jzVHcKiwF2qPkRnrBQj7BN j1hzqkerJiNM7TrnjXeqlRsUeMoKyxep5QOmWETTWdruU=; Received: (qmail 22262 invoked by alias); 22 Jan 2013 16:49:34 -0000 Received: (qmail 22247 invoked by uid 22791); 22 Jan 2013 16:49:30 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS, TW_TM X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Jan 2013 16:49:19 +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 r0MGnJe1013365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 22 Jan 2013 11:49:19 -0500 Received: from zalov.redhat.com (vpn1-4-254.ams2.redhat.com [10.36.4.254]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r0MGnHpi004605 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 22 Jan 2013 11:49:18 -0500 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.redhat.com (8.14.5/8.14.5) with ESMTP id r0MGnGNV018534 for ; Tue, 22 Jan 2013 17:49:16 +0100 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id r0MGnGgw018533 for gcc-patches@gcc.gnu.org; Tue, 22 Jan 2013 17:49:16 +0100 Date: Tue, 22 Jan 2013 17:49:16 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix ICEs with dump_loc (PR middle-end/56074) Message-ID: <20130122164916.GX7269@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi! While glibc fprintf allows printing %s with NULL argument as (null), other C libraries aren't that forgiving. If loc isn't UNKNOWN_LOCATION, but say BUILTINS_LOCATION, UNKNOWN_LOCATION with an associated BLOCK etc., we might ICE on those hosts. The patch also changes find_loop_location, so that it attempts to find a better location. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2013-01-22 Jakub Jelinek PR middle-end/56074 * dumpfile.c (dump_loc): Only print loc if LOCATION_LOCUS (loc) isn't UNKNOWN_LOCATION nor BUILTINS_LOCATION. * tree-vect-loop-manip.c (find_loop_location): Also ignore stmt locations where LOCATION_LOCUS of the stmt location is UNKNOWN_LOCATION or BUILTINS_LOCATION. Jakub --- gcc/dumpfile.c.jj 2013-01-18 21:23:04.000000000 +0100 +++ gcc/dumpfile.c 2013-01-22 10:53:29.933658993 +0100 @@ -260,7 +260,7 @@ dump_loc (int dump_kind, FILE *dfile, so /* Currently vectorization passes print location information. */ if (dump_kind) { - if (loc != UNKNOWN_LOCATION) + if (LOCATION_LOCUS (loc) > BUILTINS_LOCATION) fprintf (dfile, "\n%s:%d: note: ", LOCATION_FILE (loc), LOCATION_LINE (loc)); else if (current_function_decl) --- gcc/tree-vect-loop-manip.c.jj 2013-01-16 17:04:19.000000000 +0100 +++ gcc/tree-vect-loop-manip.c 2013-01-22 10:56:08.984745253 +0100 @@ -1357,7 +1357,8 @@ find_loop_location (struct loop *loop) stmt = get_loop_exit_condition (loop); - if (stmt && gimple_location (stmt) != UNKNOWN_LOC) + if (stmt + && LOCATION_LOCUS (gimple_location (stmt)) > BUILTINS_LOCATION) return gimple_location (stmt); /* If we got here the loop is probably not "well formed", @@ -1371,7 +1372,7 @@ find_loop_location (struct loop *loop) for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si)) { stmt = gsi_stmt (si); - if (gimple_location (stmt) != UNKNOWN_LOC) + if (LOCATION_LOCUS (gimple_location (stmt)) > BUILTINS_LOCATION) return gimple_location (stmt); }