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

--- Comment #8 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to jos...@codesourcery.com from comment #5)
> Both 32-bit and 64-bit ABIs make the values of flags in EFLAGS (other than 
> DF) undefined on function entry and return.  Thus, a function can never 
> assume anything about the value of OF unless it has executed an 
> instruction known to set/clear it and has not called any other functions 
> since then.

In the testcase, there is nothing that violates ABI. It all happens in "g" that
passes calculated result to a function. Selected function depends on flags,
calculated from the subtraction, and wrong function gets selected when overflow
happens.

Reply via email to