possible gcse failure: not able to eliminate redundant loads

Toon Moene toon@moene.indiv.nluug.nl
Mon Dec 16 14:48:00 GMT 2002


Toon Moene wrote:

> Richard Henderson wrote:
> 
>> On Mon, Dec 16, 2002 at 10:04:01PM +0100, Toon Moene wrote:
>>
>>> BTW, I wasn't aware it's legal to dereference NULL C pointers.

>> It isn't, of course.  But that's the whole point.  You've
>> got code that says
>>
>>     x = (condition ? *p : 0);
>>
>> i.e. the dereference is protected by a conditional.

Oh, wait, I see what you mean:

	x = (p ? *p : 0);

Yes, that's impossible to express in Fortran (90/95/F2K), hence we don't 
have to worry about it.

[ The way to do this in Fortran is to write:

         IF (ASSOCIATED(P)) THEN
             .... USE P
         ELSE
             .... BETTER KEEP YOUR PAWS OFF ....
         ENDIF
]

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)



More information about the Gcc mailing list