public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55419] New: internal compiler error: in gimplify_init_ctor_preeval, at gimplify.c:3587
@ 2012-11-20 22:24 jasongross9+bugzilla at gmail dot com
  2012-11-21  1:07 ` [Bug c++/55419] [4.8 Regression] ICE " paolo.carlini at oracle dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: jasongross9+bugzilla at gmail dot com @ 2012-11-20 22:24 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55419

             Bug #: 55419
           Summary: internal compiler error: in
                    gimplify_init_ctor_preeval, at gimplify.c:3587
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jasongross9+bugzilla@gmail.com


Created attachment 28745
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28745
intermediate .ii file from g++

I get the following output from g++, and it creates the attached .ii file

Using built-in specs.
COLLECT_GCC=/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/g++
Target: x86_64-unknown-linux-gnu
Configured with: ./configure
--prefix=/afs/csail/proj/courses/6.172/gcc-cilkplus --enable-languages=c,c++
Thread model: posix
gcc version 4.8.0 20120618 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-std=c++11' '-v' '-save-temps' '-c' '-o' 'fen.o'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/cc1plus
-E -quiet -v -iprefix
/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/
-D_GNU_SOURCE fen.cpp -mtune=generic -march=x86-64 -std=c++11 -fpch-preprocess
-o fen.ii
ignoring nonexistent directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../x86_64-unknown-linux-gnu/include"
ignoring duplicate directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0"
ignoring duplicate directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/x86_64-unknown-linux-gnu"
ignoring duplicate directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/backward"
ignoring duplicate directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include"
ignoring duplicate directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include-fixed"
ignoring nonexistent directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/intel/composer_xe_2013.0.079/mkl/include
 /opt/intel/composer_xe_2013.0.079/tbb/include

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/x86_64-unknown-linux-gnu

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/backward

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include-fixed
 /usr/local/include

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../include
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-std=c++11' '-v' '-save-temps' '-c' '-o' 'fen.o'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/cc1plus
-fpreprocessed fen.ii -quiet -dumpbase fen.cpp -mtune=generic -march=x86-64
-auxbase-strip fen.o -std=c++11 -version -o fen.s
GNU C++ (GCC) version 4.8.0 20120618 (experimental) (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.8.0 20120618 (experimental), GMP version 5.0.2,
MPFR version 3.1.0, MPC version 0.9
warning: GMP header version 5.0.2 differs from library version 4.3.2.
warning: MPFR header version 3.1.0 differs from library version 3.0.0-p3.
warning: MPC header version 0.9 differs from library version 0.8.2.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C++ (GCC) version 4.8.0 20120618 (experimental) (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.8.0 20120618 (experimental), GMP version 5.0.2,
MPFR version 3.1.0, MPC version 0.9
warning: GMP header version 5.0.2 differs from library version 4.3.2.
warning: MPFR header version 3.1.0 differs from library version 3.0.0-p3.
warning: MPC header version 0.9 differs from library version 0.8.2.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 9140df29c77763bd28b47359117a6952
fen.cpp: In function ‘int fen_to_pos(position_t*, const char*)’:
fen.cpp:329:10: internal compiler error: in gimplify_init_ctor_preeval, at
gimplify.c:3587
   *p = {};  // gcc_workaround;
          ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


Apologies for the large document; I haven't had time to try to construct a
smaller test case.  The following is a workaround for the code:
    position_t gcc_workaround = {};
    *p = gcc_workaround;


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

* [Bug c++/55419] [4.8 Regression] ICE in gimplify_init_ctor_preeval, at gimplify.c:3587
  2012-11-20 22:24 [Bug c++/55419] New: internal compiler error: in gimplify_init_ctor_preeval, at gimplify.c:3587 jasongross9+bugzilla at gmail dot com
@ 2012-11-21  1:07 ` paolo.carlini at oracle dot com
  2012-11-21 11:09 ` [Bug c++/55419] [4.7/4.8 " jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-11-21  1:07 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55419

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-11-21
            Summary|internal compiler error: in |[4.8 Regression] ICE in
                   |gimplify_init_ctor_preeval, |gimplify_init_ctor_preeval,
                   |at gimplify.c:3587          |at gimplify.c:3587
     Ever Confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-11-21 01:06:40 UTC ---
It's a regression.


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

* [Bug c++/55419] [4.7/4.8 Regression] ICE in gimplify_init_ctor_preeval, at gimplify.c:3587
  2012-11-20 22:24 [Bug c++/55419] New: internal compiler error: in gimplify_init_ctor_preeval, at gimplify.c:3587 jasongross9+bugzilla at gmail dot com
  2012-11-21  1:07 ` [Bug c++/55419] [4.8 Regression] ICE " paolo.carlini at oracle dot com
