ivopts-1.c: New test.

* gcc.dg/tree-ssa/ivopts-1.c: New test.
	* gcc.dg/tree-ssa/ivopts-2.c: New test.

Co-Authored-By: Adam Nemet <anemet@caviumnetworks.com>

From-SVN: r117183
This commit is contained in:
Zdenek Dvorak 2006-09-24 21:11:16 +02:00 committed by Adam Nemet
parent b67102aebd
commit af17634547
3 changed files with 56 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2006-09-24 Zdenek Dvorak <dvorakz@suse.cz>
Adam Nemet <anemet@caviumnetworks.com>
* gcc.dg/tree-ssa/ivopts-1.c: New test.
* gcc.dg/tree-ssa/ivopts-2.c: New test.
2006-09-24 Kazu Hirata <kazu@codesourcery.com> 2006-09-24 Kazu Hirata <kazu@codesourcery.com>
PR target/28911 PR target/28911

View File

@ -0,0 +1,26 @@
/* { dg-do compile } */
/* Not all platforms support TImode integers. */
#if defined(__LP64__) && !defined(__hppa__)
typedef int TItype __attribute__ ((mode (TI)));
#else
typedef long TItype;
#endif
TItype last_data_offset ;
int store;
char *data;
f ()
{
TItype data_offset = last_data_offset;
char *p;
for (p = data; *p; p++)
{
data_offset++;
g (data_offset);
store = data_offset + 1;
}
}

View File

@ -0,0 +1,24 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-ivopts-details" } */
long last_data_offset;
int store;
char *data;
f ()
{
long data_offset = last_data_offset;
char *p;
for (p = data; *p; p++)
{
data_offset++;
g (data_offset);
store = data_offset + 1;
}
}
/* We should only have two IVs. */
/* { dg-final { scan-tree-dump-not "\\n candidates .*,.*,.*\\n\[^\\n\]*\\nFinal cost" "ivopts" } } */
/* { dg-final { cleanup-tree-dump "ivopts" } } */