public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug translation/95563] New: High memory usage and possible infinite loop
@ 2020-06-06 14:00 madhur4127 at gmail dot com
  2020-06-06 14:04 ` [Bug translation/95563] " madhur4127 at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: madhur4127 at gmail dot com @ 2020-06-06 14:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95563
           Summary: High memory usage and possible infinite loop
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: translation
          Assignee: unassigned at gcc dot gnu.org
          Reporter: madhur4127 at gmail dot com
  Target Milestone: ---

Created attachment 48693
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48693&action=edit
Original code

Attached simplified.cc, which aims to be a complete example. For the original
code please see [1] (at bottom).

simplified.cc aims to be minimal in nature. But please verify the issue with
the original code.

Logic: Computing a binomial coefficient over a few iterations using a Modular<>
struct which is a wrapper over integer supporting modular arithmetic.
Combinatorics struct contains two arrays of "Modular" integers, one for
factorials and other for inverse factorials (modular multiplicative inverse of
the corresponding factorial).

On Linux, compilation took over 3.3GB of memory and 100% CPU utilization for
over 30 minutes, and thereafter I had to kill it. This hints for an infinite
loop.

command: g++ simplified.cc -o simplified
GCC version: Default GCC package (gcc 10.1.0-2) of Arch Linux
Target: x86_64-pc-linux-gnu

If the issue is simple to fix, then I would like to fix it for GCC (some
pointers would be appreciated as I have no experience in developing compilers).

References:
1. Original Code:
https://gist.github.com/madhur4127/4eb29246463ed5a0538e1d9c8a2a7192

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

* [Bug translation/95563] High memory usage and possible infinite loop
  2020-06-06 14:00 [Bug translation/95563] New: High memory usage and possible infinite loop madhur4127 at gmail dot com
@ 2020-06-06 14:04 ` madhur4127 at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: madhur4127 at gmail dot com @ 2020-06-06 14:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Madhur Chauhan <madhur4127 at gmail dot com> ---
(In reply to Madhur Chauhan from comment #0)
> Created attachment 48693 [details]
> Original code

My bad, this is the simplified version of the code but its name is misleading.
The original code is in the URL at the bottom.

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

end of thread, other threads:[~2020-06-06 14:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-06 14:00 [Bug translation/95563] New: High memory usage and possible infinite loop madhur4127 at gmail dot com
2020-06-06 14:04 ` [Bug translation/95563] " madhur4127 at gmail dot com

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).