@ 2012-11-21 11:09 ` jakub at gcc dot gnu.org
  2012-11-21 11:18 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-21 11:09 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55419

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org
   Target Milestone|---                         |4.8.0
            Summary|[4.8 Regression] ICE in     |[4.7/4.8 Regression] ICE in
                   |gimplify_init_ctor_preeval, |gimplify_init_ctor_preeval,
                   |at gimplify.c:3587          |at gimplify.c:3587

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-21 11:08:46 UTC ---
Reduced testcase:
struct P
{
  P () = default;
  explicit constexpr P (int x) : p (x) {}
  int p;
};

struct Q
{
  constexpr Q () : q (0x7f) {}
  int q;
};

struct R
{
  Q q;
  P p;
};

void
foo (R *x)
{
  *x = {};
}

Started ICEing with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177997


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

* [Bug c++/55419] [4.7/4.8 Regression] ICE in gimplify_init_ctor_preeval, at gimplify.c:3587
  2012-11-20 22:24 [Bug c++/55419] New: internal compiler error: in gimplify_init_ctor_preeval, at gimplify.c:3587 jasongross9+bugzilla at gmail dot com
  2012-11-21  1:07 ` [Bug c++/55419] [4.8 Regression] ICE " paolo.carlini at oracle dot com
  2012-11-21 11:09 ` [Bug c++/55419] [4.7/4.8 " jakub at gcc dot gnu.org
@ 2012-11-21 11:18 ` jakub at gcc dot gnu.org
  2012-12-07 10:16 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-21 11:18 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55419

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-21 11:18:22 UTC ---
   /* We always set TREE_SIDE_EFFECTS so that expand_expr does not
      ignore the TARGET_EXPR.  If there really turn out to be no
      side-effects, then the optimizer should be able to get rid of
      whatever code is generated anyhow.  */
   TREE_SIDE_EFFECTS (t) = 1;
+  if (literal_type_p (type))
+    TREE_CONSTANT (t) = TREE_CONSTANT (value);

So we end up with TARGET_EXPR with TREE_SIDE_EFFECTS, but TREE_CONSTANT set
too, which is what the gimplifier is complaining about.  constants shouldn't
have side-effects.  If this is some trick internal to the C++ FE, then at least
the genericizer should drop TREE_CONSTANT from TARGET_EXPRs with
TREE_SIDE_EFFECTS set that are passed down to the middle-end.


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

* [Bug c++/55419] [4.7/4.8 Regression] ICE in gimplify_init_ctor_preeval, at gimplify.c:3587
  2012-11-20 22:24 [Bug c++/55419] New: internal compiler error: in gimplify_init_ctor_preeval, at gimplify.c:3587 jasongross9+bugzilla at gmail dot com
                   ` (2 preceding siblings ...)
  2012-11-21 11:18 ` jakub at gcc dot gnu.org
@ 2012-12-07 10:16 ` rguenth at gcc dot gnu.org
  2012-12-07 15:43 ` jason at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-07 10:16 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55419

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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

* [Bug c++/55419] [4.7/4.8 Regression] ICE in gimplify_init_ctor_preeval, at gimplify.c:3587
  2012-11-20 22:24 [Bug c++/55419] New: internal compiler error: in gimplify_init_ctor_preeval, at gimplify.c:3587 jasongross9+bugzilla at gmail dot com
                   ` (3 preceding siblings ...)
  2012-12-07 10:16 ` rguenth at gcc dot gnu.org
@ 2012-12-07 15:43 ` jason at gcc dot gnu.org
  2012-12-08  3:31 ` jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2012-12-07 15:43 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55419

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |


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

* [Bug c++/55419] [4.7/4.8 Regression] ICE in gimplify_init_ctor_preeval, at gimplify.c:3587
  2012-11-20 22:24 [Bug c++/55419] New: internal compiler error: in gimplify_init_ctor_preeval, at gimplify.c:3587 jasongross9+bugzilla at gmail dot com
                   ` (4 preceding siblings ...)
  2012-12-07 15:43 ` jason at gcc dot gnu.org
