[tree-ssa] dead const/pure/alloca call removal

Gabriel Dos Reis gdr@integrable-solutions.net
Sun Nov 9 19:45:00 GMT 2003


Andreas Schwab <schwab@suse.de> writes:

| Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
| 
| > Daniel Jacobowitz <drow@mvista.com> writes:
| >
| > [...]
| >
| > | The implementation provides malloc; GCC is merely a part of the
| > | implementation.  We already assume a conforming library for many
| > | optimizations; glibc doesn't provide strlen either.
| >
| > Sure, but isn't a tracing malloc a conforming implementation?
| 
| This is outside the scope of the standard.

Why ?

| There are no provisions in the  standard to trace malloc calls
| except by wrapping them. 

Chapter and verse?

As far as I can see from the standard, it only mentions that malloc
allocates storage, with no details of how that allocation is done.
In particular, tracing allocation is not ruled out.

| > | I disagree that the C standard's definition is too weak to allow
| > | eliding of calls, as-if.  What problems do you see?
| >
| > The as-fi would apply *if* GCC is the malloc implementation provider.
| > Currently , it is not,
| 
| There is no way for a strictly conforming program to notice the elision.

How many useful programs are strictly conforming?

And it the thing that is of interest is to provide a compiler for
strictly conforming programs, then "cp /bin/sh gcc" is a far cheaper
answer. 

| All others must resort to extensions and/or implementation details.

Yes.  But "strict conformance" is not all about it.

-- Gaby



More information about the Gcc-patches mailing list