summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-09 16:17:07 +0000
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-09 16:17:07 +0000
commit39c2983fe74eeb6f87438b99a0ffc7c976b3a879 (patch)
treec1d7fb168f81ebdaafafc5613beb198b088c6c50 /gcc
parent26aa705947405e6aea26bc506105c30c155fcaa7 (diff)
downloadgcc-39c2983fe74eeb6f87438b99a0ffc7c976b3a879.tar.gz
2004-12-09 Andrew Pinski <pinskia@physics.uc.edu>
PR tree-opt/18904 * g++.dg/opt/ptrmem5.C: New test. 2004-12-09 Andrew Pinski <pinskia@physics.uc.edu> PR tree-opt/18904 * tree-chrec.c (chrec_convert): Use fold_convert instead of convert. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91954 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/opt/ptrmem5.C19
-rw-r--r--gcc/tree-chrec.c2
4 files changed, 31 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7f810dd8b6c..0b3031ba1b6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2004-12-09 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR tree-opt/18904
+ * tree-chrec.c (chrec_convert): Use fold_convert
+ instead of convert.
+
2004-12-09 Matt Rice <ratmice@yahoo.com>
PR preprocessor/18102
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 51d6be53469..cc4f1ae43fc 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-12-09 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR tree-opt/18904
+ * g++.dg/opt/ptrmem5.C: New test.
+
2004-12-09 Alexandre Oliva <aoliva@redhat.com>
* g++.dg/parse/typename5.C: Adjust for new error.
diff --git a/gcc/testsuite/g++.dg/opt/ptrmem5.C b/gcc/testsuite/g++.dg/opt/ptrmem5.C
new file mode 100644
index 00000000000..639ad2831c0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/ptrmem5.C
@@ -0,0 +1,19 @@
+// PR tree-opt/18904
+// { dg-do compile }
+// { dg-options "-O3" }
+
+struct Data;
+struct Wrapper {
+ Data* D;
+};
+struct Data {
+ int X;
+ void init(Wrapper&);
+};
+void Data::init( Wrapper &w ) {
+ int Data::* res = &Data::X;
+ w.D = this;
+ for( int i = 0; i < 4; i++ )
+ (w.D->*res) = 0;
+}
+
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index be0d80a73fd..54960449217 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -983,7 +983,7 @@ chrec_convert (tree type,
default:
{
- tree res = convert (type, chrec);
+ tree res = fold_convert (type, chrec);
/* Don't propagate overflows. */
TREE_OVERFLOW (res) = 0;