From patchwork Thu Aug 18 14:03:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 110523 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 12FA4B6F00 for ; Fri, 19 Aug 2011 00:04:22 +1000 (EST) Received: (qmail 7717 invoked by alias); 18 Aug 2011 14:04:19 -0000 Received: (qmail 7576 invoked by uid 22791); 18 Aug 2011 14:04:18 -0000 X-SWARE-Spam-Status: No, hits=-7.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_HELO_PASS 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, 18 Aug 2011 14:03:58 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7IE3wpZ022180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 18 Aug 2011 10:03:58 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p7IE3uj6003250 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Aug 2011 10:03:57 -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 p7IE3txs014417; Thu, 18 Aug 2011 16:03:56 +0200 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id p7IE3tIC014415; Thu, 18 Aug 2011 16:03:55 +0200 Date: Thu, 18 Aug 2011 16:03:55 +0200 From: Jakub Jelinek To: Uros Bizjak , Richard Henderson Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Call validize_mem in assign_386_stack_local (PR target/50092) Message-ID: <20110818140355.GY2687@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! If stack frame size is larger than 2GB, the MEMs returned by assign_386_stack_local aren't necessarily valid MEMs. While we could do validize_mem in all the assign_386_stack_local callers, it seems far easier to do it just in one (well, two actually) spots. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk/4.6? 2011-08-18 Jakub Jelinek PR target/50092 * config/i386/i386.c (assign_386_stack_local): Call validize_mem on the result before returning it. * gcc.dg/torture/pr50092.c: New test. Jakub --- gcc/config/i386/i386.c.jj 2011-08-18 08:35:53.000000000 +0200 +++ gcc/config/i386/i386.c 2011-08-18 11:16:41.000000000 +0200 @@ -21787,7 +21787,7 @@ assign_386_stack_local (enum machine_mod for (s = ix86_stack_locals; s; s = s->next) if (s->mode == mode && s->n == n) - return copy_rtx (s->rtl); + return validize_mem (copy_rtx (s->rtl)); s = ggc_alloc_stack_local_entry (); s->n = n; @@ -21796,7 +21796,7 @@ assign_386_stack_local (enum machine_mod s->next = ix86_stack_locals; ix86_stack_locals = s; - return s->rtl; + return validize_mem (s->rtl); } /* Calculate the length of the memory address in the instruction encoding. --- gcc/testsuite/gcc.dg/torture/pr50092.c.jj 2011-08-18 11:27:07.000000000 +0200 +++ gcc/testsuite/gcc.dg/torture/pr50092.c 2011-08-18 11:27:39.000000000 +0200 @@ -0,0 +1,15 @@ +/* PR target/50092 */ +/* { dg-do compile { target lp64 } } */ + +volatile int v; + +void bar (long double); +void baz (_Complex long double *); + +void +foo (void) +{ + _Complex long double w[100000000]; + bar ((long double) v / 2147483648.0); + baz (w); +}