This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Some wide-int review comments


On Tue, 12 Nov 2013, Kenneth Zadeck wrote:

> Richi,
> 
> i am having a little trouble putting this back the way that you want.   The
> issue is rem.
> what is supposed to happen for INT_MIN % -1?
> 
> I would assume because i am failing the last case of gcc.dg/c90-const-expr-8.c
> that INT_MIN %-1 should not overflow even if INT_MIN / -1 does.   however,

Given the conclusion in C11 that a%b should be considered undefined if a/b 
is not representable, I think it's reasonable to say INT_MIN % -1 *should* 
be considered to overflow (for all C standard versions) (and bug 30484 is 
only a bug for -fwrapv).

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]