This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] broken test cases
- From: Steven Bosschner <stevenb at suse dot de>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 6 Nov 2003 13:58:03 +0100 (CET)
- Subject: [tree-ssa] broken test cases
- Organization: SuSE Linux AG
Hi,
This piece from gcc.dg/tree-ssa/ssa-ccp-2.c seems a bit
over-optimistic about the capabilities of tree-ssa:
/* static var */
extern int foo88 (int);
int test8 (int *intarr)
{
extern int foo8 (int);
int v;
static int l;
l = 7;
foo8 (l);
v = l;
if (v != 7)
link_error ();
l = foo88 (l);
return l;
}
This test case fails because we find that (v != 7), but this is
actually correct since l actually can be clobbered. If for
example foo8 calls test8 then when we return from foo8(), we
cannot be sure that l == 7 still, at least not with the
optimizations we currently have implemented.
I suggest we remove this test. OK?
Gr.
Steven
(hoping they fix my last name soon :-)
Index: ssa-ccp-2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/Attic/ssa-ccp-2.c,v
retrieving revision 1.1.2.2
diff -c -3 -p -r1.1.2.2 ssa-ccp-2.c
*** ssa-ccp-2.c 12 Aug 2003 17:42:34 -0000 1.1.2.2
--- ssa-ccp-2.c 6 Nov 2003 12:51:42 -0000
*************** int test7777 (void)
*** 53,75 ****
return v1 + garr[0];
}
-
- /* static var */
- extern int foo88 (int);
- int test8 (int *intarr)
- {
- extern int foo8 (int);
- int v;
- static int l;
- l = 7;
- foo8 (l);
- v = l;
- if (v != 7)
- link_error ();
- l = foo88 (l);
- return l;
- }
-
int test88 (int *arr)
{
static int l;
--- 53,58 ----