From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25132 invoked by alias); 18 Jan 2013 08:52:22 -0000 Received: (qmail 25116 invoked by uid 22791); 18 Jan 2013 08:52:21 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-ob0-f174.google.com (HELO mail-ob0-f174.google.com) (209.85.214.174) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Jan 2013 08:52:16 +0000 Received: by mail-ob0-f174.google.com with SMTP id ta14so3473571obb.19 for ; Fri, 18 Jan 2013 00:52:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to:cc :content-type:x-gm-message-state; bh=WnCUrKLe8aGQVPUWExnMdnSdvNdLhOM132njRks2+50=; b=lUHNB8ZRW1PMH0tGpPHi2ASL2VuR2WvyM63UxU7wxTczFusPlQs5FBHe4Jp4zKQn7S hfml/obM8ElShssG8Z3qelgTy39TZfIRdQL8s217CQ/RH5nf1gH/fGZaugSZ4edcJqI7 aoxjfEGiNhCSjSdUCLCpK7Y+p9n7wLSEPq7ZqAY6OwDqeRPM3s3bKkOjjm/4+HzxzcS4 tnLs0xvILtzNfpiXIdM/OX2719YFtBJAdg7j5JSpJdkZnmm0R2E+U+f3sBtUa+b9evGQ 3FDRmJDP/7kAXOLSwkM5fsqpi0nsUg22HuLGEVsjEZrrA54kkZpaY7JwU0nicSOqRo0X A9hQ== X-Received: by 10.60.24.161 with SMTP id v1mr6156872oef.115.1358499136015; Fri, 18 Jan 2013 00:52:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.151.102 with HTTP; Fri, 18 Jan 2013 00:51:34 -0800 (PST) From: Sharad Singhai Date: Fri, 18 Jan 2013 08:52:00 -0000 Message-ID: Subject: [PATCH] Fix ICE in vectorization dump (PR tree-optimization/55995) To: janis@gcc.gnu.org, Richard Biener Cc: "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQk1t/Wh/QvOPKiLYxRfhYSWQFKkMsYkvFox+aThd+jcLMVOcn0qZdUSTDga7oLbdSI4BQIl6Y0sTWgTN/aNJdBs6K4t+Bt2syT8M7QZXFP93iKxBDifdt2pla0+w9jayx3eo6o0jg7NMW0JLHew+NArZnTJZ7LZwI12v+2kO5PEcob1u33y0IUnaE+Hz0eaXbDsffPP Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00939.txt.bz2 This patch fixes an ICE in vectorization dump when section anchors are present. Bootstrapped/tested on x86_64 and PPC 64 and found no new failures. OK for trunk? Thanks, Sharad 2013-01-18 Sharad Singhai PR tree-optimization/55995 * dumpfile.c (dump_loc): Print location only if available. * testsuite/gcc.dg/vect/vect.exp: Use "details" flags for dump info. * tree-vectorizer.c (increase_alignment): Intialize vect_location. Index: dumpfile.c =================================================================== --- dumpfile.c (revision 195244) +++ dumpfile.c (working copy) @@ -260,14 +260,13 @@ dump_loc (int dump_kind, FILE *dfile, source_locat /* Currently vectorization passes print location information. */ if (dump_kind) { - if (loc == UNKNOWN_LOCATION) + if (loc != UNKNOWN_LOCATION) + fprintf (dfile, "\n%s:%d: note: ", LOCATION_FILE (loc), + LOCATION_LINE (loc)); + else if (current_function_decl) fprintf (dfile, "\n%s:%d: note: ", DECL_SOURCE_FILE (current_function_decl), DECL_SOURCE_LINE (current_function_decl)); - else - fprintf (dfile, "\n%s:%d: note: ", - LOCATION_FILE (loc), - LOCATION_LINE (loc)); } } Index: testsuite/gcc.dg/vect/vect.exp =================================================================== --- testsuite/gcc.dg/vect/vect.exp (revision 195244) +++ testsuite/gcc.dg/vect/vect.exp (working copy) @@ -156,7 +156,8 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdi # alignment-sensitive -fsection-anchors tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS -lappend DEFAULT_VECTCFLAGS "-fsection-anchors" "-fdump-ipa-increase_alignment" +lappend DEFAULT_VECTCFLAGS "-fsection-anchors" \ + "-fdump-ipa-increase_alignment-details" dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/aligned-section-anchors-*.\[cS\]]] \ "" $DEFAULT_VECTCFLAGS Index: tree-vectorizer.c =================================================================== --- tree-vectorizer.c (revision 195244) +++ tree-vectorizer.c (working copy) @@ -225,6 +225,8 @@ increase_alignment (void) { struct varpool_node *vnode; + vect_location = UNKNOWN_LOC; + /* Increase the alignment of all global arrays for vectorization. */ FOR_EACH_DEFINED_VARIABLE (vnode) {