This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: don't assume pointer cast to unsigned long is a valid initializer
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: Mark Mitchell <mark at codesourcery dot com>, rth at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: 01 Mar 2003 05:52:17 -0300
- Subject: Re: don't assume pointer cast to unsigned long is a valid initializer
- Organization: GCC Team, Red Hat
- References: <orznogn7qt.fsf@free.redhat.lsd.ic.unicamp.br><jmk7fkvyu5.fsf@desire.geoffk.org><1046482583.4831.206.camel@doubledemon.codesourcery.com><jmfzq7x2xo.fsf@desire.geoffk.org>
On Feb 28, 2003, Geoff Keating <geoffk at geoffk dot org> wrote:
> The most fundamental reason is that Alexandre's patch changes this testcase.
> Changing testcases without changing their name is strongly discouraged.
I disagree with your reasoning. You're basically saying automated
regression testers are more important than the time of the
developers and than tracking the history of fixes in a testcase that
was previously broken.
> Other reasons are that Alexandre's patch makes the testcase an exact
> duplicate of 20011114-1.c; and that we've had almost this exact patch
> proposed before, committed, and reverted by me for the first reason above.
Your reason is also incompatible with:
> + <p>If a testcase itself is incorrect, but there's a possibility that an
> + improved testcase might fail on some platform where the incorrect
> + testcase passed,
This is not the case of the change I made. For one, because
__SIZE_TYPE__ is unsigned long or something of the same mode on most
platforms, and the test would pass. On those in which it is not, it
would have failed, and there is no possible fix except by giving the
compiler knowledge about the existence of wider (or narrower)
relocations in the assembler and about policies on sign- or
zero-extending pointers by the linker and the dynamic linker when
applying such relocations. I don't think the compiler has any
business worrying about this.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva at {redhat dot com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva at {lsd dot ic dot unicamp dot br, gnu.org}
Free Software Evangelist Professional serial bug killer