Re: compiler bugs

"Christopher Glaeser" <cdg@nullstone.com>
Wed, 6 May 2009 00:28:10 -0700

          From comp.compilers

Related articles
[18 earlier articles]
Re: compiler bugs anton@mips.complang.tuwien.ac.at (2009-05-01)
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)
[23 later articles]
| List of all articles for this month |
From: "Christopher Glaeser" <cdg@nullstone.com>
Newsgroups: comp.compilers
Date: Wed, 6 May 2009 00:28:10 -0700
Organization: Compilers Central
References: 09-04-072 09-04-086 09-05-010 09-05-022 09-05-028
Keywords: errors, optimize
Posted-Date: 06 May 2009 05:59:44 EDT

> Anyway, to give some examples: many forms of constant folding, copy
> propagation and common subexpression elimination; but typically a
> particular optimization can be performed in a behaviour-preserving
> way or in a program-breaking way.


Apparently I don't fully understand your postion. Your previously stated
contraint on the optimizer, including and especially for programs with
undefined behavior, was ...


> 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. 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?


Best,
Christopher



Post a followup to this message

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