Thread overview | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
April 17, 2015 [Bug 179] invalid code generation with -O2 for method returning ref | ||||
---|---|---|---|---|
| ||||
Attachments:
| http://bugzilla.gdcproject.org/show_bug.cgi?id=179 Ketmar Dark <ketmar@ketmar.no-ip.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ketmar@ketmar.no-ip.org --- Comment #1 from Ketmar Dark <ketmar@ketmar.no-ip.org> --- p.s. changing the line a.valueChanged.connect!"watch"(o); to a.valueChangedSg.connect!"watch"(o); (i.e. bypassing method call) works as expected both with -O0 and -O2. -- You are receiving this mail because: You are watching all bug changes. |
April 17, 2015 [Bug 179] invalid code generation with -O2 for method returning ref | ||||
---|---|---|---|---|
| ||||
Attachments:
| http://bugzilla.gdcproject.org/show_bug.cgi?id=179 --- Comment #2 from Ketmar Dark <ketmar@ketmar.no-ip.org> --- p.p.s. i'm using GCC 4.9.2 and the corresponding HEAD branch of gdc on x86. -- You are receiving this mail because: You are watching all bug changes. |
April 17, 2015 [Bug 179] invalid code generation with -O2 for method returning ref | ||||
---|---|---|---|---|
| ||||
Attachments:
| http://bugzilla.gdcproject.org/show_bug.cgi?id=179 --- Comment #3 from Ketmar Dark <ketmar@ketmar.no-ip.org> --- also, adding 'final' either to `ref RestrictedSignal!(string, int) valueChanged ()` or to `@property void value (int v)` fixes the code too. -- You are receiving this mail because: You are watching all bug changes. |
April 17, 2015 [Bug 179] invalid code generation with -O2 for method returning ref | ||||
---|---|---|---|---|
| ||||
Attachments:
| http://bugzilla.gdcproject.org/show_bug.cgi?id=179 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |DUPLICATE --- Comment #4 from Iain Buclaw <ibuclaw@gdcproject.org> --- I think this is just another side of #52 with regards to NRVO. *** This bug has been marked as a duplicate of bug 52 *** -- You are receiving this mail because: You are watching all bug changes. |
April 18, 2015 [Bug 179] invalid code generation with -O2 for method returning ref | ||||
---|---|---|---|---|
| ||||
Attachments:
| http://bugzilla.gdcproject.org/show_bug.cgi?id=179 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |NEW Resolution|DUPLICATE |--- --- Comment #5 from Iain Buclaw <ibuclaw@gdcproject.org> --- Actually, no it isn't. -- You are receiving this mail because: You are watching all bug changes. |
April 18, 2015 [Bug 179] invalid code generation with -O2 for method returning ref | ||||
---|---|---|---|---|
| ||||
Attachments:
| http://bugzilla.gdcproject.org/show_bug.cgi?id=179 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes. |
April 18, 2015 [Bug 179] invalid code generation with -O2 for method returning ref | ||||
---|---|---|---|---|
| ||||
Attachments:
| http://bugzilla.gdcproject.org/show_bug.cgi?id=179 --- Comment #6 from Iain Buclaw <ibuclaw@gdcproject.org> --- Reduced: --- struct SignalImpl { @disable this(this); } struct RestrictedSignal { SignalImpl mImpl; void connect() { } } struct Signal { RestrictedSignal mRestricted; } class MyObject { Signal valueChangedSg; ref RestrictedSignal valueChanged() { return valueChangedSg.mRestricted; } } int main () { MyObject a = new MyObject; a.valueChanged().connect(); return 0; } -- You are receiving this mail because: You are watching all bug changes. |
April 18, 2015 [Bug 179] invalid code generation with -O2 for method returning ref | ||||
---|---|---|---|---|
| ||||
Attachments:
| http://bugzilla.gdcproject.org/show_bug.cgi?id=179 --- Comment #7 from Iain Buclaw <ibuclaw@gdcproject.org> --- There seems to be a key thing happening here: --- struct SignalImpl { @disable this(this); // SignalImpl is now non-POD } --- Because of this, TypeFunction::toCtype sets TREE_ADDRESSABLE on functions returning SignalImpl (which is correct behaviour, we do *not* want non-POD types to return in registers). However... --- ref RestrictedSignal valueChanged() { return valueChangedSg.mRestricted; // returned by ref } --- Reference returns should not have TREE_ADDRESSABLE set as they are already returning in memory. -- You are receiving this mail because: You are watching all bug changes. |
April 18, 2015 [Bug 179] invalid code generation with -O2 for method returning ref | ||||
---|---|---|---|---|
| ||||
Attachments:
| http://bugzilla.gdcproject.org/show_bug.cgi?id=179 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |FIXED --- Comment #8 from Iain Buclaw <ibuclaw@gdcproject.org> --- https://github.com/D-Programming-GDC/GDC/commit/10bc8bcddc787d1134fc6da5602d4453f7a9f454 -- You are receiving this mail because: You are watching all bug changes. |
Copyright © 1999-2021 by the D Language Foundation