https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30617

--- Comment #39 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #29)
> > It is hanging on undefined, I think there is a difference here, a big
> > difference.
> 
> What is the difference for you?
> 
> Just as a side note, that's not me who classed the PR as invalid and so far
> I did not see a class "ICE on undefined".

Just because you've mentioned this PR:
There is a significant difference.  ICE on invalid is something clearly
undesirable, because it is the compiler that is crashing, and compiler should
not have undefined behavior on whatever garbage you throw at it.
If you compile code with undefined behavior in it, run it and that code
crashes, hangs or formats your disk, that is a bug in the code you are running,
not in the compiler.  Anything can happen when you invoke undefined behavior.
And anything includes hanging, segfault, formatting your disk etc.
E.g. if you invoke undefined behavior in some loop, gcc will often optimize
away loop bound checks in that case (on the assumption that in valid code, the
loop e.g. could be invoked only certain number of iterations and not more). 
So, you may very well get a hang in that case too.

Reply via email to