Using an atomic variable in a struct and operating on it using a variable, gives an *Internal error: spill_at_range().* error.
In the PICK_ONE section, every example separately gives the same error.
#include <assert.h>
#include <stdlib.h>
#include <stdatomic.h>
struct problem
{
size_t one ;
_Atomic size_t atom ; //error persists if this is not atomic and the atomic_store is peformed on this member
//error dissapears if type is long long or _Atomic long long
} ;
int main( void )
{
struct problem* handle = malloc( sizeof( *handle ) ) ;
assert( handle ) ;
handle->one = 0 ;
atomic_init( &handle->atom , 0 ) ; //error persists if the this line is removed
//PICK ONE:
atomic_store( &handle->atom , handle->one ) ;
//OR
//size_t var = 123 ;
//atomic_store( &handle->atom , var ) ; //using 123 in place of var, removes the error
//OR
//handle->atom = handle->one ; //if atom isn't declared as _Atomic this doesn't give an error
//OR
//const size_t one = handle->one ;
//atomic_store( &handle->atom , one ) ;
//OR
//const size_t one = handle->one ;
//handle->atom = one ;
return 0 ;
}
I'm using Windows 7 32bit, PellesC Version 8.00.11 RC #4