Ignore:
Timestamp:
Apr 23, 2019, 2:41:32 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
673cd63
Parents:
8c3a0336
Message:

Fixed several warnings in libcfa

Location:
libcfa/src/concurrency
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/coroutine.cfa

    r8c3a0336 rffe2fad  
    7070        bool userStack = ((intptr_t)this.storage & 0x1) != 0;
    7171        if ( ! userStack && this.storage ) {
    72                 *((intptr_t*)&this.storage) &= (intptr_t)-1;
     72                __attribute__((may_alias)) intptr_t * istorage = (intptr_t *)&this.storage;
     73                *istorage &= (intptr_t)-1;
     74
    7375                void * storage = this.storage->limit;
    7476                __cfaabi_dbg_debug_do(
     
    174176        this->storage->limit = storage;
    175177        this->storage->base  = (void*)((intptr_t)storage + size);
    176         *((intptr_t*)&this->storage) |= userStack ? 0x1 : 0x0;
     178        __attribute__((may_alias)) intptr_t * istorage = (intptr_t*)&this->storage;
     179        *istorage |= userStack ? 0x1 : 0x0;
    177180}
    178181
  • libcfa/src/concurrency/invoke.h

    r8c3a0336 rffe2fad  
    199199        #ifdef __cforall
    200200        extern "Cforall" {
    201                 static inline struct coroutine_desc * volatile active_coroutine() { return TL_GET( this_thread )->curr_cor; }
    202                 static inline struct thread_desc    * volatile active_thread   () { return TL_GET( this_thread    ); }
    203                 static inline struct processor      * volatile active_processor() { return TL_GET( this_processor ); } // UNSAFE
     201                static inline struct coroutine_desc * active_coroutine() { return TL_GET( this_thread )->curr_cor; }
     202                static inline struct thread_desc    * active_thread   () { return TL_GET( this_thread    ); }
     203                static inline struct processor      * active_processor() { return TL_GET( this_processor ); } // UNSAFE
    204204
    205205                static inline thread_desc * & get_next( thread_desc & this ) {
  • libcfa/src/concurrency/kernel.cfa

    r8c3a0336 rffe2fad  
    165165                base      = info->base;
    166166        }
    167         *((intptr_t*)&stack.storage) |= 0x1;
     167        __attribute__((may_alias)) intptr_t * istorage = (intptr_t*) &stack.storage;
     168        *istorage |= 0x1;
    168169        name = "Main Thread";
    169170        state = Start;
Note: See TracChangeset for help on using the changeset viewer.