@ 2012-12-08  3:31 ` jason at gcc dot gnu.org
  2012-12-08  3:32 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2012-12-08  3:31 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55419

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2012-12-08 03:31:33 UTC ---
Author: jason
Date: Sat Dec  8 03:31:25 2012
New Revision: 194317

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194317
Log:
    PR c++/55419
    * tree.c (build_target_expr): Don't set TREE_CONSTANT.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist6.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/tree.c


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

* [Bug c++/55419] [4.7/4.8 Regression] ICE in gimplify_init_ctor_preeval, at gimplify.c:3587
  2012-11-20 22:24 [Bug c++/55419] New: internal compiler error: in gimplify_init_ctor_preeval, at gimplify.c:3587 jasongross9+bugzilla at gmail dot com
                   ` (5 preceding siblings ...)
  2012-12-08  3:31 ` jason at gcc dot gnu.org
@ 2012-12-08  3:32 ` jason at gcc dot gnu.org
  2012-12-08  3:33 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2012-12-08  3:32 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55419

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2012-12-08 03:32:06 UTC ---
Author: jason
Date: Sat Dec  8 03:31:56 2012
New Revision: 194319

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194319
Log:
    PR c++/55419
    * tree.c (build_target_expr): Don't set TREE_CONSTANT.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist6.C
Modified:
    branches/gcc-4_7-branch/gcc/cp/ChangeLog
    branches/gcc-4_7-branch/gcc/cp/tree.c


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

* [Bug c++/55419] [4.7/4.8 Regression] ICE in gimplify_init_ctor_preeval, at gimplify.c:3587
  2012-11-20 22:24 [Bug c++/55419] New: internal compiler error: in gimplify_init_ctor_preeval, at gimplify.c:3587 jasongross9+bugzilla at gmail dot com
                   ` (6 preceding siblings ...)
  2012-12-08  3:32 ` jason at gcc dot gnu.org
@ 2012-12-08  3:33 ` jason at gcc dot gnu.org
  2013-01-03 20:38 ` jason at gcc dot gnu.org
  2013-01-03 20:38 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2012-12-08  3:33 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55419

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.8.0                       |4.7.3

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2012-12-08 03:33:06 UTC ---
Fixed for 4.7.3.


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

* [Bug c++/55419] [4.7/4.8 Regression] ICE in gimplify_init_ctor_preeval, at gimplify.c:3587
  2012-11-20 22:24 [Bug c++/55419] New: internal compiler error: in gimplify_init_ctor_preeval, at gimplify.c:3587 jasongross9+bugzilla at gmail dot com
                   ` (7 preceding siblings ...)
  2012-12-08  3:33 ` jason at gcc dot gnu.org
@ 2013-01-03 20:38 ` jason at gcc dot gnu.org
  2013-01-03 20:38 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2013-01-03 20:38 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55419

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2013-01-03 20:37:50 UTC ---
Author: jason
Date: Thu Jan  3 20:37:28 2013
New Revision: 194872

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194872
Log:
    PR c++/55419
    PR c++/55753
    * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
    TREE_CONSTANT.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor12.C
Modified:
    branches/gcc-4_7-branch/gcc/cp/ChangeLog
    branches/gcc-4_7-branch/gcc/cp/pt.c


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

* [Bug c++/55419] [4.7/4.8 Regression] ICE in gimplify_init_ctor_preeval, at gimplify.c:3587
  2012-11-20 22:24 [Bug c++/55419] New: internal compiler error: in gimplify_init_ctor_preeval, at gimplify.c:3587 jasongross9+bugzilla at gmail dot com
                   ` (8 preceding siblings ...)
  2013-01-03 20:38 ` jason at gcc dot gnu.org
@ 2013-01-03 20:38 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2013-01-03 20:38 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55419

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2013-01-03 20:37:04 UTC ---
Author: jason
Date: Thu Jan  3 20:36:49 2013
New Revision: 194870

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194870
Log:
    PR c++/55419
    PR c++/55753
    * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
    TREE_CONSTANT.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor12.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c


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

end of thread, other threads:[~2013-01-03 20:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-20 22:24 [Bug c++/55419] New: internal compiler error: in gimplify_init_ctor_preeval, at gimplify.c:3587 jasongross9+bugzilla at gmail dot com
2012-11-21  1:07 ` [Bug c++/55419] [4.8 Regression] ICE " paolo.carlini at oracle dot com
2012-11-21 11:09 ` [Bug c++/55419] [4.7/4.8 " jakub at gcc dot gnu.org
2012-11-21 11:18 ` jakub at gcc dot gnu.org
2012-12-07 10:16 ` rguenth at gcc dot gnu.org
2012-12-07 15:43 ` jason at gcc dot gnu.org
2012-12-08  3:31 ` jason at gcc dot gnu.org
2012-12-08  3:32 ` jason at gcc dot gnu.org
2012-12-08  3:33 ` jason at gcc dot gnu.org
2013-01-03 20:38 ` jason at gcc dot gnu.org
2013-01-03 20:38 ` jason 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).