This is probably an egcs 2.91.66 introduced compiler optimization bug,
wtenhave@sybase.com
wtenhave@sybase.com
Thu Jan 6 12:36:00 GMT 2000
On 6 Jan, Horst von Brand wrote:
> wtenhave@sybase.com said:
>
> [...]
>
>> #define CHK_A (long)0x40000000
>> #define CHK_B (long)0x80000000
>>
>> main ()
>> {
>> long rdata = CHK_B;
>>
>> if ((rdata & CHK_A) ||
>> !(rdata & CHK_B))
>> {
>> printf ("BAD NEWS\n");
>> } else
>> {
>> printf ("GOOD NEWS\n");
>> }
>> }
>
> The reported bug is present on sparc-linux (Red Hat 6.1, egcs-1.1.2-24)
> too; egcs-20000103 doesn't have it. Also, on SPARC Solaris 2.6 gcc-2.95.2
> doesn't show the problem, so it apperas fixed.
As does alpha-linux (Red Hat 6.1, egcs-1.1.2-24). You have to change the
declarations to 'int' or define CHK_B for 0x8000000000000000 here of course.
--
-- Wim ten Have. AUDIX: 245 2981
Phone: (+31) 346 582981, Fax: Euro (+31) 346 552884, Room (+31) 346 558415
More information about the Gcc-bugs
mailing list