Skip to content

Using C Reduce to debug compiler mismatches

Jeff Bush edited this page Jul 2, 2017 · 6 revisions

Unfortunately, creduce seems happy to create invalid programs with undefined behavior, which aren't helpful in tracking down actual differences

In the case where the host compiler produces a different result than Nyuzi (with the former ostensibly being correct).

Install C-Reduce from: https://embed.cs.utah.edu/creduce/ On mac:

sudo port install creduce

Create a script to do the check:

https://gist.github.com/jbush001/a6cb4b61f1cfa144cdbc35c6899909e4

Run:

creduce ./reduce-check.py fail1.c