aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrey Belevantsev <abel@ispras.ru>2011-04-08 17:25:29 +0400
committerAndrey Belevantsev <abel@gcc.gnu.org>2011-04-08 17:25:29 +0400
commit19ac78921e8351a7b4b96c0b404d30dbbfb4f80d (patch)
treee26fad5edf90e1aeb0033a2cc5dc5424c53f81bd /gcc
parent0f8c63cc10c27905f6d6fa553d3be08a416b2e1f (diff)
downloadgcc-19ac78921e8351a7b4b96c0b404d30dbbfb4f80d.zip
gcc-19ac78921e8351a7b4b96c0b404d30dbbfb4f80d.tar.gz
gcc-19ac78921e8351a7b4b96c0b404d30dbbfb4f80d.tar.bz2
re PR rtl-optimization/48272 (internal compiler error: in setup_insn_reg_pressure_info, at haifa-sched.c:1124)
PR rtl-optimization/48272 * sched-deps.c (setup_insn_reg_pressure_info): Export and rename to init_insn_reg_pressure_info. Adjust a caller. * sched-int.h (init_insn_reg_pressure_info): Declare. * haifa-sched.c (haifa_init_insn): Call init_insn_reg_pressure_info when sched-pressure is enabled. * g++.dg/opt/pr48272.C: New. From-SVN: r172183
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/haifa-sched.c2
-rw-r--r--gcc/sched-deps.c6
-rw-r--r--gcc/sched-int.h1
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/opt/pr48272.C130
6 files changed, 151 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d323a62..107f79b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2011-04-08 Andrey Belevantsev <abel@ispras.ru>
+
+ PR rtl-optimization/48272
+
+ * sched-deps.c (setup_insn_reg_pressure_info): Export and rename to
+ init_insn_reg_pressure_info. Adjust a caller.
+ * sched-int.h (init_insn_reg_pressure_info): Declare.
+ * haifa-sched.c (haifa_init_insn): Call init_insn_reg_pressure_info
+ when sched-pressure is enabled.
+
2011-04-08 Richard Guenther <rguenther@suse.de>
* gimple.c (gimple_set_modified): Do not queue calls to
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 30f55be..6908a11 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -5611,6 +5611,8 @@ haifa_init_insn (rtx insn)
/* Extend dependency caches by one element. */
extend_dependency_caches (1, false);
}
+ if (sched_pressure_p)
+ init_insn_reg_pressure_info (insn);
}
/* Init data for the new basic block BB which comes after AFTER. */
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index dcee019..393e651 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -1991,8 +1991,8 @@ mark_insn_reg_clobber (rtx reg, const_rtx setter, void *data)
}
/* Set up reg pressure info related to INSN. */
-static void
-setup_insn_reg_pressure_info (rtx insn)
+void
+init_insn_reg_pressure_info (rtx insn)
{
int i, len;
enum reg_class cl;
@@ -2774,7 +2774,7 @@ sched_analyze_insn (struct deps_desc *deps, rtx x, rtx insn)
if (sched_pressure_p)
{
setup_insn_reg_uses (deps, insn);
- setup_insn_reg_pressure_info (insn);
+ init_insn_reg_pressure_info (insn);
}
/* Add register dependencies for insn. */
diff --git a/gcc/sched-int.h b/gcc/sched-int.h
index d5add3b..d5c9509 100644
--- a/gcc/sched-int.h
+++ b/gcc/sched-int.h
@@ -1194,6 +1194,7 @@ extern void init_deps_global (void);
extern void finish_deps_global (void);
extern void deps_analyze_insn (struct deps_desc *, rtx);
extern void remove_from_deps (struct deps_desc *, rtx);
+extern void init_insn_reg_pressure_info (rtx);
extern dw_t get_dep_weak_1 (ds_t, ds_t);
extern dw_t get_dep_weak (ds_t, ds_t);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 65440e2..acd66d09 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-08 Andrey Belevantsev <abel@ispras.ru>
+
+ PR rtl-optimization/48272
+ * g++.dg/opt/pr48272.C: New.
+
2011-04-08 Dmitry Melnik <dm@ispras.ru>
PR rtl-optimization/48235
diff --git a/gcc/testsuite/g++.dg/opt/pr48272.C b/gcc/testsuite/g++.dg/opt/pr48272.C
new file mode 100644
index 0000000..cb28a1b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr48272.C
@@ -0,0 +1,130 @@
+// { dg-do compile }
+// { dg-options "-O3 -ftracer -fsched-pressure -Wno-unused-parameter -Wno-return-type" }
+
+extern "C"
+{
+ namespace std
+ {
+ class exception
+ {
+ virtual const char *what () const throw ();
+ };
+ }
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+ 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;
+ template < typename _CharT, typename _Traits =
+ char_traits < _CharT > >class basic_ios;
+ typedef basic_ios < char >ios;
+}
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+ template < typename _Tp > class new_allocator
+ {
+ };
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+template < typename _Tp > class allocator:public __gnu_cxx::new_allocator <
+ _Tp >
+ {
+ };
+}
+
+typedef int _Atomic_word;
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+ static inline _Atomic_word
+ __attribute__ ((__unused__)) __exchange_and_add_dispatch (_Atomic_word *
+ __mem,
+ int __val)
+ {
+ }
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+ template < typename _CharT, typename _Traits,
+ typename _Alloc > class basic_string
+ {
+ typedef _Alloc allocator_type;
+ private:struct _Rep_base
+ {
+ _Atomic_word _M_refcount;
+ };
+ struct _Rep:_Rep_base
+ {
+ void _M_dispose (const _Alloc & __a)
+ {
+ if (__builtin_expect (this != &_S_empty_rep (), false))
+ {
+ if (__gnu_cxx::
+ __exchange_and_add_dispatch (&this->_M_refcount, -1) <= 0)
+ {
+ _M_destroy (__a);
+ }
+ }
+ }
+ void _M_destroy (const _Alloc &) throw ();
+ };
+ struct _Alloc_hider:_Alloc
+ {
+ _CharT *_M_p;
+ };
+ private:mutable _Alloc_hider _M_dataplus;
+ _CharT *_M_data () const
+ {
+ return _M_dataplus._M_p;
+ }
+ _Rep *_M_rep () const
+ {
+ return &((reinterpret_cast < _Rep * >(_M_data ()))[-1]);
+ }
+ static _Rep & _S_empty_rep ()
+ {
+ }
+ public: basic_string ():_M_dataplus (_S_empty_rep ()._M_refdata (),
+ _Alloc ())
+ {
+ }
+ basic_string (const _CharT * __s, const _Alloc & __a = _Alloc ());
+ ~basic_string ()
+ {
+ _M_rep ()->_M_dispose (this->get_allocator ());
+ }
+ allocator_type get_allocator () const
+ {
+ }
+ };
+ class ios_base
+ {
+ public:class failure:public exception
+ {
+ public:explicit failure (const string & __str) throw ();
+ };
+ };
+template < typename _CharT, typename _Traits > class basic_ios:public
+ ios_base
+ {
+ };
+ namespace iostreams
+ {
+ class zlib_error:public std::ios::failure
+ {
+ public:explicit zlib_error (int error);
+ private:int error_;
+ };
+ zlib_error::zlib_error (int error):std::ios::failure ("zlib error"),
+ error_ (error)
+ {
+ }
+ }
+}