]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Handle target specific memory models in C frontend
authorAndi Kleen <ak@linux.intel.com>
Fri, 9 Nov 2012 15:24:25 +0000 (15:24 +0000)
committerAndi Kleen <ak@gcc.gnu.org>
Fri, 9 Nov 2012 15:24:25 +0000 (15:24 +0000)
get_atomic_generic_size would error out for
__atomic_store(...,__ATOMIC_HLE_RELEASE)

Just mask it out. All the memory orders are checked completely
in builtins.c anyways.

I'm not sure what that check is for, it could be removed in theory.

Passed bootstrap and test suite on x86-64

gcc/c-family/:
2012-11-09  Andi Kleen  <ak@linux.intel.com>

PR 55139
* c-common.c (get_atomic_generic_size): Mask with
        MEMMODEL_MASK

From-SVN: r193363

gcc/c-family/ChangeLog
gcc/c-family/c-common.c

index 937fd6d1e2860994ac7a28c13feb6b1c1f486c05..20ef315ea7443c60609dcc5114b96bb5ddf3b4df 100644 (file)
@@ -1,3 +1,9 @@
+2012-11-09  Andi Kleen  <ak@linux.intel.com>
+
+       PR 55139
+       * c-common.c (get_atomic_generic_size): Mask with
+        MEMMODEL_MASK
+
 2012-11-07  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
        PR c/53063
index c3a646534710934be2322eb87aff36c50b09166f..7828d210507620bcce5eaf357c7ac364061531cb 100644 (file)
@@ -10097,7 +10097,7 @@ get_atomic_generic_size (location_t loc, tree function, VEC(tree,gc) *params)
       if (TREE_CODE (p) == INTEGER_CST)
         {
          int i = tree_low_cst (p, 1);
-         if (i < 0 || i >= MEMMODEL_LAST)
+         if (i < 0 || (i & MEMMODEL_MASK) >= MEMMODEL_LAST)
            {
              warning_at (loc, OPT_Winvalid_memory_model,
                          "invalid memory model argument %d of %qE", x + 1,