From patchwork Wed Sep 15 13:15:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 64813 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 045BEB6F06 for ; Wed, 15 Sep 2010 23:14:40 +1000 (EST) Received: (qmail 6921 invoked by alias); 15 Sep 2010 13:14:38 -0000 Received: (qmail 6911 invoked by uid 22791); 15 Sep 2010 13:14:38 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD 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; Wed, 15 Sep 2010 13:14:28 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8FDERZ2021442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 15 Sep 2010 09:14:27 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8FDEPA9029244 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 15 Sep 2010 09:14:26 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id o8FDFGXL006162 for ; Wed, 15 Sep 2010 15:15:16 +0200 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id o8FDFFsP006160 for gcc-patches@gcc.gnu.org; Wed, 15 Sep 2010 15:15:15 +0200 Date: Wed, 15 Sep 2010 15:15:15 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix up guality/sra-1.c (PR middle-end/45663) Message-ID: <20100915131515.GL1269@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) 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! On some targets scheduling moves away the first insn belonging to the line with first bar call ahead of the a.j++ insns (and a$j DEBUG_INSN). By testing the values on the second bar call line the chances are higher that it will be after that. Regtested on x86_64-linux and i686-linux, ok for trunk? 2010-09-15 Jakub Jelinek PR middle-end/45663 * gcc.dg/guality/sra-1.c: Move all gdb-test lines to the second bar invocation instead of first. Jakub --- gcc/testsuite/gcc.dg/guality/sra-1.c.jj 2010-06-11 11:00:35.000000000 +0200 +++ gcc/testsuite/gcc.dg/guality/sra-1.c 2010-09-14 13:12:28.820377723 +0200 @@ -17,8 +17,8 @@ f1 (int k) struct A a = { 4, k + 6 }; asm ("" : "+r" (a.i)); a.j++; - bar (a.i); /* { dg-final { gdb-test 20 "a.i" "4" } } */ - bar (a.j); /* { dg-final { gdb-test 20 "a.j" "14" } } */ + bar (a.i); /* { dg-final { gdb-test 21 "a.i" "4" } } */ + bar (a.j); /* { dg-final { gdb-test 21 "a.j" "14" } } */ return a.i + a.j; } @@ -28,8 +28,8 @@ f2 (int k) int a[2] = { 4, k + 6 }; asm ("" : "+r" (a[0])); a[1]++; - bar (a[0]); /* { dg-final { gdb-test 31 "a\[0\]" "4" } } */ - bar (a[1]); /* { dg-final { gdb-test 31 "a\[1\]" "14" } } */ + bar (a[0]); /* { dg-final { gdb-test 32 "a\[0\]" "4" } } */ + bar (a[1]); /* { dg-final { gdb-test 32 "a\[1\]" "14" } } */ return a[0] + a[1]; } @@ -39,8 +39,8 @@ f3 (int k) struct B a = { 4, k + 6 }; asm ("" : "+r" (a.i)); a.j++; - bar (a.i); /* { dg-final { gdb-test 42 "a.i" "4" } } */ - bar (a.j); /* { dg-final { gdb-test 42 "a.j" "14" } } */ + bar (a.i); /* { dg-final { gdb-test 43 "a.i" "4" } } */ + bar (a.j); /* { dg-final { gdb-test 43 "a.j" "14" } } */ return a.i + a.j; }