public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/67953] New: [6 Regression] match.pd: X - (X / Y) * Y wrong on change of sign
@ 2015-10-13 12:25 glisse at gcc dot gnu.org
  2015-10-13 12:34 ` [Bug tree-optimization/67953] " mpolacek at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: glisse at gcc dot gnu.org @ 2015-10-13 12:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67953
           Summary: [6 Regression] match.pd: X - (X / Y) * Y wrong on
                    change of sign
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org
                CC: mpolacek at gcc dot gnu.org
  Target Milestone: ---

$ cat z.c
#include <stdio.h>
unsigned f(signed a){
  return (unsigned)a-((a/3)*3);
}
unsigned g(signed a){
  return a-((a/3)*3);
}
int main(){
  printf("%d %d\n", f(-5), g(-5));
}
$ gcc-5 z.c && ./a.out
-2 -2
$ clang z.c && ./a.out       
-2 -2
$ gcc-snapshot z.c && ./a.out 
2 -2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-15  9:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-13 12:25 [Bug tree-optimization/67953] New: [6 Regression] match.pd: X - (X / Y) * Y wrong on change of sign glisse at gcc dot gnu.org
2015-10-13 12:34 ` [Bug tree-optimization/67953] " mpolacek at gcc dot gnu.org
2015-10-13 16:51 ` mpolacek at gcc dot gnu.org
2015-10-15  9:40 ` mpolacek at gcc dot gnu.org
2015-10-15  9:40 ` mpolacek at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).