[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: arm gcc 4.1.3 -O2 dead code removal breaks configure test
From: |
Dave Hart |
Subject: |
Re: arm gcc 4.1.3 -O2 dead code removal breaks configure test |
Date: |
Wed, 30 Mar 2011 06:32:45 +0000 |
On Wed, Mar 30, 2011 at 00:01 UTC, Andrew W. Nosenko wrote:
> IMHO, better would to be just disable a compiler to do optimization
> dances around 'in6' variable (i.e. mark 'in6' as 'volatile'):
>
> volatile struct in6_addr in6;
> in6 = in6addr_any;
Thanks, Andrew, for helping out.
While I expect your suggestion would work, I am uncomfortable relying
on it. I don't know of a freely-available, reliable ANSI C/ISO C
reference to check exactly what the standard says about optimizing
away volatile stack variables assignments, I decided it was safer to
assume the compiler wouldn't optimize away a printf parameter.
Take care,
Dave Hart