------- Comment #2 from joseph at codesourcery dot com  2009-11-09 13:16 -------
Subject: Re:  ICE on invalid dereferencing of void *

On Mon, 9 Nov 2009, rguenth at gcc dot gnu dot org wrote:

> the C standard doesn't claim dereferencing a void pointer is invalid, so
> the gimplifier should deal with this.

It's not invalid in general, but if the value gets used (NB conditional 
expressions involving such dereferences, whose values don't get used, are 
OK; DR 106) then it is invalid and there should be an error; "void value 
not ignored as it ought to be" is used in some places.  Though I note that 
if you change the dereference in the present testcase to use the return 
value of a function returning void, the resulting error "using result of 
function returning 'void'" comes from the gimplifier and not the front 
end, so making the gimplifier deal with this case as well would at least 
be consistent.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41992

Reply via email to