public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "robert.durkacz at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/106241] New: compiler can't handle large array of strings
Date: Sat, 09 Jul 2022 11:33:28 +0000	[thread overview]
Message-ID: <bug-106241-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 106241
           Summary: compiler can't handle large array of strings
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: robert.durkacz at gmail dot com
  Target Milestone: ---

Compiler fails with an internal error when given an unreasonably large source
file. This is because I am simply trying to get a large string array put direct
into object code. My personal interest in reporting this as a bug, whether it
is or not, is to get any advice what is a better way to do what I am trying to
do.

Source code is included here in this description.

Bug report at request of compiler
=================================
Transcript:
$ g++ -g -std=c++11 -Wall -fPIC -o obj/maps.cpp.o maps.cpp.cpp
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.

Source code:
maps.cpp.cpp, which includes ...
#include "maps.include.cpp"

Compiler version
$ g++ --version
g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

System type
$ uname -a
Linux Satellite-Pro-L50-B 5.4.0-121-generic #137~18.04.1-Ubuntu SMP Mon Jun 20
07:25:24 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Text of source files.

===============================maps.cpp.cpp=====================================
#include <iostream>
#include <string>
using namespace std;

struct La {string lemma; string a;};
  struct Form_map {
    string s;
    struct La la;
  };

  struct Form_map form_array[]= {
#include "maps.include.cpp"
  };

int main()
{
  cout <<form_array[1].s <<" ";
  cout <<form_array[1].la.lemma <<" ";
  cout <<form_array[1].la.a <<endl;
}
===============================eof==============================================

maps.include.cpp consists of 5,200,000 lines similar to this one:
  {"ADP", {"ADP", "s{NGDAILV}|mq_"}},

             reply	other threads:[~2022-07-09 11:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09 11:33 robert.durkacz at gmail dot com [this message]
2022-07-09 11:55 ` [Bug c++/106241] " schwab@linux-m68k.org
2022-07-09 16:20 ` redi at gcc dot gnu.org
2022-07-10  1:32 ` robert.durkacz at gmail dot com
2022-07-10  9:56 ` redi at gcc dot gnu.org
2022-07-10  9:59 ` robert.durkacz at gmail dot com
2022-07-10 20:39 ` pinskia at gcc dot gnu.org
2022-07-11 11:00 ` redi 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-106241-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).