This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] C undefined behavior fix


On Jan  6, 2002, Tom Rini <trini@kernel.crashing.org> wrote:

> On Sun, Jan 06, 2002 at 11:19:40PM +0100, Jakub Jelinek wrote:
>> On Mon, Jan 07, 2002 at 08:59:47AM +1100, Paul Mackerras wrote:

>> > 	asm("" : "=r" (x) : "0" (y));

>> Even if gcc learned to analyze asm statements (and use it in something other
>> than scheduling), I'm sure this wouldn't be optimized away exactly because
>> this construct is used by various projects exactly for this purpose (make
>> gcc think it can have any value allowed for the type in question).

> Yes, but there's no gaurentee of that.  It'd probably break a few things
> if they did, but there's nothing stopping them from doing it.

If we documented this side effect of such asm statements, one would
have to come up with a very strong case to change it.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]