From: John David Anglin Date: Wed, 11 Aug 2010 02:18:07 +0000 (+0000) Subject: linux-atomic.c (SUBWORD_VAL_CAS): Instantiate with 'unsigned short' and 'unsigned... X-Git-Tag: releases/gcc-4.6.0~5117 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e5fbc9bf5fbde8066d6b1be935a0e5663808f8eb;p=thirdparty%2Fgcc.git linux-atomic.c (SUBWORD_VAL_CAS): Instantiate with 'unsigned short' and 'unsigned char' instead of 'short' and 'char'. * config/pa/linux-atomic.c (SUBWORD_VAL_CAS): Instantiate with 'unsigned short' and 'unsigned char' instead of 'short' and 'char'. (SUBWORD_BOOL_CAS): Likewise. (SUBWORD_SYNC_OP): Likewise. (SUBWORD_TEST_AND_SET): Likewise. (FETCH_AND_OP_WORD): Parenthesise INF_OP (SUBWORD_SYNC_OP): Likewise. (OP_AND_FETCH_WORD): Likewise. From-SVN: r163089 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5773fc3c7f93..a4662a77a4bf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2010-08-10 John David Anglin + + * config/pa/linux-atomic.c (SUBWORD_VAL_CAS): Instantiate with + 'unsigned short' and 'unsigned char' instead of 'short' and 'char'. + (SUBWORD_BOOL_CAS): Likewise. + (SUBWORD_SYNC_OP): Likewise. + (SUBWORD_TEST_AND_SET): Likewise. + (FETCH_AND_OP_WORD): Parenthesise INF_OP + (SUBWORD_SYNC_OP): Likewise. + (OP_AND_FETCH_WORD): Likewise. + 2010-08-10 Xinliang David Li * tree-ssa-loop-ivopts.c (get_address_cost): Properly diff --git a/gcc/config/pa/linux-atomic.c b/gcc/config/pa/linux-atomic.c index 38e872977527..31593c6f5d5c 100644 --- a/gcc/config/pa/linux-atomic.c +++ b/gcc/config/pa/linux-atomic.c @@ -1,5 +1,5 @@ /* Linux-specific atomic operations for PA Linux. - Copyright (C) 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. Based on code contributed by CodeSourcery for ARM EABI Linux. Modifications for PA Linux by Helge Deller @@ -92,7 +92,7 @@ __kernel_cmpxchg (int oldval, int newval, int *mem) \ do { \ tmp = *ptr; \ - failure = __kernel_cmpxchg (tmp, PFX_OP tmp INF_OP val, ptr); \ + failure = __kernel_cmpxchg (tmp, PFX_OP (tmp INF_OP val), ptr); \ } while (failure != 0); \ \ return tmp; \ @@ -124,8 +124,8 @@ FETCH_AND_OP_WORD (nand, ~, &) \ do { \ oldval = *wordptr; \ - newval = ((PFX_OP ((oldval & mask) >> shift) \ - INF_OP (unsigned int) val) << shift) & mask; \ + newval = ((PFX_OP (((oldval & mask) >> shift) \ + INF_OP (unsigned int) val)) << shift) & mask; \ newval |= oldval & ~mask; \ failure = __kernel_cmpxchg (oldval, newval, wordptr); \ } while (failure != 0); \ @@ -133,19 +133,19 @@ FETCH_AND_OP_WORD (nand, ~, &) return (RETURN & mask) >> shift; \ } -SUBWORD_SYNC_OP (add, , +, short, 2, oldval) -SUBWORD_SYNC_OP (sub, , -, short, 2, oldval) -SUBWORD_SYNC_OP (or, , |, short, 2, oldval) -SUBWORD_SYNC_OP (and, , &, short, 2, oldval) -SUBWORD_SYNC_OP (xor, , ^, short, 2, oldval) -SUBWORD_SYNC_OP (nand, ~, &, short, 2, oldval) +SUBWORD_SYNC_OP (add, , +, unsigned short, 2, oldval) +SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, oldval) +SUBWORD_SYNC_OP (or, , |, unsigned short, 2, oldval) +SUBWORD_SYNC_OP (and, , &, unsigned short, 2, oldval) +SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, oldval) +SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, oldval) -SUBWORD_SYNC_OP (add, , +, char, 1, oldval) -SUBWORD_SYNC_OP (sub, , -, char, 1, oldval) -SUBWORD_SYNC_OP (or, , |, char, 1, oldval) -SUBWORD_SYNC_OP (and, , &, char, 1, oldval) -SUBWORD_SYNC_OP (xor, , ^, char, 1, oldval) -SUBWORD_SYNC_OP (nand, ~, &, char, 1, oldval) +SUBWORD_SYNC_OP (add, , +, unsigned char, 1, oldval) +SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, oldval) +SUBWORD_SYNC_OP (or, , |, unsigned char, 1, oldval) +SUBWORD_SYNC_OP (and, , &, unsigned char, 1, oldval) +SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, oldval) +SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, oldval) #define OP_AND_FETCH_WORD(OP, PFX_OP, INF_OP) \ int HIDDEN \ @@ -155,10 +155,10 @@ SUBWORD_SYNC_OP (nand, ~, &, char, 1, oldval) \ do { \ tmp = *ptr; \ - failure = __kernel_cmpxchg (tmp, PFX_OP tmp INF_OP val, ptr); \ + failure = __kernel_cmpxchg (tmp, PFX_OP (tmp INF_OP val), ptr); \ } while (failure != 0); \ \ - return PFX_OP tmp INF_OP val; \ + return PFX_OP (tmp INF_OP val); \ } OP_AND_FETCH_WORD (add, , +) @@ -168,19 +168,19 @@ OP_AND_FETCH_WORD (and, , &) OP_AND_FETCH_WORD (xor, , ^) OP_AND_FETCH_WORD (nand, ~, &) -SUBWORD_SYNC_OP (add, , +, short, 2, newval) -SUBWORD_SYNC_OP (sub, , -, short, 2, newval) -SUBWORD_SYNC_OP (or, , |, short, 2, newval) -SUBWORD_SYNC_OP (and, , &, short, 2, newval) -SUBWORD_SYNC_OP (xor, , ^, short, 2, newval) -SUBWORD_SYNC_OP (nand, ~, &, short, 2, newval) +SUBWORD_SYNC_OP (add, , +, unsigned short, 2, newval) +SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, newval) +SUBWORD_SYNC_OP (or, , |, unsigned short, 2, newval) +SUBWORD_SYNC_OP (and, , &, unsigned short, 2, newval) +SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, newval) +SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, newval) -SUBWORD_SYNC_OP (add, , +, char, 1, newval) -SUBWORD_SYNC_OP (sub, , -, char, 1, newval) -SUBWORD_SYNC_OP (or, , |, char, 1, newval) -SUBWORD_SYNC_OP (and, , &, char, 1, newval) -SUBWORD_SYNC_OP (xor, , ^, char, 1, newval) -SUBWORD_SYNC_OP (nand, ~, &, char, 1, newval) +SUBWORD_SYNC_OP (add, , +, unsigned char, 1, newval) +SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, newval) +SUBWORD_SYNC_OP (or, , |, unsigned char, 1, newval) +SUBWORD_SYNC_OP (and, , &, unsigned char, 1, newval) +SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, newval) +SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, newval) int HIDDEN __sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval) @@ -230,8 +230,8 @@ __sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval) } \ } -SUBWORD_VAL_CAS (short, 2) -SUBWORD_VAL_CAS (char, 1) +SUBWORD_VAL_CAS (unsigned short, 2) +SUBWORD_VAL_CAS (unsigned char, 1) typedef unsigned char bool; @@ -252,8 +252,8 @@ __sync_bool_compare_and_swap_4 (int *ptr, int oldval, int newval) return (oldval == actual_oldval); \ } -SUBWORD_BOOL_CAS (short, 2) -SUBWORD_BOOL_CAS (char, 1) +SUBWORD_BOOL_CAS (unsigned short, 2) +SUBWORD_BOOL_CAS (unsigned char, 1) int HIDDEN __sync_lock_test_and_set_4 (int *ptr, int val) @@ -289,8 +289,8 @@ __sync_lock_test_and_set_4 (int *ptr, int val) return (oldval & mask) >> shift; \ } -SUBWORD_TEST_AND_SET (short, 2) -SUBWORD_TEST_AND_SET (char, 1) +SUBWORD_TEST_AND_SET (unsigned short, 2) +SUBWORD_TEST_AND_SET (unsigned char, 1) #define SYNC_LOCK_RELEASE(TYPE, WIDTH) \ void HIDDEN \