[Bug c++/83710] Unsigned with Signed multiplication followed by right shift

2018-01-06 Thread chanpreet.singh at nxp dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83710 --- Comment #8 from Chanpreet Singh --- (In reply to Jakub Jelinek from comment #7) > You shouldn't read random blogs, but the standard of the language you are > writing in. > E.g. in n3797.pdf it is in [expr]/10: > "Otherwise, the integral promo

[Bug c++/83710] Unsigned with Signed multiplication followed by right shift

2018-01-06 Thread chanpreet.singh at nxp dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83710 --- Comment #6 from Chanpreet Singh --- (In reply to Andrew Pinski from comment #5) > (In reply to Chanpreet Singh from comment #4) > > (In reply to Andrew Pinski from comment #3) > > > For imull discussion see > > > https://stackoverflow.com/que

[Bug c++/83710] Unsigned with Signed multiplication followed by right shift

2018-01-06 Thread chanpreet.singh at nxp dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83710 --- Comment #4 from Chanpreet Singh --- (In reply to Andrew Pinski from comment #3) > For imull discussion see > https://stackoverflow.com/questions/42587607/why-is-imul-used-for- > multiplying-unsigned-numbers . I understand that. However, can

[Bug c++/83710] Unsigned with Signed multiplication followed by right shift

2018-01-06 Thread chanpreet.singh at nxp dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83710 --- Comment #2 from Chanpreet Singh --- Can you please clarify a bit? In the above code, there are 3 vairable, c(int), b(unsigned int) & a(int). The type of 'a*b' is expected to be (int) [same as type of 'c', as also 'imull' instruction is used].

[Bug c++/83710] New: Unsigned with Signed multiplication followed by right shift

2018-01-05 Thread chanpreet.singh at nxp dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: chanpreet.singh at nxp dot com Target Milestone: --- Hello, For a multiplication between signed and unsigned, I expect the 'sign' of the result to be same as 'sign' of th