Skip to content

Commit

Permalink
(tacle#42) table-bench: adpcm_enc.c: add -fwrapv
Browse files Browse the repository at this point in the history
This code relies on wrapping signed arithmetic which is undefined
behavior unless -fwrapv is explicitly set.
  • Loading branch information
Lithrein committed Feb 22, 2024
1 parent 6400092 commit e8017ef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bench/sequential/adpcm_enc/adpcm_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ int adpcm_enc_fabs( int n )
return f;
}


#pragma GCC push_options
#pragma GCC optimize "-fwrapv"
int adpcm_enc_sin( int rad )
{
int diff;
Expand Down Expand Up @@ -254,6 +255,7 @@ int adpcm_enc_sin( int rad )

return app;
}
#pragma GCC pop_options


int adpcm_enc_cos( int rad )
Expand Down

0 comments on commit e8017ef

Please sign in to comment.