public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, alpha]: Fix PR target/41089, stdarg pass produces wrong code
@ 2010-08-01 18:44 Uros Bizjak
  2010-08-02 16:59 ` Richard Henderson
  0 siblings, 1 reply; 4+ messages in thread
From: Uros Bizjak @ 2010-08-01 18:44 UTC (permalink / raw)
  To: gcc-patches; +Cc: Richard Henderson, Richard Guenther, Jakub Jelinek

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

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  <ubizjak@gmail.com>

	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.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 453 bytes --]

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;
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-03  8:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-01 18:44 [PATCH, alpha]: Fix PR target/41089, stdarg pass produces wrong code Uros Bizjak
2010-08-02 16:59 ` Richard Henderson
2010-08-02 17:24   ` Uros Bizjak
2010-08-03  8:43     ` Richard Guenther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).