public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH,testsuite] fix gcc.dg/tree-ssa/20030714-1.c with -fPIC
@ 2007-07-26 21:40 Nathan Froyd
  2008-01-24  1:09 ` Kaveh R. GHAZI
  0 siblings, 1 reply; 5+ messages in thread
From: Nathan Froyd @ 2007-07-26 21:40 UTC (permalink / raw)
  To: gcc-patches

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

As noted in this message:

  http://gcc.gnu.org/ml/gcc/2007-02/msg0021.html

gcc.dg/tree-ssa/20030714-1.c started failing on sparc with -fPIC between
2006-06-18 and 2006-06-22.  The patch that caused this seems to be:

2006-06-21  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/27781
	* Makefile.in (ipa-pure-const.o): Add $(TARGET_H) dependency.
	* ipa-pure-const.c (target.h): Include.
	(analyze_function): Do not analyze functions that do not
	bind locally.

Not that the patch is wrong, mind you, but the optimizations necessary
to satisfy the dg-final directives in the testcase apparently only
activate when the function binds locally.  (The function must be marked
as pure by ipa-pure-const, which this patch inhibits.)

I certainly don't pretend to understand the IPA code or the sequence of
optimizations that's desired here, but the attached tweak to the
testcase seems to get things working with -fPIC again.  Tested on
i586-wrs-vxworks with and without -fPIC with no regressions.  OK to
commit?

-Nathan

gcc/testsuite/
2007-07-26  Nathan Froyd  <froydnj@codesourcery.com>

	* gcc.dg/tree-ssa/20030714-1.c (find_base_value): Declare as
	static so appropriate optimizations kick in.
	(find_base_value_wrapper): New function.


[-- Attachment #2: 20030714-1.patch --]
[-- Type: text/plain, Size: 644 bytes --]

Index: gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c	(revision 177473)
+++ gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c	(working copy)
@@ -15,7 +15,7 @@ struct rtx_def
   unsigned frame_related:1;
 };
 
-rtx
+static rtx
 find_base_value (src)
      rtx src;
 {
@@ -33,6 +33,12 @@ find_base_value (src)
     find_base_value (src_1);
 }
 
+rtx
+find_base_value_wrapper (src)
+     rtx src;
+{
+  return find_base_value (src);
+}
 
 /* There should be four IF conditionals.  */
 /* { dg-final { scan-tree-dump-times "if " 4 "dom3"} } */

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

end of thread, other threads:[~2008-01-24  9:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-26 21:40 [PATCH,testsuite] fix gcc.dg/tree-ssa/20030714-1.c with -fPIC Nathan Froyd
2008-01-24  1:09 ` Kaveh R. GHAZI
2008-01-24  1:54   ` Richard Guenther
2008-01-24 11:30     ` Kaveh R. GHAZI
2008-01-24 13:24       ` 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).