NO

Author Topic: Using atomic vars; spill_at_range(), RC4  (Read 1889 times)

neo313

  • Guest
Using atomic vars; spill_at_range(), RC4
« on: May 29, 2014, 11:14:56 AM »
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.

Code: [Select]

#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

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Using atomic vars; spill_at_range(), RC4
« Reply #1 on: May 29, 2014, 12:00:06 PM »
I will look at it...
/Pelle