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

--- Comment #17 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to jos...@codesourcery.com from comment #15)
> Only if the undefined behavior is a property of the program, or of all 
> possible executions of the program, as opposed to a property of a 
> particular execution of the program.  See C90 DR#109.  "A conforming 
> implementation must not fail to translate a strictly conforming program 
> simply because *some* possible execution of that program would result in 
> undefined behavior.".

Yeah, good point.

But we do not have a complete program here at all, so this doesn't
say much.  If this was a complete program likely *every* execution
of it would be UB; but of course it is also possible to make one
where no execution has UB.

Since the main routine in this snippet unconditionally has undefined
behaviour, there is no way I can call this valid code.


Anyway, the attached patch fixes the problem in this testcase.  Not
sure yet it is actually correct ;-)

Reply via email to