[Bug gcov-profile/66209] New: Out of memory when compiling with --coverage and optimizations

wellnhofer at aevum dot de gcc-bugzilla@gcc.gnu.org
Tue May 19 18:22:00 GMT 2015


            Bug ID: 66209
           Summary: Out of memory when compiling with --coverage and
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wellnhofer at aevum dot de
  Target Milestone: ---

Created attachment 35570
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35570&action=edit
Problematic source file

Compiling the attached file `scanners.c` with --coverage and -O1 or -O2 results

    $ gcc -O1 --coverage -c scanners.c

    cc1: out of memory allocating 4064 bytes after a total of 2528780288 bytes

I'm using gcc 4.9.1 shipped with Ubuntu 14.10.

The source file contains a single function generated with re2c from the
following input:

// Try to match email autolink after first <, returning num of chars matched.
int _scan_autolink_email(const unsigned char *p)
  const unsigned char *marker = NULL;
  const unsigned char *start = p;
    [>] { return (p - start); }
  .? { return 0; }

More information about the Gcc-bugs mailing list