This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On 07/18/2011 08:02 AM, Aldy Hernandez wrote:+ /* If other threads can't see this value, no need to restrict stores. */ + if (ALLOW_STORE_DATA_RACES + || !DECL_THREAD_VISIBLE_P (innerdecl)) + { + *bitstart = *bitend = 0; + return; + }
What if get_inner_reference returns something that isn't a DECL, such as an INDIRECT_REF?
+ /* If other threads can't see this value, no need to restrict stores. */ + if (ALLOW_STORE_DATA_RACES + || (!ptr_deref_may_alias_global_p (innerdecl) + && (DECL_THREAD_LOCAL_P (innerdecl) + || !TREE_STATIC (innerdecl))))
+ if (fld) + { + /* We found the end of the bit field sequence. Include the + padding up to the next field and be done. */ + *bitend = bitpos - 1; + }
bitpos is the position of "field", and it seems to me we want the position of "fld" here.
+ /* If unset, no restriction. */ + if (!bitregion_end) + maxbits = 0; + else + maxbits = (bitregion_end - bitregion_start) % align;
Maybe use MAX_FIXED_MODE_SIZE so you don't have to test it against 0?
+ if (!bitregion_end) + maxbits = 0; + else if (1||bitpos + offset * BITS_PER_UNIT < bitregion_start) + maxbits = bitregion_end - bitregion_start; + else + maxbits = bitregion_end - (bitpos + offset * BITS_PER_UNIT) + 1;
I assume the 1|| was there for debugging?
Attachment:
curr
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |