This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
bug in cygwin-gcc 2.95.3-1 (compiled with -mno-cygwin)?
- To: <gcc at gcc dot gnu dot org>
- Subject: bug in cygwin-gcc 2.95.3-1 (compiled with -mno-cygwin)?
- From: "Michael Scheibler" <michael dot scheibler at onevision dot de>
- Date: Wed, 23 May 2001 13:53:13 +0200
- Organization: OneVision Software AG
{
int end = i-1;
BOOL check_it = YES;
int first_position = (int)[(OVCSSHTMLTRCharacter *)[characters
objectAtIndex:i-2] location].y;
int second_position = (int)[(OVCSSHTMLTRCharacter *)[characters
objectAtIndex:i-1] location].y;
int third_position = (int)[(OVCSSHTMLTRCharacter *)[characters
objectAtIndex:i] location].y;
// ATTENTION:
// The following if statement causes a compilerproblem for an optimized
release version
// if(abs(abs(second_position - first_position) - abs(third_position -
second_position)) <= 2)
//
// ErrorMessage:
// OVTextBoundingLines.m:333: Unable to generate reloads for:
// (insn 1129 1127 1981 (parallel[
// (set (reg/v:SI 1 %edx)
// (fix:SI (fix:SF (subreg:SF (reg:DI 0 %eax) 1))))
// (clobber (mem:HI (plus:SI (reg:SI 6 %ebp)
// (const_int -2 [0xfffffffe])) 0))
// (clobber (mem:HI (plus:SI (reg:SI 6 %ebp)
// (const_int -4 [0xfffffffc])) 0))
// (clobber (mem:SI (plus:SI (reg:SI 6 %ebp)
// (const_int -8 [0xfffffff8])) 0))
// (clobber (scratch:HI))
// ] ) 145 {fix_truncsfsi2+1} (insn_list 1127 (nil))
// (expr_list:REG_DEAD (reg:DI 0 %eax)
// (expr_list:REG_UNUSED (scratch:HI)
// (nil))))
//
// To solve the problem I had to replace the abs(...), which was th first in
the if-statement
// by something else. Storing every semi-result in an own variable and using
at last an
// variable: int aResult=abs(res3) for the following if statement:
// if (aResult<=2) {...}
// does unfortunatelly not solve the problem. (Seems to be a bug in gcc!!!!)
// So I had to use that if statement: if (res3<=2 || res3>=-2)
// without any abs() within.
//
// Chr. Schmidt
// Begin workaround variables
int res1=second_position - first_position;
int res2=third_position - second_position;
int abs1=abs(res1);
int abs2=abs(res2);
int res3=abs1-abs2;
// End workaround variables
if (res3<=2 || res3>=-2)
{
if(i < ([characters count]-1))
{
check_it = NO;
i++;
}
else
end = i;
}
}