Waldek Hebisch wrote:
I guess that the constant 1.0 is internally long double. In any case with the code below (which I belive is accurate translation of your functon) I got the same error from C compiler:
void R(double * r1, double *r2, long double * c) { if (*r1 != *r2) { *r1 = *r2 - *c; } }
Yes, it's a backend bug.
By mistake I sent my follow-up on this thread to Frank's private private email address, rather than to the gpc mailing list. I discovered this only much later. I apologize for this, here is the follow-up:
Frank Heckenbach wrote:
Adriaan van Os wrote:
The following produces an internal compiler error:
Perhaps GPC uses LongReal internally. Does it make a difference if you cast the constant to Real explicitly?
GPC does not allow it:
compare.pas:6: error: reference expected, value given
Oh, yeah. I changed this recently, how should I know? ;-)
Anyway, if you can reproduce the problem in C code (possibly using `long double' variables or a constant casted to `long double'), then it's surely a backend bug.
It is a backend bug and I have reported it to bugzilla as http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11848.
OK, thanks.
Frank
The bug was confirmed on the bugzilla list by Andrew Pinski.
Regards,
Adriaan van Os