diff mbox

Add a test which will fail without r201824

Message ID CAO2gOZUa2wZNsyv-ATD+z9quOUgBU6bYaJq_8TZLCPzhJxOR6Q@mail.gmail.com
State New
Headers show

Commit Message

Dehao Chen Oct. 24, 2013, 2:57 p.m. UTC
This test will fail if we don't have
http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=r201824

Bootstrapped and passed regression test.

OK for trunk?

gcc/testsuite/ChangeLog:
2013-10-24  Dehao Chen  <dehao@google.com>

* g++.dg/opt/devirt3.C: New test.

Comments

Jan Hubicka Oct. 24, 2013, 4:15 p.m. UTC | #1
> This test will fail if we don't have
> http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=r201824
> 
> Bootstrapped and passed regression test.
> 
> OK for trunk?
This is OK. Thanks!
If they fail on FSF 4.8, I can work on backporting the patch.
it is quite self contained and safe.

Honza
> 
> gcc/testsuite/ChangeLog:
> 2013-10-24  Dehao Chen  <dehao@google.com>
> 
> * g++.dg/opt/devirt3.C: New test.
> 
> Index: gcc/testsuite/g++.dg/opt/devirt3.C
> ===================================================================
> --- gcc/testsuite/g++.dg/opt/devirt3.C (revision 0)
> +++ gcc/testsuite/g++.dg/opt/devirt3.C (revision 0)
> @@ -0,0 +1,24 @@
> +// { dg-do compile }
> +// { dg-options "-O2" }
> +
> +class ert_RefCounter {
> + protected:
> +  int refCounterE;
> +  virtual ~ert_RefCounter() {}
> +};
> +
> +class ebs_Object : virtual public ert_RefCounter {
> +};
> +
> +class dpr_App : public ebs_Object {
> + public:
> +  virtual void run();
> +};
> +
> +class dpr_Job : public ebs_Object {};
> +
> +void dpr_run(ebs_Object& objectA) {
> +  ((dpr_App&)objectA).run();
> +  dpr_Job jobL;
> +  dpr_run(jobL);
> +}
Dehao Chen Oct. 24, 2013, 4:35 p.m. UTC | #2
Committed to trunk, and verified that FSF 4.8 will also fail this test.

Quick question, is it possible that these two patches will trigger
other bugs? The reason I ask is that I saw you have many other patches
later for devirtualization related code, which made me a little
nervous about this.

Thanks,
Dehao

On Thu, Oct 24, 2013 at 9:15 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
>> This test will fail if we don't have
>> http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=r201824
>>
>> Bootstrapped and passed regression test.
>>
>> OK for trunk?
> This is OK. Thanks!
> If they fail on FSF 4.8, I can work on backporting the patch.
> it is quite self contained and safe.
>
> Honza
>>
>> gcc/testsuite/ChangeLog:
>> 2013-10-24  Dehao Chen  <dehao@google.com>
>>
>> * g++.dg/opt/devirt3.C: New test.
>>
>> Index: gcc/testsuite/g++.dg/opt/devirt3.C
>> ===================================================================
>> --- gcc/testsuite/g++.dg/opt/devirt3.C (revision 0)
>> +++ gcc/testsuite/g++.dg/opt/devirt3.C (revision 0)
>> @@ -0,0 +1,24 @@
>> +// { dg-do compile }
>> +// { dg-options "-O2" }
>> +
>> +class ert_RefCounter {
>> + protected:
>> +  int refCounterE;
>> +  virtual ~ert_RefCounter() {}
>> +};
>> +
>> +class ebs_Object : virtual public ert_RefCounter {
>> +};
>> +
>> +class dpr_App : public ebs_Object {
>> + public:
>> +  virtual void run();
>> +};
>> +
>> +class dpr_Job : public ebs_Object {};
>> +
>> +void dpr_run(ebs_Object& objectA) {
>> +  ((dpr_App&)objectA).run();
>> +  dpr_Job jobL;
>> +  dpr_run(jobL);
>> +}
diff mbox

Patch

Index: gcc/testsuite/g++.dg/opt/devirt3.C
===================================================================
--- gcc/testsuite/g++.dg/opt/devirt3.C (revision 0)
+++ gcc/testsuite/g++.dg/opt/devirt3.C (revision 0)
@@ -0,0 +1,24 @@ 
+// { dg-do compile }
+// { dg-options "-O2" }
+
+class ert_RefCounter {
+ protected:
+  int refCounterE;
+  virtual ~ert_RefCounter() {}
+};
+
+class ebs_Object : virtual public ert_RefCounter {
+};
+
+class dpr_App : public ebs_Object {
+ public:
+  virtual void run();
+};
+
+class dpr_Job : public ebs_Object {};
+
+void dpr_run(ebs_Object& objectA) {
+  ((dpr_App&)objectA).run();
+  dpr_Job jobL;
+  dpr_run(jobL);
+}