[Bug middle-end/53147] [4.7/4.8 Regression] gcc apparently miscompiles clang-3.1(or trunk)

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Apr 28 10:05:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53147

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-04-28 10:05:26 UTC ---
  [/var/tmp/llvm/llvm/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp :
172:56] D.147621 = clang::CFGBlock::front (block);
  [/var/tmp/llvm/llvm/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp :
172:56] try
    {
      [/var/tmp/llvm/llvm/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp
: 172:56] cstmt = clang::CFGElement::getAs<clang::CFGStmt>
([/var/tmp/llvm/llvm/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp :
172] &D.147621);

  const CFGStmt *cstmt = block->front().getAs<CFGStmt>();

That right there I think is the cause of the issue.  
block->front() returns a temp variable which ends its life after the statement
ends.



More information about the Gcc-bugs mailing list