www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Issue 1034] New: regression: -inline -O run/o/odd_bug_09_A.d

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1034

           Summary: regression: -inline -O run/o/odd_bug_09_A.d
           Product: DGCC aka GDC
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: glue layer
        AssignedTo: dvdfrdmn users.sf.net
        ReportedBy: thomas-dloop kuehne.cn


# struct S{
#    union{
#       void delegate(uint) del;
#       void function(uint) fp;
#    }
#    static S opCall(void function(uint) c,uint i){
#       S a;
#       a.fp = c;
#       return a;
#    }
# }
# 
# S s;
# 
# static this(){
#    s = S(&foo, 0);
# }
# 
# void foo(uint i){
# }
# 
# int main(){
#    foo(0);
#    if(! s.fp){
#       assert(0);
#    }
#    s.fp(0);
# 
#    return 0;
# }

gdmd-0.23 -inline -O run/o/odd_bug_09_A.d -ofx && ./x
Error: AssertError Failure run/o/odd_bug_09_A.d(36)

test case:
http://dstress.kuehne.cn/run/o/odd_bug_09_A.d


-- 
Mar 07 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1034


braddr puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |regression




-- 
Apr 13 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1034


dvdfrdmn users.sf.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #1 from dvdfrdmn users.sf.net  2007-07-22 10:44 -------
Fixed in svn r131 / release 0.24.

This is really just a workaround: SRA optimizations are disabled for structs
that have anonymous unions.  A better solution would be to create embedded
UNION_TYPEs.

Fix is in the GCC patch, so re-apply it before rebuilding.


-- 
Jul 22 2007