[LLVMbugs] [Bug 8161] New: Assertion `From != To && "ReplaceAndSimplifyAllUses(X, X) is not valid!"' failed.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Sep 15 20:50:33 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=8161

           Summary: Assertion `From != To &&
                    "ReplaceAndSimplifyAllUses(X,X) is not valid!"'
                    failed.
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu, chenyang at cs.utah.edu


[regehr at gamow tmp427]$ clang -v
clang version 2.9 (trunk 114038)
Target: x86_64-unknown-linux-gnu
Thread model: posix

[regehr at gamow tmp427]$ clang -c -O3 small.c

small.c:24:8: warning: expression result unused [-Wunused-value]
  for (0; l_132; l_132 = safe_sub_func_int32_t_s_s (l_132, 1))
       ^
small.c:32:1: warning: control reaches end of non-void function [-Wreturn-type] 
}
^
clang: InstructionSimplify.cpp:461: void
llvm::ReplaceAndSimplifyAllUses(llvm::Instruction*, llvm::Value*, const
llvm::TargetData*): Assertion `From != To && "ReplaceAndSimplifyAllUses(X,X) is
not valid!"' failed.
0  clang           0x000000000169953f
1  clang           0x000000000169b7b2
2  libpthread.so.0 0x00007f11269e3190
3  libc.so.6       0x00007f1125ce84b5 gsignal + 53
4  libc.so.6       0x00007f1125cebf50 abort + 384
5  libc.so.6       0x00007f1125ce1481 __assert_fail + 241
6  clang           0x00000000014c8aeb
7  clang           0x0000000001475128
llvm::SimplifyInstructionsInBlock(llvm::BasicBlock*, llvm::TargetData const*) +
120
8  clang           0x000000000138feb3
9  clang           0x00000000015de4ad
llvm::FPPassManager::runOnFunction(llvm::Function&) + 557
10 clang           0x00000000014a4e2b
11 clang           0x00000000014a5585
12 clang           0x00000000015de044
llvm::MPPassManager::runOnModule(llvm::Module&) + 500
13 clang           0x00000000015de1b7 llvm::PassManagerImpl::run(llvm::Module&)
+ 167
14 clang           0x00000000007cbbb7
clang::EmitBackendOutput(clang::Diagnostic&, clang::CodeGenOptions const&,
clang::TargetOptions const&, llvm::Module*, clang::BackendAction,
llvm::raw_ostream*) + 1623
15 clang           0x00000000007c7cab
16 clang           0x00000000008e91a3 clang::ParseAST(clang::Sema&, bool) + 291
17 clang           0x00000000007c8c94 clang::CodeGenAction::ExecuteAction() +
68
18 clang           0x00000000006d5e9d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 349
19 clang           0x00000000006b3bfc
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1292
20 clang           0x00000000006ab968 cc1_main(char const**, char const**, char
const*, void*) + 472
21 clang           0x00000000006b27f5 main + 4117
22 libc.so.6       0x00007f1125cd3abd __libc_start_main + 253
23 clang           0x00000000006aa2e9
Stack dump:
0.      Program arguments:
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r114038-install/bin/clang
-cc1 -triple x86_64-unknown-linux-gnu -S -disable-free -main-file-name small.c
-mrelocation-model static -mdisable-fp-elim -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -target-linker-version 2.20 -resource-dir
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r114038-install/lib/clang/2.9
-O3 -ferror-limit 19 -fmessage-length 89 -fgnu-runtime
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-D2Fchs.s -x c small.c 
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'CallGraph Pass Manager' on module 'small.c'.
4.      Running pass 'Value Propagation' on function '@func_114'
clang: error: clang frontend command failed due to signal 6 (use -v to see
invocation)

[regehr at gamow tmp427]$ cat small.c

typedef signed char int8_t;
typedef int int32_t;
typedef unsigned short int uint16_t;
static int8_t
safe_add_func_int32_t_s_s (int32_t si1, int32_t si2)
{
  return si1 > 0 && si2 > 0 && si1 > -si2 || si1 < 0 && si2 < 0
    && si1 < -si2 ? : si1 + si2;
}

static int8_t
safe_sub_func_int32_t_s_s (int32_t si1, int8_t si2)
{
  return si1 ^ si2 & si1 ^ si1 ^ si2 & ~0 - si2 ^ si2 ? : si1 - si2;
}

int32_t g_122;
uint16_t g_126;
uint16_t g_180;
int8_t *
func_114 (int8_t p_115, int8_t * const *p_116, uint16_t p_117, uint16_t p_118)
{
  int8_t l_132;
  for (0; l_132; l_132 = safe_sub_func_int32_t_s_s (l_132, 1))
    {
      int32_t *l_173 = &g_122;
      g_180 &= safe_add_func_int32_t_s_s (*l_173 < 1, g_126);
      *l_173 = 0;
      if (g_126)
        break;
    }
}

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list