This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix gcc.dg/tree-ssa/loadpre6.c testcase




Sent from my iPhone

On May 30, 2010, at 5:04 PM, Jan Hubicka <hubicka@ucw.cz> wrote:

Hi,
pure-const is now too smart to mark foo as pure that leads the testcase to be optimized
too early. Fixed thus. OK?

Huh? How can foo be consider const. It has a huge side effect of not returning normally (well at all).




Honza


* gcc.dg/tree-ssa/loadpre6.c: Avoid foo from being pure.

Index: gcc.dg/tree-ssa/loadpre6.c
===================================================================
--- gcc.dg/tree-ssa/loadpre6.c    (revision 160051)
+++ gcc.dg/tree-ssa/loadpre6.c    (working copy)
@@ -22,13 +22,17 @@
  struct tree_common common;
  struct tree_list list;
};
+int test;

extern void abort (void) __attribute__((noreturn));

void __attribute__((noinline))
foo (void)
{
-  abort ();
+  if (!test)
+    abort ();
+  else
+    test++;
}

/* There are some reloaded loads of *cell, and cell->common.chain on various


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]