public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110731] New: [11/12/13/14 Regression] Wrong-code because of wide-int division since r5-424
@ 2023-07-19  7:18 jakub at gcc dot gnu.org
  2023-07-19  7:19 ` [Bug tree-optimization/110731] " jakub at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-07-19  7:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110731
           Summary: [11/12/13/14 Regression] Wrong-code because of
                    wide-int division since r5-424
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

Since r5-424-g807e902eea17f313 (merge of wide-int) we miscompile following
testcase
(noticed it first with _BitInt(119)):

__int128
foo (void)
{
  struct S { __int128 f : 119; } s = { ((__int128) -18014398509481984) << 64 };
  return s.f / 2;
}

int
main ()
{
  if (foo () != (((__int128) -9007199254740992) << 64))
    __builtin_abort ();
}

The result of dividing (-332306998946228968225951765070086143wb - 1) by 2 is
-166153499473114484112975882535043072wb but we return
166153499473114484112975882535043072wb instead (in hex that is
0, 0xffc0000000000000 signed 119 pair divided by 2 resulting in
0, 0x0020000000000000 signed 119 pair rather than
0, 0xffe0000000000000.

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

end of thread, other threads:[~2024-06-12 11:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-19  7:18 [Bug tree-optimization/110731] New: [11/12/13/14 Regression] Wrong-code because of wide-int division since r5-424 jakub at gcc dot gnu.org
2023-07-19  7:19 ` [Bug tree-optimization/110731] " jakub at gcc dot gnu.org
2023-07-19  7:39 ` pinskia at gcc dot gnu.org
2023-07-19  7:56 ` jakub at gcc dot gnu.org
2023-07-19 11:50 ` cvs-commit at gcc dot gnu.org
2023-07-19 12:24 ` cvs-commit at gcc dot gnu.org
2023-07-19 17:56 ` [Bug tree-optimization/110731] [11/12 " jakub at gcc dot gnu.org
2023-12-16  0:37 ` cvs-commit at gcc dot gnu.org
2023-12-17 13:55 ` cvs-commit at gcc dot gnu.org
2024-06-12 11:58 ` rguenth 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).