digitalmars.D.bugs - [Issue 5976] New: "variable used before set" with foreach with ref + scope(failure) + structure method + -O
- d-bugmail puremagic.com (29/29) May 10 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5976
- d-bugmail puremagic.com (15/15) May 11 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5976
- d-bugmail puremagic.com (18/18) May 11 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5976
- d-bugmail puremagic.com (14/14) May 12 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5976
- d-bugmail puremagic.com (9/15) May 12 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5976
http://d.puremagic.com/issues/show_bug.cgi?id=5976 Summary: "variable used before set" with foreach with ref + scope(failure) + structure method + -O Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: regression Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: thecybershadow gmail.com --- Comment #0 from Vladimir <thecybershadow gmail.com> 2011-05-10 15:38:19 PDT --- When compiled with -O: test.d(9): Error: variable b used before set struct B { void bar(){} } B[] barr; void foo() { foreach (ref b; barr) { scope(failure) b.bar(); assert(&b); // do anything with b } } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 10 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5976 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rejects-valid CC| |clugdbug yahoo.com.au Summary|"variable used before set" |"variable used before set" |with foreach with ref + |with foreach with ref + |scope(failure) + structure |scope(failure) + structure |method + -O |method + -O -inline --- Comment #1 from Don <clugdbug yahoo.com.au> 2011-05-11 08:17:20 PDT --- This only happens with -O -inline (-O alone is not sufficient). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 11 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5976 --- Comment #2 from Don <clugdbug yahoo.com.au> 2011-05-11 08:28:11 PDT --- Reduced test case that doesn't require structs or -inline. Compile with -O. void bug5976() { int[] barr; int * k; foreach (ref b; barr) { scope(failure) k = &b; k = &b; } } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 11 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5976 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla digitalmars.com Resolution| |FIXED --- Comment #3 from Walter Bright <bugzilla digitalmars.com> 2011-05-12 17:27:15 PDT --- https://github.com/D-Programming-Language/dmd/commit/95229fec741951be4d4ad6d5c4a16060c5cde668 https://github.com/D-Programming-Language/dmd/commit/670360ac6616687566854060ad3178cf8c783c38 https://github.com/D-Programming-Language/dmd/commit/04428f78c691991dbbb1f9e17cb45b5f198f8045 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 12 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5976 --- Comment #4 from Vladimir <thecybershadow gmail.com> 2011-05-12 20:19:53 PDT --- (In reply to comment #1)This only happens with -O -inline (-O alone is not sufficient).Yep, my bad. (In reply to comment #3)https://github.com/D-Programming-Language/dmd/commit/95229fec741951be4d4ad6d5c4a16060c5cde668 https://github.com/D-Programming-Language/dmd/commit/670360ac6616687566854060ad3178cf8c783c38 https://github.com/D-Programming-Language/dmd/commit/04428f78c691991dbbb1f9e17cb45b5f198f8045Thanks! That fixed my build. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 12 2011