diff --git a/Expression.pas b/Expression.pas index f825ec5..eb816bd 100644 --- a/Expression.pas +++ b/Expression.pas @@ -3314,8 +3314,10 @@ var else Gen2t(pc_ind, ord(tqVolatile in expressionType^.qualifiers), 0, tp); if pc_l in [pc_lli,pc_lld] then - if expressionType^.cType in [ctBool,ctFloat,ctDouble,ctLongDouble, - ctComp] then begin + if (expressionType^.kind = scalarType) and + (expressionType^.cType in + [ctBool,ctFloat,ctDouble,ctLongDouble,ctComp]) + then begin t1 := GetTemp(ord(expressionType^.size)); Gen2t(pc_cop, t1, 0, expressionType^.baseType); end; {if} @@ -3326,8 +3328,10 @@ var Gen0t(pc_cpi, tp); Gen0t(pc_bno, tp); if pc_l in [pc_lli,pc_lld] then {correct the value for postfix ops} - if expressionType^.cType in [ctBool,ctFloat,ctDouble,ctLongDouble, - ctComp] then begin + if (expressionType^.kind = scalarType) and + (expressionType^.cType in + [ctBool,ctFloat,ctDouble,ctLongDouble,ctComp]) + then begin Gen0t(pc_pop, expressionType^.baseType); Gen2t(pc_lod, t1, 0, expressionType^.baseType); Gen0t(pc_bno, expressionType^.baseType); diff --git a/cc.notes b/cc.notes index 0e0de79..d45dbe4 100644 --- a/cc.notes +++ b/cc.notes @@ -1598,6 +1598,8 @@ If you use #pragma debug 0x0010 to enable stack check debug code, the compiler w 4. A compile error is no longer reported for code that divides an integer constant by zero (e.g. 1/0). Such code will produce undefined behavior if it is executed, but since the compiler cannot always determine whether the code will be executed at run time, this is no longer treated as an error that prevents compilation. If #pragma lint bit 5 is set, a lint message about the division by zero will still be produced. An error will also still be reported for division by zero in constant expressions that need to be evaluated at compile time. +5. In some obscure circumstances, ORCA/C might behave incorrectly when the postfix ++ or -- operators were used on an expression of pointer type. This would typically result in "compiler error" messages, but could potentially also cause incorrect code to be generated without any errors being reported. + -- Bugs from C 2.1.1 B3 that have been fixed in C 2.2.0 --------------------- 1. There were various bugs that could cause incorrect code to be generated in certain cases. Some of these were specific to certain optimization passes, alone or in combination.