public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/64182] New: [5 Regression] wide-int rounding division is broken
Date: Thu, 04 Dec 2014 12:30:00 -0000	[thread overview]
Message-ID: <bug-64182-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 64182
           Summary: [5 Regression] wide-int rounding division is broken
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
                CC: rsandifo at gcc dot gnu.org

Testcase for gnat.dg/round_div.adb

-- { dg-do run }
-- { dg-options "-O3" }
procedure Round_Div is
   type Fixed is delta 1.0 range -2147483648.0 .. 2147483647.0;
   A : Fixed := 1.0;
   B : Fixed := 3.0;
   C : Integer;
   function Divide (X, Y : Fixed) return Integer is
   begin
      return Integer (X / Y);
   end;
begin
   C := Divide (A, B);
   if C /= 0 then
      raise Program_Error;
   end if;
end Round_Div;

Joseph pointed out round_mod_expr has the same issue.


             reply	other threads:[~2014-12-04 12:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04 12:30 rguenth at gcc dot gnu.org [this message]
2014-12-04 12:31 ` [Bug middle-end/64182] " rguenth at gcc dot gnu.org
2014-12-08 19:10 ` jakub at gcc dot gnu.org
2014-12-09  9:00 ` jakub at gcc dot gnu.org
2014-12-10 14:51 ` rsandifo at gcc dot gnu.org
2014-12-10 14:52 ` rsandifo at gcc dot gnu.org
2014-12-10 15:27 ` jakub at gcc dot gnu.org
2014-12-12  0:59 ` zadeck at naturalbridge dot com
2014-12-12  7:53 ` rsandifo at gcc dot gnu.org
2014-12-17 12:39 ` mpolacek at gcc dot gnu.org
2015-01-05 10:13 ` [Bug middle-end/64182] " jakub at gcc dot gnu.org
2015-04-22 11:58 ` jakub at gcc dot gnu.org
2015-07-16  9:13 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-64182-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).