From patchwork Sun Aug 1 18:44:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [alpha] : Fix PR target/41089, stdarg pass produces wrong code Date: Sun, 01 Aug 2010 08:44:18 -0000 From: Uros Bizjak X-Patchwork-Id: 60488 Message-Id: To: gcc-patches@gcc.gnu.org Cc: Richard Henderson , Richard Guenther , Jakub Jelinek 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;