[Info-vax] yet another sys$qiow question
Simon Clubley
clubley at remove_me.eisner.decus.org-Earth.UFP
Wed Aug 19 14:10:53 EDT 2015
On 2015-08-19, John Reagan <xyzzy1959 at gmail.com> wrote:
> On Wednesday, August 19, 2015 at 9:19:16 AM UTC-4, Simon Clubley wrote:
>
>> It depends on what the optimiser does with an empty loop on a
>> non-volatile variable and whether it just removes that loop completely.
>>
>> Although I don't write empty loops for non-volatile variables, gcc can
>> (silently) optimise out other chunks of code that it thinks will never
>> be reached or is otherwise redundant so I would have to consider the
>> possibility that LLVM will do the same as well and that in some
>> circumstances it might do it with empty non-volatile while loops as well.
>>
>
> Anytime you change code generators/optimizers, you run the risk of
> shaking loose broken programs. We saw lots of invalid programs from
> VAX that got wobbly on Alpha. We even saw it with various
> improvements we made to GEM over the years. Invalid programs have
> undefined behavior. You might like the current undefined behavior for
> years, but it is still undefined. Like uninitialized variables that
> appeared to be zero or false depending on some sequence of code that
> executed prior to you (ie, things the image activator may have left on
> the stack).
>
And sometimes you may even ask if you need to change the language itself
as a result of things you come across in the code generator. :-)
There's a current issue with gcc ARM where registers that can only be
updated with 16/32 accesses are sometimes updated using LDRB/STRB
8-bit opcodes instead. This happens when you try using bitfields
instead of bitmasks to update the registers.
I have an Ada Issue opened on issues related to this area if you want
something to put you to sleep: :-)
http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0128-1.txt?rev=1.5
There's also some additional related material in another AI as well:
http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0127-1.txt?rev=1.1
Code generators and optimisers are such fun. :-) or :-( depending on
whether you've just discovered "your" logic error is actually a code
generation issue.
Simon.
--
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world
More information about the Info-vax
mailing list