Re: compiler bugs

anton@mips.complang.tuwien.ac.at (Anton Ertl)
Wed, 06 May 2009 11:37:27 GMT

          From comp.compilers

Related articles
[19 earlier articles]
Re: compiler bugs gene.ressler@gmail.com (Gene) (2009-05-01)
Re: compiler bugs cdg@nullstone.com (Christopher Glaeser) (2009-05-04)
Re: compiler bugs anton@mips.complang.tuwien.ac.at (2009-05-05)
Re: compiler bugs gah@ugcs.caltech.edu (glen herrmannsfeldt) (2009-05-05)
Re: compiler bugs gah@ugcs.caltech.edu (glen herrmannsfeldt) (2009-05-05)
Re: compiler bugs cdg@nullstone.com (Christopher Glaeser) (2009-05-06)
Re: compiler bugs anton@mips.complang.tuwien.ac.at (2009-05-06)
Re: compiler bugs cfc@shell01.TheWorld.com (Chris F Clark) (2009-05-07)
Re: compiler bugs barry.j.kelly@gmail.com (Barry Kelly) (2009-05-10)
Re: compiler bugs anton@mips.complang.tuwien.ac.at (2009-05-10)
Re: behavior-preserving optimization in C, was compiler bugs cdg@nullstone.com (Christopher Glaeser) (2009-05-12)
Re: behavior-preserving optimization in C, was compiler bugs anton@mips.complang.tuwien.ac.at (2009-05-13)
Re: behavior-preserving optimization in C, was compiler bugs dnovillo@acm.org (Diego Novillo) (2009-05-15)
[22 later articles]
| List of all articles for this month |

From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.compilers
Date: Wed, 06 May 2009 11:37:27 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
References: 09-04-072 09-04-086 09-05-010 09-05-022 09-05-028 09-05-038
Keywords: errors, optimize
Posted-Date: 07 May 2009 07:30:29 EDT

"Christopher Glaeser" <cdg@nullstone.com> writes:
[Anton Ertl:]
>> the optimizer should preserve the behaviour of the non-optimizing
>> compiler.
>
>In a language like C, the behavior of programs that reference
>uninitialized variables can be affected by the slightest change to
>register assignments.


Not if the unoptimizing compiler initializes all variables to some
known value.


>Given that optimizations like copy propagation and common
>subexpression elimination can potentially change register
>assignments, and thus change the behavior of these programs, why
>would you include these optimizations in your list of permissible
>optimizations?


As you can see, in this case this is easy to solve. It has the nice
side effect of making even the unoptimized behaviour more stable,
which programmers also like, because it makes, e.g., debugging easier.


- anton
--
M. Anton Ertl
anton@mips.complang.tuwien.ac.at
http://www.complang.tuwien.ac.at/anton/



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.