aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cgraphunit.c6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/torture/pr45874.C58
4 files changed, 74 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e847c41..6793255 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-10-13 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/45874
+ * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee):
+ Fixup the CFG when EH was fixed up.
+
2010-10-13 Ira Rosen <irar@il.ibm.com>
* tree-vect-slp.c (vect_get_constant_vectors): Fix comment.
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index e9d1f1d..95f30e2 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -2167,13 +2167,17 @@ cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *e)
SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt;
gsi = gsi_for_stmt (e->call_stmt);
- gsi_replace (&gsi, new_stmt, true);
+ gsi_replace (&gsi, new_stmt, false);
+ if (maybe_clean_or_replace_eh_stmt (e->call_stmt, new_stmt))
+ gimple_purge_dead_eh_edges (gimple_bb (new_stmt));
}
else
{
new_stmt = e->call_stmt;
gimple_call_set_fndecl (new_stmt, e->callee->decl);
update_stmt (new_stmt);
+ if (maybe_clean_eh_stmt (new_stmt))
+ gimple_purge_dead_eh_edges (gimple_bb (new_stmt));
}
cgraph_set_call_stmt_including_clones (e->caller, e->call_stmt, new_stmt);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f5a2377..f5687e3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-10-13 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/45874
+ * g++.dg/torture/pr45874.C: New testcase.
+
2010-10-13 Iain Sandoe <iains@gcc.gnu.org>
* objc.dg/attributes/method-attribute-1.m: Update to respond
diff --git a/gcc/testsuite/g++.dg/torture/pr45874.C b/gcc/testsuite/g++.dg/torture/pr45874.C
new file mode 100644
index 0000000..70965ff
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr45874.C
@@ -0,0 +1,58 @@
+// { dg-do compile }
+
+typedef struct {
+} IppLibraryVersion;
+typedef unsigned char Ipp8u;
+typedef unsigned int Ipp32u;
+typedef signed int Ipp32s;
+typedef enum e_vm_Status {
+ VM_OK = 0, VM_OPERATION_FAILED =-999, VM_NOT_INITIALIZED =-998, VM_TIMEOUT =-987, VM_NOT_ENOUGH_DATA =-996, VM_NULL_PTR =-995, VM_SO_CANT_LOAD =-994, VM_SO_INVALID_HANDLE =-993, VM_SO_CANT_GET_ADDR =-992 }
+ vm_status;
+ typedef Ipp32s Status;
+ class MediaReceiver {
+ };
+class MediaBuffer : public MediaReceiver {
+};
+struct TrackInfo {
+};
+struct Mpeg2TrackInfo : public TrackInfo {
+};
+class BitstreamReader {
+public: BitstreamReader(void);
+ virtual ~BitstreamReader(void) {
+ }
+ Ipp32u GetBits(Ipp32s iNum);
+ void SkipBits(Ipp32s iNum);
+protected: virtual void Refresh(void);
+ Ipp32s m_iReadyBits;
+};
+class FrameConstructor : public MediaBuffer {
+};
+class VideoFrameConstructor : public FrameConstructor {
+};
+class Mpeg2FrameConstructor : public VideoFrameConstructor {
+ static Status ParsePictureHeader(Ipp8u *buf, Ipp32s iLen, Mpeg2TrackInfo *pInfo);
+};
+Status Mpeg2FrameConstructor::ParsePictureHeader(Ipp8u *buf, Ipp32s iLen, Mpeg2TrackInfo *pInfo) {
+ BitstreamReader bs;
+ bs.SkipBits(32 + 4 + 4 + 4 + 4 + 4 + 2);
+ bs.SkipBits(1 + 1 + 1 + 1 + 1 + 1 + 1);
+ bs.SkipBits(5);
+ bs.SkipBits(3);
+ Ipp8u source_format;
+ bs.SkipBits(22);
+ bs.SkipBits(8);
+ if (7 == source_format) {
+ Ipp8u ufep = (Ipp8u)bs.GetBits(3);
+ if (0x01 == ufep) {
+ bs.SkipBits(10);
+ }
+ }
+}
+void BitstreamReader::SkipBits(Ipp32s iNum) {
+ if (iNum <= m_iReadyBits) {
+ m_iReadyBits -= iNum;
+ Refresh();
+ }
+}
+void BitstreamReader::Refresh(void) { }