From patchwork Sun Aug 1 18:44:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 60488 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 4E8821007D1 for ; Mon, 2 Aug 2010 04:44:27 +1000 (EST) Received: (qmail 5668 invoked by alias); 1 Aug 2010 18:44:25 -0000 Received: (qmail 5650 invoked by uid 22791); 1 Aug 2010 18:44:24 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, TW_ZJ, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-gx0-f175.google.com (HELO mail-gx0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 01 Aug 2010 18:44:20 +0000 Received: by gxk2 with SMTP id 2so1191154gxk.20 for ; Sun, 01 Aug 2010 11:44:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.48.31 with SMTP id v31mr5921825ybv.2.1280688258318; Sun, 01 Aug 2010 11:44:18 -0700 (PDT) Received: by 10.151.141.15 with HTTP; Sun, 1 Aug 2010 11:44:18 -0700 (PDT) Date: Sun, 1 Aug 2010 20:44:18 +0200 Message-ID: Subject: [PATCH, alpha]: Fix PR target/41089, stdarg pass produces wrong code From: Uros Bizjak To: gcc-patches@gcc.gnu.org Cc: Richard Henderson , Richard Guenther , Jakub Jelinek 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 Hello! As discussed in the PR, stdarg pass depends on number of assignments to ap.__offset location for correct operation. However, recent FRE/DCE enhancements remove one assignment as a dead code, causing the test failure: FAIL: gcc.c-torture/execute/stdarg-1.c execution, -O3 -fomit-frame-pointer FAIL: gcc.c-torture/execute/stdarg-1.c execution, -O3 -g Attached patch marks __offset as volatile (suggested by Richi in comment #39), preventing optimizations that could otherwise confuse stdarg pass. 2010-08-01 Uros Bizjak PR target/41089 * config/alpha/alpha.c (alpha_build_builtin_va_list): Mark __offset as volatile. Patch was bootstrapped and regression tested on alphaev68-pc-linux-gnu, where it fixes the failure. OK for mainline/4.5? Uros. Index: config/alpha/alpha.c =================================================================== --- config/alpha/alpha.c (revision 162794) +++ config/alpha/alpha.c (working copy) @@ -5948,6 +5948,7 @@ alpha_build_builtin_va_list (void) ofs = build_decl (BUILTINS_LOCATION, FIELD_DECL, get_identifier ("__offset"), integer_type_node); + TREE_THIS_VOLATILE (ofs) = 1; DECL_FIELD_CONTEXT (ofs) = record; DECL_CHAIN (ofs) = space;