This is the mail archive of the gcc-bugs@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]

[Bug tree-optimization/58570] [4.9 Regression] wrong code for bitfields at -O2 and above


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58570

--- Comment #6 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(In reply to Eric Botcazou from comment #5)
> I think we just want to copy the following from
> nonoverlapping_component_refs_p:
> 
>       /* If we're left with accessing different fields of a structure, then
> no
> 	 possible overlap, unless they are both bitfields.  */
>       if (TREE_CODE (typex) == RECORD_TYPE && fieldx != fieldy)
> 	return !(DECL_BIT_FIELD (fieldx) && DECL_BIT_FIELD (fieldy));
> 
> over to nonoverlapping_component_refs_of_decl_p.

Yes.
Just one idea:

What if both bit fields have different DECL_BIT_FIELD_REPRESENTATIVE?

Then they can't possibly overlap?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]