Re: behavior-preserving optimization in C, was compiler bugs

anton@mips.complang.tuwien.ac.at (Anton Ertl)
Thu, 21 May 2009 18:17:58 GMT

          From comp.compilers

Related articles
[17 earlier articles]
Re: behavior-preserving optimization in C, was compiler bugs torbenm@pc-003.diku.dk (2009-05-19)
Re: behavior-preserving optimization in C, was compiler bugs gneuner2@comcast.net (George Neuner) (2009-05-19)
Re: behavior-preserving optimization in C, was compiler bugs bobduff@shell01.TheWorld.com (Robert A Duff) (2009-05-19)
Re: behavior-preserving optimization in C, was compiler bugs bobduff@shell01.TheWorld.com (Robert A Duff) (2009-05-19)
Re: behavior-preserving optimization in C, was compiler bugs anton@mips.complang.tuwien.ac.at (2009-05-21)
Re: behavior-preserving optimization in C, was compiler bugs anton@mips.complang.tuwien.ac.at (2009-05-21)
Re: behavior-preserving optimization in C, was compiler bugs anton@mips.complang.tuwien.ac.at (2009-05-21)
Re: behavior-preserving optimization in C, was compiler bugs anton@mips.complang.tuwien.ac.at (2009-05-21)
Re: behavior-preserving optimization in C, was compiler bugs bear@sonic.net (Ray) (2009-05-21)
Re: behavior-preserving optimization in C, was compiler bugs Jan.Vorbrueggen@thomson.net (=?ISO-8859-15?Q?Jan_Vorbr=FCggen?=) (2009-05-22)
Re: behavior-preserving optimization in C, was compiler bugs gneuner2@comcast.net (George Neuner) (2009-05-24)
Re: behavior-preserving optimization in C, was compiler bugs DrDiettrich1@aol.com (Hans-Peter Diettrich) (2009-05-25)
Re: behavior-preserving optimization in C, was compiler bugs anton@mips.complang.tuwien.ac.at (2009-05-25)
[4 later articles]
| List of all articles for this month |
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.compilers
Date: Thu, 21 May 2009 18:17:58 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 09-05-039 09-05-050 09-05-055 09-05-065 09-05-069 09-05-090
Keywords: optimize, debug
Posted-Date: 21 May 2009 20:15:24 EDT

Robert A Duff <bobduff@shell01.TheWorld.com> writes:
>anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>
>> "Christopher Glaeser" <cdg@nullstone.com> writes:
>>>Even a simple bug fix to a new release in a compiler
>>>can affect the behavior of C programs that have undefined behavior.
>>
>> Different releases are a different issue than turning optimization on,
>> although changing behaviour between releases is not desirable, either.
>
>What about portability to a completely different compiler on a
>completely different machine? Do you expect your program to behave
>the same?


No. Porting can uncover portability bugs. But turning on an
optimizer is different from porting a program. Many programmers avoid
porting programs to a different compiler or platform, or incur a large
amount of extra effort when they do. Do you think that they should
treat optimization the same way? Then they will avoid the optimizer
just like they avoid porting. Then the optimizer will just be a
benchmarketing exercise.


>I think you're attacking the wrong folks, here. If optimizers can
>affect the behavior of programs, that's primarily the fault of the
>language designer, not the compiler writer.


The language specifiers [1] do not force optimizers to break working
(albeit non-standard) programs; if the optimizer does that, the
optimizer writer is to blame, nobody else.


Yes, stronger language specifications are a good idea, because they
make porting easier. But that has little to do with optimization.


[1] Whether the specification comes from a designer or design group,
or as the result of a standardization effort.


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