http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47784
Summary: Internal compiler error in dot notation assignment of const value Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: objc AssignedTo: unassig...@gcc.gnu.org ReportedBy: c...@objc.net Using the new Objective-C 2.0 dot notation syntax, assigning a property with a 'const' value causes an internal compiler error, this is with gcc 4.6.0 SVN trunk r170061. Built for arm-linux-eabi on OS X 10.6. It doesn't appear to be anything particular to arm though. This is a reduced example which triggers the bug, usage of 'const' is the trigger: typedef struct { float x; } SomeType; @interface SomeClass @property(assign,readwrite) SomeType position; @end @implementation SomeClass -(void)example { // Error only happens when const is used const SomeType SomeTypeZero = {0.0f}; self.position= SomeTypeZero; } @end This is the compiler error: main.m: In function '-[SomeClass example]': main.m:19:4: error: assignment of read-only variable '__objc_property_temp' main.m:19:4: internal compiler error: tree check: expected class 'expression', have 'exceptional' (error_mark) in objc_maybe_build_modify_expr, at objc/objc-act.c:1976 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. It appears a temporary variable is given the same type as the right hand side and it's all downhill from there. I don't have a fix for this.