summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-09-14 23:09:01 +0100
committerYann Herklotz <git@yannherklotz.com>2020-09-14 23:09:01 +0100
commit61a399947c243a342e9e3332360038b33ca6c646 (patch)
treea72d5ceef5ecb934d4fda30d76cacc62c64ca092
parentbd844501c75fa175c563f6183809416d48e76fc0 (diff)
downloadfccm21_esrhls-61a399947c243a342e9e3332360038b33ca6c646.tar.gz
fccm21_esrhls-61a399947c243a342e9e3332360038b33ca6c646.zip
Add
-rw-r--r--eval_rewrite.tex2
1 files changed, 1 insertions, 1 deletions
diff --git a/eval_rewrite.tex b/eval_rewrite.tex
index d51c018..d81b158 100644
--- a/eval_rewrite.tex
+++ b/eval_rewrite.tex
@@ -103,7 +103,7 @@ In the code above, \texttt{b} has value 1 when run in GCC, but has value 0 when
The following code does not output the right value when compiled with all Vivado versions and GCC, as it returns \texttt{0x0} with Vivado whereas it should be returning \texttt{0xF}. This test case is much longer compared to the other test cases that were reduced and could not be made any smaller, as everything in the code is necessary to trigger the bug.
-The array \texttt{a} is initialised to all zeros, as well as the other global variables \texttt{g} and \texttt{c}, so as to not introduce any undefined behaviour. However, \texttt{g} is also assigned the \texttt{volatile} keyword, which ensures that the variable is not optimised away.
+The array \texttt{a} is initialised to all zeros, as well as the other global variables \texttt{g} and \texttt{c}, so as to not introduce any undefined behaviour. However, \texttt{g} is also assigned the \texttt{volatile} keyword, which ensures that the variable is not optimised away. The function \texttt{d} then accumulates the values \texttt{b} that it is passed into a hash that is stored in \texttt{c}. Each \texttt{b} is eight bits wide, so function \texttt{e} calls the function 7 times for some of the bits in the 64 bit value of \texttt{f} that it is passed. Finally, in the main function, the array is initialised partially with a for loop, after which the \texttt{e} function is called twice, once on the volatile function but also on a constant. Interestingly enough, the second function call with the constant is also necessary to trigger the bug.
\begin{figure}
\begin{minted}{c}