URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/trunk/gnu-old/gcc-4.2.2/gcc/testsuite/g++.dg/tree-ssa
- from Rev 154 to Rev 816
- ↔ Reverse comparison
Rev 154 → Rev 816
/nothrow-1.C
0,0 → 1,21
/* { dg-do compile } */ |
/* { dg-options "-O1 -fdump-tree-cfg" } */ |
/* { dg-skip-if "" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */ |
double a; |
void t() |
{ |
a=1; |
} |
void t1(void); |
void abort(void); |
|
void q() |
{ |
try { |
t(); |
} |
catch (...) {abort();} |
} |
/* We shouldnotice nothrow attribute. */ |
/* { dg-final { scan-tree-dump-times "exception" 0 "cfg"} } */ |
/* { dg-final { cleanup-tree-dump "cfg" } } */ |
nothrow-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ssa-cast-1.C
===================================================================
--- ssa-cast-1.C (nonexistent)
+++ ssa-cast-1.C (revision 816)
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int &f(int *a)
+{
+ return *a;
+}
+
+/* There should be no cast as pointer and references are
+ considered the same type. */
+/* { dg-final { scan-tree-dump-times "\\(int &\\)" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
ssa-cast-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr22404.C
===================================================================
--- pr22404.C (nonexistent)
+++ pr22404.C (revision 816)
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+/* We were not getting the offset of a in B and a in C::B correct,
+ causing an abort. */
+struct A { A(); };
+
+struct B : A
+{
+ A a;
+};
+
+struct C : B { };
+
+C c;
pr22404.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr28003.C
===================================================================
--- pr28003.C (nonexistent)
+++ pr28003.C (revision 816)
@@ -0,0 +1,31 @@
+// PR tree-optimization/28003
+// Alias grouping needs to be computed after call clobbering, because it
+// changes around the tags and variables in a way that makes our
+// call clobbering computation incorrect.
+// { dg-do run }
+// { dg-options "-O2" }
+extern "C" void abort(void);
+struct A
+{
+ int i, j[9];
+ A() : i(1) { j[0]=j[1]=j[2]=j[3]=j[4]=j[5]=j[6]=j[7]=j[8]=0; }
+};
+
+struct B
+{
+ A a;
+};
+
+B b[] =
+{
+ {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
+ {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
+ {}, {}, {}, {}, {}
+};
+
+int main()
+{
+ if (1 - b[sizeof(b)/sizeof(B) - 1].a.i != 0)
+ abort();
+ return 0;
+}
pr28003.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr20920.C
===================================================================
--- pr20920.C (nonexistent)
+++ pr20920.C (revision 816)
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+/* This was causing a failure in the out of SSA pass because VRP was
+ trying to insert assertions for SSA names that flow through
+ abnormal edges. */
+void f(int) __attribute__((__noreturn__));
+int d(const char *);
+char * j ();
+
+char *
+foo (int x)
+{
+ char *path = __null;
+ try
+ {
+ path = j ();
+ if (path != __null)
+ if (d (path) != 0)
+ f (127);
+ f (127);
+ }
+ catch (...) { }
+
+ return path;
+}
pr20920.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr26140.C
===================================================================
--- pr26140.C (nonexistent)
+++ pr26140.C (revision 816)
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+struct Pitch
+{
+ int notename_;
+};
+struct Audio_note
+{
+ Audio_note (Pitch p);
+};
+void create_audio_elements ()
+{
+ Pitch *pit;
+ new Audio_note (*pit);
+}
pr26140.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr32327-1.C
===================================================================
--- pr32327-1.C (nonexistent)
+++ pr32327-1.C (revision 816)
@@ -0,0 +1,70 @@
+// { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } }
+// { dg-options "-O2" }
+
+// Endian sensitive. This is a little-endian redux.
+
+typedef long long int64;
+typedef unsigned long long uint64;
+typedef __SIZE_TYPE__ size_t;
+
+extern "C" {
+extern void *memcpy (void *__restrict __dest,
+ __const void *__restrict __src, size_t __n) /*throw ()*/;
+extern void abort (void);
+}
+
+inline uint64 Swap64(uint64 ull) {
+ uint64 b0 = (ull >> 0) & 0xff;
+ uint64 b1 = (ull >> 8) & 0xff;
+ uint64 b2 = (ull >> 16) & 0xff;
+ uint64 b3 = (ull >> 24) & 0xff;
+ uint64 b4 = (ull >> 32) & 0xff;
+ uint64 b5 = (ull >> 40) & 0xff;
+ uint64 b6 = (ull >> 48) & 0xff;
+ uint64 b7 = (ull >> 56) & 0xff;
+ return (b0 << 56) | (b1 << 48) | (b2 << 40) | (b3 << 32) |
+ (b4 << 24) | (b5 << 16) | (b6 << 8) | (b7 << 0);
+}
+
+inline void KeyFromUint64(uint64 ull, unsigned char* key) {
+ uint64 ull_swap = Swap64(ull);
+ memcpy(key, &ull_swap, sizeof(uint64));
+}
+
+inline int64 int64_from_double(const double& source) {
+ int64 dest;
+ memcpy(&dest, &source, sizeof(dest));
+ return dest;
+}
+
+void KeyFromDouble(double x, unsigned char* key) __attribute__ ((noinline));
+void KeyFromDouble(double x, unsigned char* key) {
+ int64 n = int64_from_double(x);
+ if (n >= 0) {
+ n += 1ull << 63;
+ } else {
+ n = -n;
+ }
+ KeyFromUint64(n, key);
+}
+
+
+void TestKeyFromDouble(uint64 ull) {
+ double d;
+ memcpy(&d, &ull, sizeof(d));
+
+ unsigned char key[sizeof(uint64)];
+ unsigned char expected_key[sizeof(uint64)] = { 0x81, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
+
+ KeyFromDouble(d, key);
+
+ for (size_t i = 0; i < sizeof(key); ++i) {
+ if ((key[i] & 0xff) != expected_key[i])
+ abort ();
+ }
+}
+
+int main() {
+ TestKeyFromDouble(0x0123456789abcdefull);
+ return 0;
+}
pr32327-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr22444.C
===================================================================
--- pr22444.C (nonexistent)
+++ pr22444.C (revision 816)
@@ -0,0 +1,141 @@
+// PR tree-optimization/22444
+// When creating SFT's, we shouldn't add the original variable
+// to the addressable vars list, because this may cause false aliasing
+// with the subvars leading to the subvars not being renamed when they should
+// { dg-do compile }
+// { dg-options "-O2" }
+typedef int ptrdiff_t;
+typedef unsigned int size_t;
+namespace std
+{
+ template struct pair
+ {
+ _T1 first;
+ _T2 second;
+ pair(const _T1& __a, const _T2& __b) : first(__a), second(__b) { }
+ };
+}
+namespace __gnu_internal
+{
+ typedef char __one;
+ template __one __test_type(int _Tp::*);
+}
+namespace std
+{
+ template struct __is_pod
+ {
+ enum { __value = (sizeof(__gnu_internal::__test_type<_Tp>(0))!= sizeof(__gnu_internal::__one)) };
+ };
+ template struct iterator
+ { };
+ template struct iterator_traits
+ {
+ typedef typename _Iterator::difference_type difference_type;
+ };
+ template class reverse_iterator : public iterator::iterator_category, typename iterator_traits<_Iterator>::value_type, typename iterator_traits<_Iterator>::difference_type, typename iterator_traits<_Iterator>::pointer, typename iterator_traits<_Iterator>::reference>
+ {
+ typedef _Iterator iterator_type;
+ typedef typename iterator_traits<_Iterator>::difference_type difference_type;
+ typedef typename iterator_traits<_Iterator>::reference reference;
+ reverse_iterator operator+(difference_type __n) const {}
+ reverse_iterator& operator+=(difference_type __n) { }
+ reference operator[](difference_type __n) const { }
+ };
+}
+namespace __gnu_cxx
+{
+ template class __pool;
+ template class _PoolTp, bool _Thread> struct __common_pool_policy;
+ template class __mt_alloc_base
+ {
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ };
+ template > class __mt_alloc : public __mt_alloc_base<_Tp>
+ {
+ typedef size_t size_type;
+ };
+}
+namespace std
+{
+ template struct allocator:public __gnu_cxx::__mt_alloc<_Tp>
+ {
+ template struct rebind
+ {
+ typedef allocator<_Tp1> other;
+ };
+ };
+ template struct unary_function { };
+ template struct binary_function
+ {
+ typedef _Arg2 second_argument_type;
+ };
+ template struct less : public binary_function<_Tp, _Tp, bool>
+ {
+ bool operator()(const _Tp& __x, const _Tp& __y) const { }
+ };
+ template struct _Identity : public unary_function<_Tp,_Tp> { };
+ struct _Rb_tree_node_base
+ {
+ typedef _Rb_tree_node_base* _Base_ptr;
+ typedef const _Rb_tree_node_base* _Const_Base_ptr;
+ _Base_ptr _M_right;
+ static _Base_ptr _S_minimum(_Base_ptr __x) { }
+ static _Base_ptr _S_maximum(_Base_ptr __x) { }
+ };
+ template struct _Rb_tree_node { };
+ template struct _Rb_tree_iterator
+ {
+ typedef _Tp* pointer;
+ typedef _Rb_tree_iterator<_Tp> _Self;
+ typedef _Rb_tree_node_base::_Base_ptr _Base_ptr;
+ pointer operator->() const { }
+ _Self operator++(int) { }
+ _Base_ptr _M_node;
+ };
+ template struct _Rb_tree_const_iterator
+ {
+ typedef const _Tp* pointer;
+ typedef _Rb_tree_iterator<_Tp> iterator;
+ typedef _Rb_tree_node_base::_Const_Base_ptr _Base_ptr;
+ _Rb_tree_const_iterator(const iterator& __it) : _M_node(__it._M_node) { }
+ _Base_ptr _M_node;
+ };
+ template > struct _Rb_tree
+ {
+ typedef typename _Alloc::template rebind<_Rb_tree_node<_Val> >::other _Node_allocator;
+ typedef _Rb_tree_node_base* _Base_ptr;
+ typedef const _Rb_tree_node_base* _Const_Base_ptr;
+ typedef _Rb_tree_node<_Val> _Rb_tree_node;
+ typedef _Key key_type;
+ typedef _Val value_type;
+ typedef value_type* pointer;
+ typedef _Rb_tree_node* _Link_type;
+ template::__value> struct _Rb_tree_impl
+ : _Node_allocator
+ {
+ _Rb_tree_node_base _M_header;
+ };
+ _Rb_tree_impl<_Compare> _M_impl;
+ typedef _Rb_tree_iterator iterator;
+ typedef _Rb_tree_const_iterator const_iterator;
+ typedef std::reverse_iterator reverse_iterator;
+ pair insert_unique(const value_type& __x);
+ };
+ template class set
+ {
+ typedef _Key key_type;
+ typedef _Key value_type;
+ typedef _Compare key_compare;
+ typedef typename _Alloc::template rebind<_Key>::other _Key_alloc_type;
+ typedef _Rb_tree<_Key, value_type, _Identity, key_compare, _Key_alloc_type> _Rep_type;
+ _Rep_type _M_t;
+ typedef typename _Rep_type::const_iterator iterator;
+ std::pair insert(const value_type& __x)
+ {
+ std::pair __p = _M_t.insert_unique(__x);
+ return std::pair(__p.first, __p.second);
+ }
+ };
+}
+template class std::set, std::allocator >;
pr22444.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ivopts-1.C
===================================================================
--- ivopts-1.C (nonexistent)
+++ ivopts-1.C (revision 816)
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ivopts" } */
+
+struct Foo {
+ Foo() : s(1) {}
+ int s;
+};
+void foo(Foo&);
+void bar(void)
+{
+ Foo x[4];
+ foo(x[0]);
+}
+
+/* { dg-final { scan-tree-dump-not "-&x" "ivopts" } } */
+/* { dg-final { scan-tree-dump-not "offset: -4B" "ivopts" { xfail i?86-*-* x86_64-*-* hppa*-*-* } } } */
+/* { dg-final { scan-tree-dump-not "&x\\\[5\\\]" "ivopts" { xfail i?86-*-* x86_64-*-* hppa*-*-* } } } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
ivopts-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr17153.C
===================================================================
--- pr17153.C (nonexistent)
+++ pr17153.C (revision 816)
@@ -0,0 +1,17 @@
+/* The alias analyzer was marking RETVAL non-addressable, but RETVAL
+ is a special variable that's available across different functions. */
+void foo(const char*);
+
+struct A {};
+
+struct B : A
+{
+ B(){}
+ B bar()
+ {
+ foo(__PRETTY_FUNCTION__);
+ return B();
+ };
+};
+
+B b=B().bar();
pr17153.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr26406.C
===================================================================
--- pr26406.C (nonexistent)
+++ pr26406.C (revision 816)
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int *f(int *b)
+{
+ int * a = new int[104];
+ *a = 1;
+ if (a == 0)
+ return b;
+ return a;
+}
+
+/* { dg-final { scan-tree-dump-not "if" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
pr26406.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27090.C
===================================================================
--- pr27090.C (nonexistent)
+++ pr27090.C (revision 816)
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+template
+struct Bar
+{
+ int get() { return static_cast(this)->get2(); }
+};
+struct Foo : public Bar
+{
+ int get2() { return x; }
+ int x;
+};
+
+int foo(Foo& f)
+{
+ return f.get();
+}
+
+/* { dg-final { scan-tree-dump "return f->x;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
pr27090.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27218.C
===================================================================
--- pr27218.C (nonexistent)
+++ pr27218.C (revision 816)
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct Vector
+{
+ double _x, _y;
+};
+typedef Vector Point;
+Vector d;
+static inline Vector f(void)
+{
+ return d;
+}
+void add_duck (void)
+{
+ new Point (f());
+}
pr27218.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr17517.C
===================================================================
--- pr17517.C (nonexistent)
+++ pr17517.C (revision 816)
@@ -0,0 +1,32 @@
+// Test PR 17517. Test case provided by Serge Belyshev.
+
+ /* { dg-do compile } */
+ /* { dg-options "-O2" } */
+
+
+extern void foo ();
+
+struct Ptr {
+ int * ptr;
+ Ptr () { ptr = 0; }
+ ~Ptr() { delete ptr; }
+ Ptr &operator= (int * p) { ptr = p; return *this; }
+};
+
+int *new_checker () { foo (); return 0; }
+
+void pipe (int c)
+{
+ Ptr checker;
+
+ foo ();
+ for (;;)
+ {
+ switch (c)
+ {
+ case '-':
+ checker = new_checker ();
+ break;
+ }
+ }
+}
pr17517.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr15791-1.C
===================================================================
--- pr15791-1.C (nonexistent)
+++ pr15791-1.C (revision 816)
@@ -0,0 +1,25 @@
+/* { dg-do link } */
+
+void link_error ();
+
+int main ()
+{
+ struct { int b[2]; } x;
+ int b[2];
+ if (&b[1] != &b[1])
+ link_error ();
+ if (&b[0] != b)
+ link_error ();
+ if (b == &b[2])
+ link_error ();
+ if (b != b)
+ link_error ();
+ if (&x.b[1] == &x.b[0])
+ link_error ();
+ if (x.b != &x.b[0])
+ link_error ();
+ if (&x.b[1] == x.b)
+ link_error ();
+ return 0;
+}
+
pr15791-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr15791-3.C
===================================================================
--- pr15791-3.C (nonexistent)
+++ pr15791-3.C (revision 816)
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+int f(int i, unsigned j)
+{
+ int b[2];
+ if (&b[i] == &b[j])
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "i == j" 0 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
pr15791-3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr20489.C
===================================================================
--- pr20489.C (nonexistent)
+++ pr20489.C (revision 816)
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct A
+{
+ ~A();
+};
+
+/* If we don't create SFT's for the "empty" structure A, bad things
+ will happen, and we will fail verification. */
+struct B
+{
+ int i;
+ A a;
+
+ void foo() {}
+};
+
+void bar()
+{
+ B().foo();
+}
pr20489.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr22488.C
===================================================================
--- pr22488.C (nonexistent)
+++ pr22488.C (revision 816)
@@ -0,0 +1,33 @@
+// PR tree-optimization/22488
+// This testcase is really a C++ FE bug in represnting virtual inheritance
+// It gives the appearance to the middle end that the fields exist twice
+// which resulted in a very confused structure analyzer
+// { dg-do compile }
+// { dg-options "-O" }
+struct X
+{
+ int i0, i1;
+ char c;
+};
+
+struct A
+{
+ int i;
+ char c0, c1;
+
+ virtual ~A();
+};
+
+struct B : virtual A {};
+
+struct C : B
+{
+ X x;
+
+ void bar(X y) { x = y; }
+};
+
+void foo()
+{
+ C().bar(X());
+}
pr22488.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr15791-5.C
===================================================================
--- pr15791-5.C (nonexistent)
+++ pr15791-5.C (revision 816)
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+int foo(int i, int j)
+{
+ char g[16];
+ if (&g[i] == &g[j])
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "i == j" 1 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
pr15791-5.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr19952.C
===================================================================
--- pr19952.C (nonexistent)
+++ pr19952.C (revision 816)
@@ -0,0 +1,24 @@
+/* PR 19952 */
+/* { dg-compile } */
+/* { dg-options "-ftree-vectorize -O2" } */
+
+int i;
+
+struct A
+{
+ ~A() { ++i; }
+};
+
+struct B
+{
+ A a;
+};
+
+void foo()
+{
+ for (int i=0; i<2; ++i)
+ {
+ B *p;
+ if (p) p->~B();
+ }
+}
pr19952.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27894.C
===================================================================
--- pr27894.C (nonexistent)
+++ pr27894.C (revision 816)
@@ -0,0 +1,82 @@
+// PR c++/27894
+// { dg-do compile }
+// { dg-options "-O" }
+
+class A;
+struct B
+{
+ B (unsigned long);
+ int b2 () const;
+ A *b1 () const;
+};
+
+enum { P = 0 };
+enum O { Q = 75, };
+class C;
+struct D { A *d; };
+struct E
+{
+ B e1 (int) const;
+ A *e2 (const B &) const;
+ D e3[4096];
+};
+
+inline A *
+E::e2 (const B & x) const
+{
+ const D *w = &e3[x.b2 ()];
+ return (A *) w->d;
+}
+
+extern E *e;
+
+inline A *
+B::b1 () const
+{
+ extern E *e;
+ return e->e2 (*this);
+}
+
+template struct F : public B
+{
+ F (const B &);
+ T *b1 () const;
+};
+
+template < class T > inline T * F ::b1 () const
+{
+ return (T *) B::b1 ();
+};
+
+typedef F N;
+
+class G {};
+class H : public G {};
+class I : public H {};
+class J {};
+class K {};
+struct L
+{
+ void l (J *, C *, int, const char *, O);
+};
+class M : public K, public I
+{
+ void m (J &, int, const char *);
+ void m (J &, int, int, const char *, float);
+};
+
+void
+M::m (J &x, int y, const char *z)
+{
+ L *w = new L;
+ N v = e->e1 (y);
+ w->l (&x, v.b1 (), P, z, Q);
+}
+
+void
+M::m (J &x, int y, int s, const char *z, float t)
+{
+ L *w = new L;
+ N v = e->e1 (y);
+ w->l (&x, v.b1 (), s, z, (O) (int) ((t) ? (50 + 20 / (float) t) : 0));
+}
pr27894.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ssa-sra-2.C
===================================================================
--- ssa-sra-2.C (nonexistent)
+++ ssa-sra-2.C (revision 816)
@@ -0,0 +1,52 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+void link_error();
+
+struct OOf {
+ int value;
+ OOf() {value = 0;}
+};
+inline OOf operator+(OOf op1, OOf op2)
+{
+ OOf f;
+ f.value = op1.value + op2.value;
+ return f;
+}
+inline OOf operator*(OOf op1, OOf op2)
+{
+ OOf f;
+ f.value = op1.value * op2.value;
+ return f;
+}
+inline OOf operator-(OOf op1, OOf op2)
+{
+ OOf f;
+ f.value = op1.value - op2.value;
+ return f;
+}
+inline OOf test_func(
+ OOf a,
+ OOf b,
+ OOf c
+)
+{
+ OOf d, e;
+ OOf result;
+ d = a * b + b * c;
+ e = a * c - b * d;
+ result = d * e;
+ return result;
+}
+
+void test()
+{
+ OOf a, b, c;
+ OOf d = test_func (a,b,c);
+ if (d.value)
+ link_error();
+}
+
+/* We should have removed the casts from pointers to references and caused SRA to happen. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
ssa-sra-2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24231-1.C
===================================================================
--- pr24231-1.C (nonexistent)
+++ pr24231-1.C (revision 816)
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* FRE testcase for PR 24231, problem with PRE coalescing abnormal phis. */
+struct f
+{
+ int i;
+};
+struct h{h();};
+int g(void);
+int g1(void) throw();
+int h2222(f*);
+void ghh(int);
+
+int main(void)
+{
+ int i;
+ f t;
+ try
+ {
+ i = g1();
+ try
+ {
+ i = g();
+ }catch(...)
+ {}
+ int j = i;
+ try
+ { t.i = i;
+ i = g();
+ }catch(...)
+ {}
+ i = 2;
+ int h = t.i;
+ ghh (h);
+
+ g();
+ }catch(...)
+ {}
+ return i;
+}
+
+
pr24231-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24231-3.C
===================================================================
--- pr24231-3.C (nonexistent)
+++ pr24231-3.C (revision 816)
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* PRE testcase for PR 24231, problem with PRE coalescing abnormal phis. */
+struct MemoryManager {
+ virtual void deallocate() = 0;
+};
+struct XalanVector {
+ ~XalanVector() {
+ m_memoryManager->deallocate();
+ }
+ void swap(XalanVector& theOther) {
+ MemoryManager* const theTempManager = m_memoryManager;
+ m_memoryManager = theOther.m_memoryManager;
+ theOther.m_memoryManager = theTempManager;
+ theOther.m_size = 0;
+ }
+ void push_back() {
+ XalanVector theTemp(*this);
+ theTemp.push_back();
+ swap(theTemp);
+ }
+ MemoryManager* m_memoryManager;
+ int m_size;
+};
+void f(void) {
+ XalanVector tempVector;
+ tempVector.push_back();
+}
pr24231-3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24351-1.C
===================================================================
--- pr24351-1.C (nonexistent)
+++ pr24351-1.C (revision 816)
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+struct adaptor_base {
+};
+struct bound_argument {
+ bound_argument();
+};
+template struct adaptor_functor : public adaptor_base {
+ explicit adaptor_functor(const T_functor& _A_functor) : functor_(_A_functor)
+{
+ }
+ T_functor functor_;
+ bound_argument bound_;
+};
+template struct adapts : public adaptor_base {
+ explicit adapts(const T_functor& _A_functor) : functor_(_A_functor) {
+ }
+ adaptor_functor functor_;
+};
+int main() {
+ adapts > a (adapts(1));
+}
+
+
pr24351-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr21407.C
===================================================================
--- pr21407.C (nonexistent)
+++ pr21407.C (revision 816)
@@ -0,0 +1,8 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+extern "C" void abort(void);
+struct T1 {int a, b; virtual void f(){}};
+struct T : T1 { struct T1 w; int b; };
+void foo (struct T1 *p) { struct T *q = dynamic_cast(p); if (q->b != 2) abort (); }
+/* We shouldn't kill the store to c.b, because foo uses it. */
+int main () { struct T c; c.b = 2; foo (&c); return 0; }
pr21407.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24351-3.C
===================================================================
--- pr24351-3.C (nonexistent)
+++ pr24351-3.C (revision 816)
@@ -0,0 +1,101 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+namespace sigc {
+ template struct type_trait {
+ typedef T_type& pass;
+ typedef const T_type& take;
+ typedef T_type* pointer;
+ };
+ template struct type_trait {
+ typedef T_type& pass;
+ };
+ template<> struct type_trait {
+ typedef void pass;
+ };
+ template struct is_base_and_derived {
+ struct big {
+ char memory[64];
+ };
+ static big is_base_class_(...);
+ static char is_base_class_(typename type_trait::pointer);
+ static const bool value = sizeof(is_base_class_(reinterpret_cast::pointer>(0))) == sizeof(char);
+ };
+ struct nil;
+ struct functor_base {
+ };
+ template ::value> struct functor_trait {
+ typedef typename T_functor::result_type result_type;
+ typedef T_functor functor_type;
+ };
+ struct adaptor_base : public functor_base {
+ };
+ template ::value> struct deduce_result_type {
+ typedef typename functor_trait::result_type type;
+ };
+ template struct adaptor_functor
+ : public adaptor_base {
+ template struct deduce_result_type {
+ typedef typename sigc::deduce_result_type::type type;
+ };
+ typedef typename functor_trait::result_type result_type;
+ template typename deduce_result_type::type operator()(T_arg1 _A_arg1,T_arg2 _A_arg2) const {
+ return functor_(_A_arg1,_A_arg2);
+ }
+ explicit adaptor_functor(const T_functor& _A_functor) : functor_(_A_functor) {
+ }
+ mutable T_functor functor_;
+ };
+ template ::value> struct adaptor_trait;
+ template struct adaptor_trait {
+ typedef T_functor adaptor_type;
+ };
+ template struct adaptor_trait {
+ typedef typename functor_trait::functor_type functor_type;
+ typedef adaptor_functor adaptor_type;
+ };
+ template struct adapts
+ : public adaptor_base {
+ typedef typename adaptor_trait::adaptor_type adaptor_type;
+ explicit adapts(const T_functor& _A_functor) : functor_(_A_functor) {
+ }
+ mutable adaptor_type functor_;
+ };
+ template struct unwrap_reference {
+ typedef T_type type;
+ };
+ template class bound_argument {
+ public:
+ bound_argument(const T_type& _A_argument) : visited_(_A_argument) {
+ }
+ inline T_type& invoke() {
+ }
+ T_type visited_;
+ };
+ template struct bind_functor;
+ template struct bind_functor<0, T_functor, T_bound, nil,nil,nil,nil,nil,nil> : public adapts {
+ typedef typename adapts::adaptor_type adaptor_type;
+ template struct deduce_result_type {
+ typedef typename adaptor_type::template deduce_result_type::type>::pass, typename type_trait::pass, typename type_trait::pass, typename type_trait::pass, typename type_trait::pass, typename type_trait::pass, typename type_trait::pass>::type type;
+ };
+ typedef typename adaptor_type::result_type result_type;
+ result_type operator()() {
+ return this->functor_.template operator()::type>::pass> (bound_.invoke());
+ }
+ template typename deduce_result_type::type operator()(T_arg1 _A_arg1) {
+ return this->functor_.template operator()::type>::pass, typename type_trait::pass> (bound_.invoke(), _A_arg1);
+ }
+ bind_functor(typename type_trait::take _A_func, typename type_trait::take _A_bound) : adapts(_A_func), bound_(_A_bound) {
+ }
+ bound_argument bound_;
+ };
+ template inline bind_functor bind(const T_functor& _A_func, T_bound1 _A_b1) {
+ return bind_functor(_A_func, _A_b1);
+ };
+}
+struct foo {
+ typedef int result_type;
+ int operator()(int i, int j);
+};
+int main() {
+ sigc::bind<0>(sigc::bind<0>(foo(),7),8)();
+}
pr24351-3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr23046.C
===================================================================
--- pr23046.C (nonexistent)
+++ pr23046.C (revision 816)
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+enum eumtype { ENUM1, ENUM2 };
+void g(const eumtype kind );
+void f(long i);
+void g(const eumtype kind)
+{
+ if ((kind != ENUM1) && (kind != ENUM2))
+ f(kind);
+}
pr23046.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr22615.C
===================================================================
--- pr22615.C (nonexistent)
+++ pr22615.C (revision 816)
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+/* Ensure that we don't crash when people decide to return the address of padding. */
+
+struct A
+{
+ char c;
+ int i;
+};
+
+A a;
+
+struct B
+{
+ char c, d;
+};
+
+union C
+{
+ A *p;
+ B *q;
+
+ C() : p(&a) {}
+ char& foo() { return q->d; }
+};
+void bar() { C().foo() = 0; }
+
pr22615.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr20458.C
===================================================================
--- pr20458.C (nonexistent)
+++ pr20458.C (revision 816)
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+/* The tail call optimization would inapproriately tail call the
+ destructors due to not recognizing a call clobbered variable */
+namespace std
+{
+ class locale
+ {
+ public:
+ locale();
+ ~locale();
+ };
+}
+
+struct B
+{
+ std::locale _M_buf_locale;
+ virtual ~B() {}
+};
+
+struct C : public B
+{
+ char *s;
+};
+
+void foo ()
+{
+ C c;
+}
+
+int main()
+{
+ foo ();
+ return 0;
+}
+
pr20458.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr21584-2.C
===================================================================
--- pr21584-2.C (nonexistent)
+++ pr21584-2.C (revision 816)
@@ -0,0 +1,22 @@
+extern char *strcpy (char *__restrict __dest, __const char *__restrict __src);
+
+extern char *foo (void);
+extern void *malloc(__SIZE_TYPE__) __attribute__((malloc));
+
+char v[100];
+
+void baz()
+{
+ char *vec;
+ char buf[512];
+
+ char *p = buf;
+ while (v[(*p)])
+ p++;
+
+ if (*p != '#' && (p = foo()) != 0) {
+ strcpy ((char*)malloc(10), p);
+ }
+}
+
+
pr21584-2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24439.C
===================================================================
--- pr24439.C (nonexistent)
+++ pr24439.C (revision 816)
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+/* We used to ICE in invert_truthvalue on the void type
+ 2nd argument of the COND_EXPR. */
+
+void foo(void)
+{
+ int value=1;
+ !(value?true:throw);
+}
pr24439.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: tmmti-2.C
===================================================================
--- tmmti-2.C (nonexistent)
+++ tmmti-2.C (revision 816)
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options { -O -fdump-tree-optimized } } */
+
+int a[4][8];
+
+int foo(int i)
+{
+ return *(&a[0][0] + i*8); // a[i][0]
+}
+
+struct Foo { double x, y; };
+
+Foo b[4];
+
+double bar(int i)
+{
+ return *(&b[0].x + i*2); // b[i].x
+}
+
+/* { dg-final { scan-tree-dump "a\\\[.*i.*\\\]\\\[0\\\]" "optimized" } } */
+/* { dg-final { scan-tree-dump "b\\\[.*i.*\\\].x" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
tmmti-2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: tmmti.C
===================================================================
--- tmmti.C (nonexistent)
+++ tmmti.C (revision 816)
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+
+void bar(unsigned int i)
+{
+ int a[4];
+ char *p = (char*)&a[1] + 4*i;
+}
tmmti.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr18178.C
===================================================================
--- pr18178.C (nonexistent)
+++ pr18178.C (revision 816)
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+// Define this to see it work.
+// #define WORK_WORK_WORK
+
+#define THIRD
+
+#ifdef THIRD
+#define FIRST i < 0 ||
+#define ORIG int
+#define CAST
+#else
+
+#define FIRST
+#ifdef WORK_WORK_WORK
+#define ORIG unsigned int
+#define CAST
+#else
+#define ORIG int
+#define CAST (unsigned)
+#endif // WORK_WORK_WORK
+
+#endif // THIRD
+
+struct array
+{
+ const ORIG len;
+ int *data;
+};
+
+extern void call (ORIG);
+
+void doit (array *a)
+{
+ for (ORIG i = 0; i < a->len; ++i)
+ {
+ if (FIRST CAST (i) >= CAST (a->len))
+ throw 5;
+ call (a->data[i]);
+ }
+}
+
+/* VRP should remove all but 1 if() in the loop. */
+
+/* { dg-final { scan-tree-dump-times "if " 1 "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
pr18178.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr23948.C
===================================================================
--- pr23948.C (nonexistent)
+++ pr23948.C (revision 816)
@@ -0,0 +1,19 @@
+/* { dg-options "-O1 -ffast-math -fdump-tree-recip" } */
+/* { dg-do compile } */
+
+struct MIOFILE {
+ ~MIOFILE();
+};
+double potentially_runnable_resource_share();
+void f1(double);
+int make_scheduler_request(double a, double b)
+{
+ MIOFILE mf;
+ double prrs = potentially_runnable_resource_share();
+ f1(a/prrs);
+ f1(1/prrs);
+ f1(b/prrs);
+}
+
+/* { dg-final { scan-tree-dump-times " / " 1 "recip" } } */
+/* { dg-final { cleanup-tree-dump "recip" } } */
pr23948.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27548.C
===================================================================
--- pr27548.C (nonexistent)
+++ pr27548.C (revision 816)
@@ -0,0 +1,60 @@
+// PR tree-optimization/27548
+// { dg-do compile }
+// { dg-options "-O1" }
+
+namespace Gambit
+{
+ template < class T > class Array
+ {
+ protected:int mindex, maxdex;
+ T *data;
+ int InsertAt (const T & t, int n)
+ {
+ T *new_data = new T[++this->maxdex - this->mindex + 1] - this->mindex;
+ int i;
+ for (i = this->mindex; i <= n - 1; i++)
+ new_data[i] = this->data[i];
+ new_data[i++] = t;
+ }
+ public: Array (unsigned int len = 0):mindex (1), maxdex (len),
+ data ((len) ? new T[len] -
+ 1 : 0)
+ {
+ }
+ virtual ~ Array ()
+ {
+ if (maxdex >= mindex)
+ delete[](data + mindex);
+ }
+ const T & operator[] (int index) const
+ {
+ }
+ int Append (const T & t)
+ {
+ return InsertAt (t, this->maxdex + 1);
+ }
+ };
+}
+
+class gIndexOdometer
+{
+private:Gambit::Array < int >MinIndices;
+ Gambit::Array < int >CurIndices;
+ gIndexOdometer (const Gambit::Array < int >, const Gambit::Array < int >);
+ void SetIndex (const int &, const int &);
+ int NoIndices () const;
+ gIndexOdometer AfterExcisionOf (int &) const;
+};
+gIndexOdometer
+gIndexOdometer::AfterExcisionOf (int &to_be_zapped) const
+{
+ Gambit::Array < int >NewMins, NewMaxs;
+ int i;
+ for (i = 1; i <= NoIndices (); i++)
+ {
+ NewMins.Append (MinIndices[i]);
+ }
+ gIndexOdometer NewOdo (NewMins, NewMaxs);
+ for (i = 1; i < to_be_zapped; i++)
+ NewOdo.SetIndex (i, CurIndices[i]);
+}
pr27548.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: empty-1.C
===================================================================
--- empty-1.C (nonexistent)
+++ empty-1.C (revision 816)
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct S {};
+S bar (const S &a)
+{
+ S s;
+ s = a;
+ return s;
+}
+
+/* Test whether memcpy call has been optimized out. */
+/* { dg-final { scan-tree-dump-times "memcpy" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
empty-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr26757.C
===================================================================
--- pr26757.C (nonexistent)
+++ pr26757.C (revision 816)
@@ -0,0 +1,44 @@
+// PR c++/26757
+// { dg-do run }
+// { dg-options "-O" }
+
+extern "C" void abort ();
+
+typedef struct A
+{
+ int c;
+ int d;
+} A;
+
+A *b;
+
+void
+foo ()
+{
+ b->c++;
+ extern A *b;
+ b->d++;
+
+}
+
+void
+bar ()
+{
+ if (b->d)
+ b->c++;
+}
+
+
+int
+main ()
+{
+ A a = { 0, 0 };
+ b = &a;
+ foo ();
+ bar ();
+ if (b->c != 2)
+ abort ();
+ if (b->d != 1)
+ abort ();
+ return 0;
+}
pr26757.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr29585.C
===================================================================
--- pr29585.C (nonexistent)
+++ pr29585.C (revision 816)
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -w" } */
+
+class ios_base{};
+struct basic_ostream : virtual ios_base{};
+namespace
+{
+ struct Nullostream : basic_ostream{};
+}
+class In
+{
+ In ();
+ Nullostream nullout;
+};
+In::In (){}
pr29585.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr19786.C
===================================================================
--- pr19786.C (nonexistent)
+++ pr19786.C (revision 816)
@@ -0,0 +1,48 @@
+// { dg-do run }
+/* { dg-options "-O2" } */
+
+// We used to get alias grouping wrong on this one, hoisting accesses
+// to the vector's end out of the loop.
+
+#include
+#include
+
+struct A
+{
+ double unused; // If I remove it => it works.
+ std::vector v;
+
+ A() : v(1) {}
+};
+
+inline // If not inline => it works.
+A g()
+{
+ A r;
+ r.v.resize(2);
+ r.v[0] = 1;
+
+ while (!r.v.empty() && r.v.back() == 0)
+ r.v.pop_back();
+
+ return r;
+}
+
+A f(const A &a)
+{
+ if (a.v.empty()) return a;
+ if (a.v.empty()) return a;
+
+ // A z = g(); return z; // If I return like this => it works.
+ return g();
+}
+
+int main()
+{
+ A a;
+ A b;
+ A r = f(a);
+ assert(r.v.size() != 0);
+
+ return 0;
+}
pr19786.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr22005.C
===================================================================
--- pr22005.C (nonexistent)
+++ pr22005.C (revision 816)
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+struct cl_string
+{
+ union{ int i; };
+ cl_string ();
+};
+struct cl_print_univpoly_flags { cl_string univpoly_varname; };
+struct cl_print_flags: cl_print_univpoly_flags {int i;};
+cl_print_flags default_print_flags;
pr22005.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr20280.C
===================================================================
--- pr20280.C (nonexistent)
+++ pr20280.C (revision 816)
@@ -0,0 +1,63 @@
+// PR c++/20280
+
+// { dg-do compile }
+
+// Gimplification of the COND_EXPR used to fail because it had an
+// addressable type, and create_tmp_var rejected that.
+
+struct A
+{
+ ~A();
+};
+
+struct B : A {};
+
+A& foo();
+
+void bar(bool b)
+{
+ (B&) (b ? foo() : foo());
+}
+
+// Make sure bit-fields and addressable types don't cause crashes.
+// These were not in the original bug report.
+
+// Added by Alexandre Oliva
+
+// Copyright 2005 Free Software Foundation
+
+struct X
+{
+ long i : 32, j, k : 32;
+};
+
+void g(long&);
+void h(const long&);
+
+void f(X &x, bool b)
+{
+ (b ? x.i : x.j) = 1;
+ (b ? x.j : x.k) = 2;
+ (b ? x.i : x.k) = 3;
+
+ (void)(b ? x.i : x.j);
+ (void)(b ? x.i : x.k);
+ (void)(b ? x.j : x.k);
+
+ g (b ? x.i : x.j); // { dg-error "cannot bind bitfield" }
+ g (b ? x.i : x.k); // { dg-error "cannot bind bitfield" }
+ g (b ? x.j : x.k); // { dg-error "cannot bind bitfield" }
+
+ // It's not entirely clear whether these should be accepted. The
+ // conditional expressions are lvalues for sure, and 8.5.3/5 exempts
+ // lvalues for bit-fields, but it's not clear that conditional
+ // expressions that are lvalues and that have at least one possible
+ // result that is a bit-field lvalue meets this condition.
+ h (b ? x.i : x.j);
+ h (b ? x.i : x.k);
+ h (b ? x.j : x.k);
+
+ (long &)(b ? x.i : x.j); // { dg-error "address of bit-field" }
+ (long &)(b ? x.i : x.k); // { dg-error "address of bit-field" }
+ (long &)(b ? x.j : x.k); // { dg-error "address of bit-field" }
+}
pr20280.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr32327.C
===================================================================
--- pr32327.C (nonexistent)
+++ pr32327.C (revision 816)
@@ -0,0 +1,84 @@
+// { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } }
+// { dg-options "-O2" }
+
+typedef unsigned long long uint64;
+typedef __SIZE_TYPE__ size_t;
+
+extern "C" {
+extern void *memcpy (void *__restrict __dest,
+ __const void *__restrict __src, size_t __n) /*throw ()*/;
+extern void abort (void);
+}
+
+extern void foo (void* p);
+
+inline uint64
+ghtonll(uint64 x)
+{
+ // __r is allocated the same stack slot as dest below
+ union { unsigned long long int __ll;
+ unsigned long int __l[2]; } __w, __r;
+ __w.__ll = x;
+ __r.__l[0] = (
+ {
+ register unsigned int __v;
+ __asm__ __volatile__ ("bswap %0" : "=r" (__v) :
+ "0" ((unsigned int) (__w.__l[1])));
+ __v; });
+
+ __r.__l[1] = (
+ {
+ register unsigned int __v;
+ __asm__ __volatile__ ("bswap %0" : "=r" (__v) :
+ "0" ((unsigned int) (__w.__l[0])));
+ __v; });
+
+ return __r.__ll;
+}
+
+inline uint64
+double_2_uint64 (const double *source)
+{
+ uint64 dest; // allocated the same stack slot as __r above
+ memcpy(&dest, source, sizeof(dest));
+ return dest;
+}
+
+inline void
+KeyFromUint64(uint64 fp) {
+ uint64 norder;
+ norder = ghtonll (fp);
+ foo((char*)(&norder));
+}
+
+void
+KeyFromDouble(double x) {
+ uint64 n = double_2_uint64 (&x);
+ if (n >= 42) {
+ n += 1;
+ }
+
+ KeyFromUint64(n);
+}
+
+#define NUM 0x0123456789abcdefll
+#define EXPECTED 0xe0bc9a7856347243ll
+
+void foo (void *x)
+{
+ if (*((uint64 *)x) != (uint64) EXPECTED)
+ abort ();
+}
+
+int main ()
+{
+ if (sizeof (double) != sizeof (uint64))
+ return 0;
+
+ if (sizeof (uint64) == sizeof (unsigned long int))
+ return 0;
+
+ KeyFromDouble ((double)NUM);
+
+ return 0;
+}
pr32327.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr26443.C
===================================================================
--- pr26443.C (nonexistent)
+++ pr26443.C (revision 816)
@@ -0,0 +1,20 @@
+// { dg-do compile }
+
+struct A
+{
+ double x[4];
+};
+
+struct B
+{
+ A y[2];
+};
+
+A foo(B *p)
+{
+ for ( int i=0; i<4; ++i )
+ p->y[1].x[i]=0;
+
+ A a;
+ return a;
+}
pr26443.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27830.C
===================================================================
--- pr27830.C (nonexistent)
+++ pr27830.C (revision 816)
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+struct gc{};
+struct transform:public gc
+{
+ double x, y, z, t;
+ transform (void){}
+};
+inline transform f (void)
+{
+ return transform ();
+};
+void transformed (void)
+{
+ new transform (f());
+}
+
pr27830.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr20963.C
===================================================================
--- pr20963.C (nonexistent)
+++ pr20963.C (revision 816)
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+/* This was causing PRE to insert the value of the ADDR variable, to
+ remove the invariant cast but in doing so, it was creating a
+ non-invariant expression out of the invariant one, causing a later
+ failure in PRE. */
+struct sMCB {
+ unsigned char type;
+};
+
+extern void foo (void);
+unsigned char mem_readb(char *pt) __attribute__((nothrow));
+
+void DOS_FreeProcessMemory(unsigned short pspseg) {
+ while (1) {
+ if (pspseg)
+ foo ();
+ char *addr = (char*)(&((sMCB*)0)->type);
+ if (mem_readb(addr)==0x5a) break;
+ }
+};
+
pr20963.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27291.C
===================================================================
--- pr27291.C (nonexistent)
+++ pr27291.C (revision 816)
@@ -0,0 +1,363 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+namespace std
+{
+ template < class _T1, class _T2 > struct pair
+ {
+ };
+}
+extern "C"
+{
+ extern "C"
+ {
+ typedef int int32_t __attribute__ ((__mode__ (__SI__)));
+ struct _pthread_fastlock
+ {
+ }
+ pthread_mutexattr_t;
+ }
+}
+namespace std
+{
+ struct __numeric_limits_base
+ {
+ };
+ template < typename _Tp >
+ struct numeric_limits:public __numeric_limits_base
+ {
+ static const bool is_integer = true;
+ };
+};
+typedef unsigned int uint32_t;
+namespace std
+{
+ template < typename _Alloc > class allocator;
+ template < class _CharT > struct char_traits;
+ template < typename _CharT, typename _Traits =
+ char_traits < _CharT >, typename _Alloc =
+ allocator < _CharT > >class basic_string;
+ typedef basic_string < char >string;
+}
+namespace __gnu_cxx
+{
+ template < typename _Tp > class new_allocator
+ {
+ };
+}
+namespace std
+{
+ template < typename _Tp > class allocator:public __gnu_cxx::new_allocator <
+ _Tp >
+ {
+ };
+ template < typename _CharT, typename _Traits,
+ typename _Alloc > class basic_string
+ {
+ public:inline basic_string ();
+ basic_string (const _CharT * __s, const _Alloc & __a = _Alloc ());
+ };
+}
+namespace boost
+{
+ template < class T > class integer_traits:public std::numeric_limits < T >
+ {
+ };
+ namespace detail
+ {
+ template < class T, T min_val, T max_val > class integer_traits_base
+ {
+ };
+ }
+ template <> class integer_traits < int >:public std::numeric_limits < int >,
+ public detail::integer_traits_base < int, (-2147483647 - 1), 2147483647 >
+ {
+ };
+ namespace random
+ {
+ template < class IntType, IntType m > class const_mod
+ {
+ public:static IntType add (IntType x, IntType c)
+ {
+ }
+ static IntType mult (IntType a, IntType x)
+ {
+ return mult_schrage (a, x);
+ }
+ static IntType mult_add (IntType a, IntType x, IntType c)
+ {
+ return add (mult (a, x), c);
+ }
+ static IntType mult_schrage (IntType a, IntType value)
+ {
+ for (;;)
+ {
+ if (value > 0)
+ break;
+ value += m;
+ }
+ }
+ };
+ template < class IntType, IntType a, IntType c, IntType m,
+ IntType val > class linear_congruential
+ {
+ public:typedef IntType result_type;
+ static const IntType modulus = m;
+ explicit linear_congruential (IntType x0 = 1):_modulus (modulus),
+ _x (_modulus ? (x0 % _modulus) :
+ x0)
+ {
+ }
+ IntType operator () ()
+ {
+ _x = const_mod < IntType, m >::mult_add (a, _x, c);
+ }
+ private:IntType _modulus;
+ IntType _x;
+ };
+ }
+ typedef random::linear_congruential < int32_t, 16807, 0, 2147483647,
+ 1043618065 > minstd_rand0;
+ namespace random
+ {
+ namespace detail
+ {
+ template < class T > struct ptr_helper
+ {
+ typedef T value_type;
+ typedef T & reference_type;
+ typedef const T & rvalue_type;
+ static reference_type ref (T & r)
+ {
+ }
+ };
+ template < class T > struct ptr_helper
+ {
+ typedef T value_type;
+ typedef T & rvalue_type;
+ };
+ }
+ }
+ template < class UniformRandomNumberGenerator, class RealType =
+ double >class uniform_01
+ {
+ public:typedef UniformRandomNumberGenerator base_type;
+ typedef RealType result_type;
+ explicit uniform_01 (base_type rng):_rng (rng),
+ _factor (result_type (1) /
+ (result_type ((_rng.max) () - (_rng.min) ()) +
+ result_type (std::numeric_limits <
+ base_result >::is_integer ? 1 : 0)))
+ {
+ }
+ result_type operator () ()
+ {
+ return result_type (_rng () - (_rng.min) ()) * _factor;
+ }
+ private:typedef typename base_type::result_type base_result;
+ base_type _rng;
+ result_type _factor;
+ };
+ namespace random
+ {
+ namespace detail
+ {
+ template < class UniformRandomNumberGenerator >
+ class pass_through_engine
+ {
+ private:typedef ptr_helper < UniformRandomNumberGenerator >
+ helper_type;
+ public:typedef typename helper_type::value_type base_type;
+ typedef typename base_type::result_type result_type;
+ explicit pass_through_engine (UniformRandomNumberGenerator
+ rng):_rng (static_cast <
+ typename helper_type::
+ rvalue_type > (rng))
+ {
+ }
+ result_type min () const
+ {
+ }
+ result_type max () const
+ {
+ }
+ base_type & base ()
+ {
+ }
+ result_type operator () ()
+ {
+ return base ()();
+ }
+ private:UniformRandomNumberGenerator _rng;
+ };
+ }
+ template < class RealType, int w, unsigned int p,
+ unsigned int q > class lagged_fibonacci_01
+ {
+ public:typedef RealType result_type;
+ static const unsigned int long_lag = p;
+ lagged_fibonacci_01 ()
+ {
+ seed ();
+ }
+ public:void seed (uint32_t value = 331u)
+ {
+ minstd_rand0 intgen (value);
+ seed (intgen);
+ }
+ template < class Generator > void seed (Generator & gen)
+ {
+ typedef detail::pass_through_engine < Generator & >ref_gen;
+ uniform_01 < ref_gen, RealType > gen01 =
+ uniform_01 < ref_gen, RealType > (ref_gen (gen));
+ for (unsigned int j = 0; j < long_lag; ++j)
+ x[j] = gen01 ();
+ }
+ RealType x[long_lag];
+ };
+ }
+ typedef random::lagged_fibonacci_01 < double, 48, 607,
+ 273 > lagged_fibonacci607;
+ namespace random
+ {
+ namespace detail
+ {
+ template < bool have_int, bool want_int > struct engine_helper;
+ template <> struct engine_helper
+ {
+ template < class Engine, class DistInputType > struct impl
+ {
+ typedef pass_through_engine < Engine > type;
+ };
+ };
+ }
+ }
+ template < class Engine, class Distribution > class variate_generator
+ {
+ private:typedef random::detail::pass_through_engine < Engine >
+ decorated_engine;
+ public:typedef typename decorated_engine::base_type engine_value_type;
+ typedef Distribution distribution_type;
+ variate_generator (Engine e, Distribution d):_eng (decorated_engine (e)),
+ _dist (d)
+ {
+ }
+ private:enum
+ {
+ have_int =
+ std::numeric_limits <
+ typename decorated_engine::result_type >::is_integer, want_int =
+ std::numeric_limits < typename Distribution::input_type >::is_integer
+ };
+ typedef typename random::detail::engine_helper < have_int,
+ want_int >::template impl < decorated_engine,
+ typename Distribution::input_type >::type internal_engine_type;
+ internal_engine_type _eng;
+ distribution_type _dist;
+ };
+ template < class RealType = double >class uniform_real
+ {
+ public:typedef RealType input_type;
+ };
+}
+namespace alps
+{
+ class BufferedRandomNumberGeneratorBase
+ {
+ };
+ template < class RNG >
+ class BufferedRandomNumberGenerator:public
+ BufferedRandomNumberGeneratorBase
+ {
+ public: BufferedRandomNumberGenerator ():rng_ (), gen_ (rng_,
+ boost::
+ uniform_real <> ())
+ {
+ }
+ protected: RNG rng_;
+ boost::variate_generator < RNG &, boost::uniform_real <> >gen_;
+ };
+}
+namespace boost
+{
+ namespace detail
+ {
+ class sp_counted_base
+ {
+ };
+ class shared_count
+ {
+ private:sp_counted_base * pi_;
+ public:shared_count ():pi_ (0)
+ {
+ }
+ template < class Y > explicit shared_count (Y * p):pi_ (0)
+ {
+ }
+ };
+ }
+ template < class T > class shared_ptr
+ {
+ public:typedef T element_type;
+ template < class Y > explicit shared_ptr (Y * p):px (p), pn (p)
+ {
+ }
+ T *px;
+ detail::shared_count pn;
+ };
+}
+namespace std
+{
+ template < typename _Key, typename _Tp, typename _Compare =
+ std::allocator < std::pair < const _Key, _Tp > > > class map
+ {
+ public:typedef _Key key_type;
+ typedef _Tp mapped_type;
+ mapped_type & operator[] (const key_type & __k)
+ {
+ }
+ };
+}
+namespace alps
+{
+ namespace detail
+ {
+ template < class BASE > class abstract_creator
+ {
+ public:typedef BASE base_type;
+ virtual base_type *create () const = 0;
+ };
+ template < class BASE,
+ class T > class creator:public abstract_creator < BASE >
+ {
+ public:typedef BASE base_type;
+ base_type *create () const
+ {
+ return new T ();
+ }
+ };
+ }
+ template < class KEY, class BASE > class factory
+ {
+ public:typedef BASE base_type;
+ typedef KEY key_type;
+ typedef boost::shared_ptr < detail::abstract_creator < base_type >
+ >pointer_type;
+ template < class T > bool register_type (key_type k)
+ {
+ creators_[k] = pointer_type (new detail::creator < BASE, T > ());
+ }
+ private:typedef std::map < key_type, pointer_type > map_type;
+ map_type creators_;
+ };
+ class RNGFactory:public factory < std::string,
+ BufferedRandomNumberGeneratorBase >
+ {
+ public:RNGFactory ();
+ };
+}
+alps::RNGFactory::RNGFactory ()
+{
+ register_type < BufferedRandomNumberGenerator < boost::lagged_fibonacci607 >
+ >("lagged_fibonacci607");
+}
pr27291.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr15791-2.C
===================================================================
--- pr15791-2.C (nonexistent)
+++ pr15791-2.C (revision 816)
@@ -0,0 +1,13 @@
+/* { dg-do link } */
+/* { dg-options "" } */
+
+void link_error ();
+struct a {};
+int main ()
+{
+ struct a b[2];
+ if (&b[0] == &b[1])
+ link_error ();
+ return 0;
+}
+
pr15791-2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr25771.C
===================================================================
--- pr25771.C (nonexistent)
+++ pr25771.C (revision 816)
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+int ggggg();
+struct string {
+ static int _S_empty_rep_storage[];
+ void _M_destroy();
+ char* _M_rep;
+ ~string()
+ {
+ if (_M_rep != (char*)&_S_empty_rep_storage )
+ if (ggggg() <= 0)
+ _M_destroy();
+ }
+};
+extern void SDL_FreeSurface(int surface);
+struct scoped_resource {
+ ~scoped_resource() {
+ SDL_FreeSurface(1);
+ }
+};
+struct surface {
+ scoped_resource surface_;
+};
+struct button {
+ string help_text_;
+ string label_;
+ surface image_;
+};
+struct scrollbar {
+ string help_text_;
+ button uparrow_;
+};
+scrollbar a;
+
pr25771.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr15791-4.C
===================================================================
--- pr15791-4.C (nonexistent)
+++ pr15791-4.C (revision 816)
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+int f(int i, int j)
+{
+ int b[2][2];
+ if (&b[1][i] == &b[0][j])
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "i == j" 0 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
pr15791-4.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: 20040317-1.C
===================================================================
--- 20040317-1.C (nonexistent)
+++ 20040317-1.C (revision 816)
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+/* Test provided by Brian Ryner in PR 14511. The alias analyzer was
+ not handling structures containing arrays properly. In this case,
+ the static cast was introducing two assignments of the form
+
+ this_6->_vptr.IFoo = &_ZTV4IFoo[2];
+ this_4->_vptr.IFoo = &_ZTV3Bar[2];
+
+ which were not considered to alias each other because the alias
+ analyzer was not computing a proper pointer to array elements.
+ Another related bug was the type based alias analyzer not computing
+ alias relations to _ZTV4IFoo and _ZTV3Bar. Since those variables
+ are read-only, it was disregarding alias information for them.
+ So, the memory tags for the two 'this' variables were not being
+ marked as aliased with these variables. Resulting in the two
+ assignments not aliasing each other.
+
+ This was causing the optimizers to generate a call to the virtual
+ method Foo() instead of the overloaded version. */
+
+struct IFoo
+{
+ virtual void Foo() = 0;
+};
+
+struct Bar : IFoo
+{
+ void Foo() { }
+};
+
+int main(int argc, char **argv)
+{
+ Bar* b = new Bar();
+ static_cast(b)->Foo();
+ return 0;
+}
20040317-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr16688.C
===================================================================
--- pr16688.C (nonexistent)
+++ pr16688.C (revision 816)
@@ -0,0 +1,273 @@
+/* PR 16688. Test provided by Wolfgang Bangerth. The alias analyzer
+ was aborting when trying to group aliases. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+template
+struct iterator_traits;
+
+template
+struct iterator_traits<_Tp*> {
+ typedef _Tp& reference;
+};
+
+template struct NI {
+ _Iterator current;
+
+ typedef typename iterator_traits<_Iterator>::reference reference;
+
+ NI() { }
+
+ NI(const _Iterator& __i) : current(__i) { }
+
+ reference operator*() const { return *current; }
+
+ NI& operator++() { return *this; }
+
+ const _Iterator& base() const { return current; }
+};
+
+template
+inline int
+operator-(const NI<_IteratorL>& __lhs,
+ const NI<_IteratorR>& __rhs)
+{ return __lhs.base() - __rhs.base(); }
+
+
+template
+inline _OI
+__copy_aux(_II __first, _II __last, _OI __result)
+{
+ struct __copy {
+ static _OI
+ copy(_II __first, _II __last, _OI __result)
+ {
+ for (; __first != __last; ++__result, ++__first)
+ *__result = *__first;
+ return __result;
+ }
+ };
+
+ return __copy::copy(__first, __last, __result);
+}
+
+struct __copy_normal
+{
+ template
+ static _OI
+ copy_n(_II __first, _II __last, _OI __result)
+ {
+ return __copy_aux(__first, __last, __result);
+ }
+};
+template
+inline _OutputIterator
+copy(_InputIterator __first, _InputIterator __last,
+ _OutputIterator __result)
+{
+ return __copy_normal::copy_n(__first, __last, __result);
+}
+
+template
+void uninitialized_fill_n(T,U,V);
+
+
+template
+struct _Vector_base {
+ struct _Vector_impl {
+ _Tp* start;
+ _Tp* finish;
+ _Tp* end_of_storage;
+ _Vector_impl() : start(0), finish(0), end_of_storage(0)
+ { }
+ } impl;
+
+ _Vector_base(unsigned __n) {
+ impl.start = allocate(__n);
+ impl.finish = impl.start;
+ impl.end_of_storage = impl.start + __n;
+ }
+
+ ~_Vector_base() {
+ deallocate(impl.start,
+ impl.end_of_storage - impl.start);
+ }
+
+ _Tp* allocate(unsigned __n);
+
+ void deallocate(_Tp* __p, unsigned __n);
+
+ NI<_Tp*> begin() { return NI<_Tp*> (impl.start); }
+};
+
+
+template
+struct vector : _Vector_base<_Tp>
+{
+ vector(int __n)
+ : _Vector_base<_Tp>(__n)
+ {
+ uninitialized_fill_n(this->impl.start, __n, _Tp());
+ }
+};
+
+
+
+struct Tensor
+{
+ Tensor ();
+ Tensor (const Tensor &);
+
+ double values[2];
+};
+
+
+inline
+Tensor::Tensor (const Tensor &p)
+{
+ for (unsigned int i=0; i<2; ++i)
+ values[i] = p.values[i];
+}
+
+
+struct TriaAccessor
+{
+ typedef void * AccessorData;
+
+ void copy_from (const TriaAccessor &);
+ void operator = (const TriaAccessor *);
+
+ TriaAccessor & operator = (const TriaAccessor &);
+
+ bool operator == (const TriaAccessor &) const;
+
+ bool operator != (const TriaAccessor &) const;
+ void operator ++ ();
+
+ int state () const;
+ bool used () const;
+
+ int present_level;
+ int present_index;
+ int** levels;
+};
+
+inline int TriaAccessor::state () const {
+ if ((present_level>=0) && (present_index>=0))
+ return 0;
+ else
+ if ((present_level==-1) && (present_index==-1))
+ return 1;
+ else
+ return 2;
+}
+
+
+inline
+void TriaAccessor::operator ++ () {
+ ++this->present_index;
+
+ while (this->present_index >=
+ static_cast(*this->levels[this->present_level]))
+ {
+ ++this->present_level;
+ this->present_index = 0;
+
+ if (this->present_level >= static_cast(1))
+ {
+
+ this->present_level = this->present_index = -1;
+ return;
+ }
+ }
+}
+
+struct MGDoFObjectAccessor : TriaAccessor {};
+
+
+
+struct TriaRawIterator
+{
+ TriaRawIterator ();
+
+ TriaRawIterator (const TriaRawIterator &);
+ TriaRawIterator (const MGDoFObjectAccessor &a);
+ const MGDoFObjectAccessor & operator * () const;
+
+ MGDoFObjectAccessor & operator * ();
+ const MGDoFObjectAccessor * operator -> () const;
+
+ MGDoFObjectAccessor * operator -> ();
+
+ TriaRawIterator & operator = (const TriaRawIterator &);
+
+ bool operator == (const TriaRawIterator &) const;
+ bool operator != (const TriaRawIterator &) const;
+ bool operator < (const TriaRawIterator &) const;
+ MGDoFObjectAccessor accessor;
+
+ TriaRawIterator & operator ++ ();
+};
+
+struct TriaIterator : TriaRawIterator
+{
+ TriaIterator ();
+
+ TriaIterator (const TriaIterator &i);
+
+ TriaIterator &
+ operator = (const TriaIterator &);
+
+ TriaIterator &
+ operator = (const TriaRawIterator &);
+};
+
+
+inline
+TriaRawIterator::TriaRawIterator (const TriaRawIterator &i) :
+ accessor (i.accessor) {}
+
+inline
+TriaIterator::TriaIterator (const TriaIterator &i) :
+ TriaRawIterator (static_cast(i)) {}
+
+inline
+TriaRawIterator & TriaRawIterator::operator ++ () {
+ while (++accessor, (this->accessor.state() == 0))
+ if (this->accessor.used() == true)
+ return *this;
+ return *this;
+}
+
+struct Comp {
+ Comp (const Tensor &dir) : dir(dir) {}
+
+ bool operator () (const TriaIterator &c1, const TriaIterator &c2) const;
+ const Tensor dir;
+};
+
+
+template
+void x1(Iter first, Iter last, int i, Comp comp)
+{
+ x1(Iter(), last, i, comp);
+}
+
+template
+inline void x2(Iter first, Iter last, Comp comp)
+{
+ if (first.base() != last.base())
+ x1(first, last, (last - first), comp);
+}
+
+void downstream_dg (const Tensor& direction)
+{
+ vector ordered_cells(13);
+ const Comp comparator(direction);
+
+ TriaIterator begin, end;
+
+ copy (begin, end, ordered_cells.begin());
+ x2 (ordered_cells.begin(), ordered_cells.begin(), comparator);
+}
pr16688.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pointer-reference-alias.C
===================================================================
--- pointer-reference-alias.C (nonexistent)
+++ pointer-reference-alias.C (revision 816)
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(int *a)
+{
+ int &b = *a;
+ b = 0;
+ return *a;
+}
+
+/* There should be only one dereferencing of a. */
+/* { dg-final { scan-tree-dump-times "\\*a" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
pointer-reference-alias.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ssa-sra-1.C
===================================================================
--- ssa-sra-1.C (nonexistent)
+++ ssa-sra-1.C (revision 816)
@@ -0,0 +1,61 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+void link_error();
+
+
+struct State {
+ int p0, p1, p2;
+ inline State(){p0=0;p1=0;p2=0;}
+ inline State(const State &s) {
+ p0 = s.p0;
+ p1 = s.p1;
+ p2 = s.p2;
+ }
+
+ inline void operator =(const State &s) {
+ p0 = s.p0;
+ p1 = s.p1;
+ p2 = s.p2;
+ }
+
+ inline void step(void) {
+ p0 = p1+p2;
+ p1 = p0*p1+p2;
+ p2 = p0-p2;
+ }
+};
+
+
+inline void iterate_ok(State &inS1, State &inS2, unsigned int n)
+{
+ State s1 = inS1;
+ for (unsigned int i = 0; i < n; i++) {
+ s1.step();
+ }
+ inS1 = s1;
+}
+
+void temp()
+{
+ State s1;
+ s1.p0 = 0;
+ s1.p1 = 0;
+ s1.p2 = 0;
+ State s2;
+ s2.p0 = 0;
+ s2.p1 = 0;
+ s2.p2 = 0;
+ iterate_ok (s1, s2, 1);
+ if (s1.p0)
+ link_error();
+ if (s1.p0)
+ link_error();
+ if (s1.p0)
+ link_error();
+}
+
+/* We should have removed the casts from pointers to references and caused SRA to happen. */
+
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
ssa-sra-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: ssa-sra-3.C
===================================================================
--- ssa-sra-3.C (nonexistent)
+++ ssa-sra-3.C (revision 816)
@@ -0,0 +1,83 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* Test check use_block_copy bit propagation in sra element hierarchy. */
+
+typedef unsigned char UINT8 ;
+typedef unsigned int UINT ;
+class C4
+{
+public:
+ int xy[2];
+};
+
+class C3
+{
+public:
+ inline void
+ Reset()
+ {
+ C4 const mvMax = {0x7fff, 0x7fff};
+
+ m42(0,mvMax);
+ m42(1,mvMax);
+ m43(0);
+ };
+
+ inline void m42 (UINT i, C4 mv)
+ {
+ mMv[i] = mv;
+ };
+
+
+
+ inline void m43(UINT j)
+ {
+ m44 (j);
+ d41 = j + 1;
+ };
+
+private:
+
+ C4 mMv[2];
+ UINT8 d41;
+ inline void m44 (UINT j) const {};
+};
+
+class C2
+{
+private:
+ bool valid;
+};
+
+class C1
+{
+public:
+ void m1(C3 *c);
+
+private:
+ const C2 * d1[2];
+ void m2(C3 *m);
+};
+
+void C1::m1 (C3 *r)
+{
+ C3 x;
+ m2(&x);
+}
+void C1::m2(C3 *x)
+{
+ C3 m3;
+ int i;
+ m3.Reset ();
+ for(i=0; i<2; i++)
+ {
+ const C2 * r = d1[i];
+ if (r!=__null)
+ {
+ C4 const c400 = {0,0};
+ m3.m42 (i, c400);
+
+ }
+ }
+}
+
ssa-sra-3.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: copyprop-1.C
===================================================================
--- copyprop-1.C (nonexistent)
+++ copyprop-1.C (revision 816)
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-dce2" } */
+
+/* Verify that we can eliminate the useless conversions to/from
+ const qualified pointer types
+ this_2 = o_1;
+ D.20003_4 = this_2->data_m;
+ this_5 = D.20003_4;
+ D.20005_6 = this_5->value;
+ copyprop should propagate o_1 and D.20003_4 to the loads of data_m
+ and value. dce removes all traces of this. */
+
+struct Data {
+ int get() const { return value; }
+ int value;
+};
+
+struct Object {
+ int operator[](int i) const { return data_m->get(); }
+ Data *data_m;
+};
+
+int foo(Object&o)
+{
+ return o[0];
+}
+
+/* { dg-final { scan-tree-dump-not ".* = \[^>;\]*;" "dce2" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "dce2" } } */
copyprop-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: block1.C
===================================================================
--- block1.C (nonexistent)
+++ block1.C (revision 816)
@@ -0,0 +1,11 @@
+// PR 13764: We were inserting an extra body block in all functions, but
+// it's only really necessary for [cd]tors.
+// { dg-options "-fdump-tree-gimple" }
+
+void bar (void)
+{
+ int a;
+}
+
+// { dg-final { scan-tree-dump-times "\{" 1 "gimple" } }
+// { dg-final { cleanup-tree-dump "gimple" } }
block1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24231-2.C
===================================================================
--- pr24231-2.C (nonexistent)
+++ pr24231-2.C (revision 816)
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* FRE testcase for PR 24231, problem with PRE coalescing abnormal phis. */
+struct f
+{
+ int i;
+};
+struct h{h();};
+int g(void);
+int g1(void) throw();
+int h2222(f*);
+void ghh(int);
+
+int main(void)
+{
+ int i;
+ f t;
+ try
+ {
+ i = g1();
+ try
+ {
+ i = g();
+ }catch(...)
+ {}
+ int j = i;
+ try
+ {
+ i = g();
+ }catch(...)
+ {}
+ t.i = j;
+ i = 2;
+ int h = t.i;
+ ghh (h);
+
+ g();
+ }catch(...)
+ {}
+ return i;
+}
pr24231-2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr17400.C
===================================================================
--- pr17400.C (nonexistent)
+++ pr17400.C (revision 816)
@@ -0,0 +1,53 @@
+// Test PR 17400. Test case provided by Serge Belyshev.
+
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+
+void inc (int &);
+bool dec_test (int &);
+
+struct A
+{
+ int c;
+
+ friend void AddRef (A * p)
+ {
+ inc (p->c);
+ }
+
+ friend void Release (A * p)
+ {
+ if(dec_test (p->c))
+ delete p;
+ }
+};
+
+struct B
+{
+ B (A *p) : obj(p)
+ {
+ AddRef (obj);
+ }
+
+ ~B()
+ {
+ Release (obj);
+ }
+
+ void swap (B &rhs)
+ {
+ A * tmp = obj;
+ obj = rhs.obj;
+ rhs.obj = tmp;
+ }
+
+ A *obj;
+};
+
+void bar (A *p1, A* p2)
+{
+ B px (p1);
+ B px2 (p2);
+ px.swap (px2);
+}
pr17400.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr22071.C
===================================================================
--- pr22071.C (nonexistent)
+++ pr22071.C (revision 816)
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+/* This code ends up taking the address of part of the structure that is padding,
+ and because there is no real field there, the structure alias analyzer would
+ abort. */
+struct empty_class {};
+struct class1 : empty_class
+{
+ class1() {}
+ empty_class value_;
+};
+struct lambda : class1 { };
+lambda _1;
pr22071.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr21082.C
===================================================================
--- pr21082.C (nonexistent)
+++ pr21082.C (revision 816)
@@ -0,0 +1,14 @@
+/* { dg-do link } */
+/* { dg-options "-fstrict-overflow" } */
+
+void link_error();
+
+int a[4];
+long b, c;
+
+int main()
+{
+ if (&a[b] - &a[c] != b - c)
+ link_error();
+ return 0;
+}
pr21082.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr22550.C
===================================================================
--- pr22550.C (nonexistent)
+++ pr22550.C (revision 816)
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+class X {
+public:
+ int mfunc1 () {
+ return 1;
+ }
+ int mfunc2 () {
+ return 2;
+ }
+ X (int a, int b) { }
+};
+
+typedef int (X::*memfunc_p_t) ();
+
+memfunc_p_t mf_arr[2] = { &X::mfunc1, &X::mfunc2 };
+
+int
+main ()
+{
+ // Get pntr to the array of pointers to member-funcs
+ memfunc_p_t (*mf_arr_p)[2] = &mf_arr;
+ // Compare indirect against direct access to an array element
+ if ((*mf_arr_p)[0] != mf_arr[0])
+ return 1;
+ return 0;
+}
pr22550.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24351-2.C
===================================================================
--- pr24351-2.C (nonexistent)
+++ pr24351-2.C (revision 816)
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+struct adaptor_base {};
+struct bound_argument {
+ bound_argument();
+};
+struct adaptor_functorint : public adaptor_base {};
+struct adaptsint : public adaptor_base {
+ adaptsint(const int& _A_functor);
+ adaptor_functorint functor_;
+};
+struct adaptor_functor_adaptsint {
+ adaptor_functor_adaptsint(const adaptsint& _A_functor) : functor_(_A_functor)
+ {}
+ adaptsint functor_;
+ bound_argument bound_;
+};
+struct adapts_adaptsint {
+ adapts_adaptsint(const adaptsint& _A_functor) : functor_(_A_functor)
+ {}
+ adaptor_functor_adaptsint functor_;
+};
+int main() {
+ adapts_adaptsint a (adaptsint(1));
+}
pr24351-2.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr22037.C
===================================================================
--- pr22037.C (nonexistent)
+++ pr22037.C (revision 816)
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern double sqrt (double) throw ();
+
+void foo(double& d, int n)
+{
+ double e=0;
+ for(int i=0; i
pr22037.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24172.C
===================================================================
--- pr24172.C (nonexistent)
+++ pr24172.C (revision 816)
@@ -0,0 +1,11 @@
+// { dg-options "-O2" }
+void IOException( char);
+inline int* dummy( const char* const mode )
+{
+ IOException(*mode+*mode);
+}
+
+void prepare_inpaint( )
+{
+ dummy ("rb");
+}
pr24172.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr23164.C
===================================================================
--- pr23164.C (nonexistent)
+++ pr23164.C (revision 816)
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+bool f();
+struct S {
+ S();
+ ~S();
+};
+void g() {
+ for (;;) {
+ S s1, s2, s3, s4, s5, s6;
+ if (f())
+ continue;
+ if (f())
+ return;
+ }
+}
pr23164.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr23624.C
===================================================================
--- pr23624.C (nonexistent)
+++ pr23624.C (revision 816)
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+
+template
+void f()
+{
+ int *t, i;
+ t[i ? 0 : i];
+}
pr23624.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr14814.C
===================================================================
--- pr14814.C (nonexistent)
+++ pr14814.C (revision 816)
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-forwprop2" } */
+
+class YY { public:
+ YY(const YY &v) { e[0] = v.e[0]; e[1] = v.e[1]; e[2] = v.e[2]; }
+ double &y() { return e[1]; }
+ double e[3]; };
+
+class XX { public:
+ YY direction() const { return v; }
+ YY v; };
+
+int foo(XX& r) {
+ if (r.direction().y() < 0.000001) return 0;
+ return 1; }
+
+/* { dg-final { scan-tree-dump-times "&this" 0 "forwprop2" } } */
+/* { dg-final { scan-tree-dump-times "&r" 0 "forwprop2" } } */
+/* { dg-final { cleanup-tree-dump "forwprop2" } } */
+
pr14814.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr21584-1.C
===================================================================
--- pr21584-1.C (nonexistent)
+++ pr21584-1.C (revision 816)
@@ -0,0 +1,38 @@
+extern "C" {
+
+extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
+ throw () __attribute__ ((__nonnull__ (1, 2)));
+
+extern char *foo (char *__restrict __s) throw ();
+}
+
+class cset {
+public:
+ cset();
+ int operator()(unsigned char) const;
+private:
+ char v[(127 * 2 + 1)+1];
+};
+
+inline int cset::operator()(unsigned char c) const
+{
+ return v[c];
+}
+
+extern cset csspace;
+
+void baz()
+{
+ char *vec;
+ char buf[512];
+
+ char *p = buf;
+ while (csspace(*p))
+ p++;
+
+ if (*p != '#' && (p = foo(buf)) != 0) {
+ vec = new char[10+ 1];
+ strcpy(vec, p);
+ }
+}
+
pr21584-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: sra-1.C
===================================================================
--- sra-1.C (nonexistent)
+++ sra-1.C (revision 816)
@@ -0,0 +1,29 @@
+/* https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=223576 */
+
+/* SRA failed to canonicalize bit-field types, introducing type
+ mismatches. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct A
+{
+ int a:16;
+ /* These dummy bit-fields are here to prevent GCC 4.2+ from merging
+ the bit-field compares into a single word compare, which disables
+ SRA. */
+ int a2:16;
+ int a3:16;
+ int a4:16;
+ int b:8;
+ bool operator==(A const x) const
+ {
+ return (this->a == x.a && this->b == x.b);
+ }
+};
+
+bool
+foo (A const x, A const y)
+{
+ return x == y;
+}
sra-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr24238.C
===================================================================
--- pr24238.C (nonexistent)
+++ pr24238.C (revision 816)
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef struct SDL_Rect {
+ unsigned short w, h;
+}SDL_Rect;
+SDL_Rect *location();
+SDL_Rect inner_location()
+{
+ SDL_Rect r = *location();
+ r.w -= 1;
+ return r;
+}
pr24238.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27283.C
===================================================================
--- pr27283.C (nonexistent)
+++ pr27283.C (revision 816)
@@ -0,0 +1,57 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+namespace Gambit
+{
+ template < class T > class Array
+ {
+ protected:int mindex, maxdex;
+ T *data;
+ int InsertAt (const T & t, int n)
+ {
+ T *new_data = new T[++this->maxdex - this->mindex + 1] - this->mindex;
+ int i;
+ for (i = this->mindex; i <= n - 1; i++)
+ new_data[i] = this->data[i];
+ }
+ public: Array (unsigned int len = 0):mindex (1), maxdex (len),
+ data ((len) ? new T[len] -
+ 1 : 0)
+ {
+ }
+ virtual ~ Array ()
+ {
+ if (maxdex >= mindex)
+ delete[](data + mindex);
+ }
+ const T & operator[] (int index) const
+ {
+ }
+ int Append (const T & t)
+ {
+ return InsertAt (t, this->maxdex + 1);
+ }
+ };
+}
+class gIndexOdometer
+{
+private:Gambit::Array < int >MinIndices;
+ Gambit::Array < int >CurIndices;
+ gIndexOdometer (const Gambit::Array < int >, const Gambit::Array < int >);
+ void SetIndex (const int &, const int &);
+ int NoIndices () const;
+ gIndexOdometer AfterExcisionOf (int &) const;
+};
+gIndexOdometer
+gIndexOdometer::AfterExcisionOf (int &to_be_zapped) const
+{
+ Gambit::Array < int >NewMins, NewMaxs;
+ int i;
+ for (i = 1; i <= NoIndices (); i++)
+ {
+ NewMins.Append (MinIndices[i]);
+ }
+ gIndexOdometer NewOdo (NewMins, NewMaxs);
+ NewOdo.SetIndex (i, CurIndices[i]);
+}
+
pr27283.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr22279.C
===================================================================
--- pr22279.C (nonexistent)
+++ pr22279.C (revision 816)
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct string
+{
+ long long _M_p;
+ long long i;
+ string();
+ int begin();
+ int end();
+ string(int, int);
+};
+struct symbol
+{
+ int type;
+ string name;
+ long long raw_name;
+ long long demangled_name;
+ long long version_name;
+ int version_status;
+ int status;
+ void init();
+};
+void symbol::init() { name = string(); }
+struct pair
+{
+ symbol first;
+ symbol second;
+ pair(const symbol& __a, const symbol& __b) : first(__a), second(__b) { }
+};
+struct vector
+{
+ void push_back(const pair& __x);
+};
+/* This ends up with two RHS deref copies, and we need to get the offsets right on them. */
+void f(vector incompatible)
+{
+ symbol base;
+ incompatible.push_back(pair(base, base));
+}
+
+
+
pr22279.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: builtin1.C
===================================================================
--- builtin1.C (nonexistent)
+++ builtin1.C (revision 816)
@@ -0,0 +1,10 @@
+// { dg-do link }
+
+extern void link_error();
+
+int main()
+{
+ if (! __builtin_constant_p (&"Hello"[0]))
+ link_error();
+ return 0;
+}
builtin1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr29902.C
===================================================================
--- pr29902.C (nonexistent)
+++ pr29902.C (revision 816)
@@ -0,0 +1,19 @@
+/* { dg-do compile { target i?86-*-* } } */
+/* { dg-options "-O1 -fprefetch-loop-arrays -march=athlon" } */
+/* { dg-require-effective-target ilp32 } */
+
+int length1();
+int g(int);
+void f(int capacity_, char *old_storage)
+{
+ try {
+ length1();
+ int old_capacity = capacity_;
+ capacity_ *= 2;
+ g(capacity_);
+ for (int i = 1; i < old_capacity; i++)
+ old_storage[i] = old_storage[i - 1];
+ } catch (...) {
+ for (int i = 1; i < capacity_; i++){old_storage[i] = 0;}
+ }
+}
pr29902.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr28238.C
===================================================================
--- pr28238.C (nonexistent)
+++ pr28238.C (revision 816)
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+struct iterator{};
+struct ByteIterator : iterator
+{
+ ByteIterator (){}
+ int a[1024];
+};
+inline ByteIterator f ()
+{
+ return ByteIterator ();
+}
+class ConfLexerCore
+{
+ ConfLexerCore ();
+ ByteIterator m_matchStart;
+};
+ConfLexerCore::ConfLexerCore ()
+: m_matchStart (f ())
+{ }
+
pr28238.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr19807.C
===================================================================
--- pr19807.C (nonexistent)
+++ pr19807.C (revision 816)
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+int a[4];
+int *x, *y, *z;
+
+void foo(void)
+{
+ x = &a[3] - 1;
+ y = &a[1] + 1;
+ z = 1 + &a[1];
+}
+
+void bar(int i)
+{
+ x = &a[i] - 1;
+ y = &a[i] + 1;
+ z = 1 + &a[i];
+}
+
+/* { dg-final { scan-tree-dump-times "&a\\\[2\\\]" 3 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "&a\\\[.* - 1\\\]" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "&a\\\[.* \\+ 1\\\]" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
pr19807.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr27549.C
===================================================================
--- pr27549.C (nonexistent)
+++ pr27549.C (revision 816)
@@ -0,0 +1,78 @@
+// PR tree-optimization/27549
+// { dg-do compile }
+// { dg-options "-O2" }
+
+typedef __SIZE_TYPE__ size_t;
+
+struct E
+{
+ virtual ~E () {}
+ virtual size_t e () const = 0;
+ virtual void f (char *x) const = 0;
+};
+
+struct F : public E
+{
+ virtual ~F () {}
+ virtual size_t e () const { return 0; }
+ virtual void f (char *x) const { *x = '\0'; }
+};
+
+struct S
+{
+ S () { a = new char[32]; b = 32; c = 0; a[0] = 0; }
+ void s (const char *x, size_t y) { v (c + y + 1); __builtin_memcpy(a + c, x, y); c += y; a[c] = '\0'; }
+ void s (const E *x) { size_t l = x->e(); v (c + l + 1); x->f (a + c); c += l; }
+ const char *t () { return a; }
+ void v (size_t n)
+ {
+ if (b >= n) return;
+
+ size_t b2 = b;
+ char *a2 = a;
+
+ for (;;)
+ {
+ b *= 2;
+ if (b >= n)
+ break;
+ }
+
+ a = new char[b];
+
+ if (b2)
+ {
+ __builtin_memcpy(a, a2, c);
+ a2[0] = 0;
+ for (size_t i = 1; i < b2; i++)
+ a2[i] = a2[i - 1];
+ delete[] a2;
+ }
+ }
+
+ ~S ()
+ {
+ if (b)
+ {
+ a[0] = 0;
+ for (size_t i = 1; i < b; i++)
+ a[i] = a[i - 1];
+ }
+ delete[] a;
+ }
+ char * a;
+ size_t b, c;
+};
+
+const char *p;
+size_t q;
+const F u;
+
+const char *
+foo ()
+{
+ S s;
+ s.s (p, q);
+ s.s (&u);
+ return s.t ();
+}
pr27549.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property