I agree w/@RichFelker GCC isn't doing wrong: it assumes malloc can only return 0 for this input, so the program always runs into UB
Aside from SIZE_MAX/2 there are all sorts of other reasons it might have to fail, like rlimits.
-
-
Right, that was my next question:-) You are saying that no malloc could be optimized away bc it changes mem footprint?
-
What about stack? Suppose I have a tail recursion which (unoptimized) overflows the stack. Can it be optimized?
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.