From patchwork Thu Apr 7 21:32:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 90234 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 6AC2EB6F83 for ; Fri, 8 Apr 2011 07:32:48 +1000 (EST) Received: (qmail 16542 invoked by alias); 7 Apr 2011 21:32:46 -0000 Received: (qmail 16532 invoked by uid 22791); 7 Apr 2011 21:32:45 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL, BAYES_40, KAM_VIAGRA1, RCVD_IN_DNSWL_HI, SARE_SPEC_LEO_DRUGS, 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; Thu, 07 Apr 2011 21:32:41 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p37LWfH3008857 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 7 Apr 2011 17:32:41 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p37LWeZN030600 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 7 Apr 2011 17:32:41 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (localhost.localdomain [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id p37LWdWx010457 for ; Thu, 7 Apr 2011 23:32:39 +0200 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id p37LWd4R010455 for gcc-patches@gcc.gnu.org; Thu, 7 Apr 2011 23:32:39 +0200 Date: Thu, 7 Apr 2011 23:32:39 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [PATCH] 4.4 backports Message-ID: <20110407213239.GP17079@tyan-ft48-01.lab.bos.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! And here are 3 backported patches plus one testcase to 4.4 branch, committed after bootstrap/regtest on x86_64-linux and i686-linux. Jakub 2011-04-07 Jakub Jelinek PR tree-optimization/46491 Backported from mainline 2010-05-14 Jan Hubicka * ipa-pure-const.c (check_stmt): Do not use memory_identifier_string. 2011-04-07 Jakub Jelinek Backported from mainline 2010-11-15 Jakub Jelinek PR tree-optimization/46491 * gcc.target/i386/pr46491.c: New test. 2011-04-07 Jakub Jelinek Backported from mainline 2011-03-17 Jakub Jelinek PR rtl-optimization/48141 * dse.c (record_store): If no positions are needed in an insn that cannot be deleted, at least unchain it from active_local_stores. * gcc.dg/pr48141.c: New test. --- gcc/dse.c (revision 171088) +++ gcc/dse.c (revision 171089) @@ -1588,8 +1588,7 @@ record_store (rtx body, bb_info_t bb_inf /* An insn can be deleted if every position of every one of its s_infos is zero. */ - if (any_positions_needed_p (s_info) - || ptr->cannot_delete) + if (any_positions_needed_p (s_info)) del = false; if (del) @@ -1600,8 +1599,9 @@ record_store (rtx body, bb_info_t bb_inf last->next_local_store = ptr->next_local_store; else active_local_stores = ptr->next_local_store; - - delete_dead_store_insn (insn_to_delete); + + if (!insn_to_delete->cannot_delete) + delete_dead_store_insn (insn_to_delete); } else last = ptr; --- gcc/testsuite/gcc.dg/pr48141.c (revision 0) +++ gcc/testsuite/gcc.dg/pr48141.c (revision 171089) @@ -0,0 +1,17 @@ +/* PR rtl-optimization/48141 */ +/* { dg-do compile } */ +/* { dg-options "-O -fno-tree-fre" } */ + +#define A i = 0; +#define B A A A A A A A A A A +#define C B B B B B B B B B B +#define D C C C C C C C C C C +#define E D D D D D D D D D D + +int +foo (void) +{ + volatile int i = 0; + E E E E E E E E E E E + return 0; +} 2011-04-07 Jakub Jelinek Backported from mainline 2011-04-06 Jakub Jelinek PR debug/48466 * dwarf2out.c (based_loc_descr): If drap_reg is INVALID_REGNUM, use as base_reg whatever register reg has been eliminated to, instead of hardcoding STACK_POINTER_REGNUM. --- gcc/dwarf2out.c (revision 172063) +++ gcc/dwarf2out.c (revision 172064) @@ -13545,7 +13545,7 @@ based_loc_descr (rtx reg, HOST_WIDE_INT int base_reg = DWARF_FRAME_REGNUM ((fde && fde->drap_reg != INVALID_REGNUM) ? HARD_FRAME_POINTER_REGNUM - : STACK_POINTER_REGNUM); + : REGNO (elim)); return new_reg_loc_descr (base_reg, offset); } 2011-04-07 Jakub Jelinek PR fortran/48117 * gfortran.dg/gomp/pr48117.f90: New test. --- gcc/testsuite/gfortran.dg/gomp/pr48117.f90.jj 2011-01-16 05:42:39.626675592 +0100 +++ gcc/testsuite/gfortran.dg/gomp/pr48117.f90 2011-04-07 16:43:20.902808325 +0200 @@ -0,0 +1,11 @@ +! PR fortran/48117 +! { dg-do compile } +! { dg-options "-O2 -fopenmp" } + +subroutine foo(x) + character(len=*), optional :: x + character(len=80) :: v + !$omp master + if (present(x)) v = adjustl(x) + !$omp end master +end subroutine foo --- gcc/ipa-pure-const.c (revision 166773) +++ gcc/ipa-pure-const.c (revision 166774) @@ -360,7 +360,7 @@ get_asm_expr_operands (funct_state local for (i = 0; i < gimple_asm_nclobbers (stmt); i++) { op = gimple_asm_clobber_op (stmt, i); - if (simple_cst_equal(TREE_VALUE (op), memory_identifier_string) == 1) + if (strcmp (TREE_STRING_POINTER (TREE_VALUE (op)), "memory") == 0) /* Abandon all hope, ye who enter here. */ local->pure_const_state = IPA_NEITHER; } --- gcc/testsuite/gcc.target/i386/pr46491.c (revision 0) +++ gcc/testsuite/gcc.target/i386/pr46491.c (revision 166774) @@ -0,0 +1,22 @@ +/* PR tree-optimization/46491 */ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-ipa-reference" } */ + +extern void abort (void); + +__attribute__((noinline)) int +foo (int *p) +{ + int r; + asm ("movl $6, (%1)\n\txorl %0, %0" : "=r" (r) : "r" (p) : "memory"); + return r; +} + +int +main (void) +{ + int p = 8; + if ((foo (&p) ? : p) != 6) + abort (); + return 0; +}