public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51854] New: ICE in mangle.c with literal of complex floating type
@ 2012-01-13 22:25 hstong at ca dot ibm.com
  2012-01-13 22:30 ` [Bug c++/51854] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: hstong at ca dot ibm.com @ 2012-01-13 22:25 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51854
           Summary: ICE in mangle.c with literal of complex floating type
    Classification: Unclassified
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hstong@ca.ibm.com
              Host: powerpc64-unknown-linux-gnu
            Target: powerpc64-unknown-linux-gnu


ICE with imaginary component in mangled expression.

## Small self-contained source (cmplxfMangle.cpp):
template <unsigned N> struct A;

template <typename U, typename V>
char foo(U, V);

template <typename U>
void bar(A<sizeof(foo(U(), 1.0fj))> *);

int main() {
   bar<int>(0);
}


## Compiler invocation:
g++-4.6.0 cmplxfMangle.cpp -c


## Compiler output:
cmplxfMangle.cpp: In instantiation of âvoid bar(A<sizeof (char foo(U(),
(__complex__ float){0.0f, 1.0e+0f}))>*) [with U = int]â:
cmplxfMangle.cpp:10:15:   instantiated from here
cmplxfMangle.cpp:7:6: internal compiler error: in write_template_arg_literal,
at cp/mangle.c:2772
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


## g++ -v output:
Using built-in specs.
COLLECT_GCC=g++-4.6.0
COLLECT_LTO_WRAPPER=/data/gcc/libexec/gcc/powerpc64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: powerpc64-unknown-linux-gnu
Configured with: ./configure --prefix=/data/gcc --program-suffix=-4.6.0
--disable-libssp --disable-libgcj --enable-version-specific-runtime-libs
--with-cpu=default32 --enable-secureplt --with-long-double-128 --enable-shared
--enable-__cxa_atexit --enable-threads=posix --enable-languages=c,c++,fortran
--with-gmp=/usr/local
Thread model: posix
gcc version 4.6.0 (GCC)


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

* [Bug c++/51854] ICE in mangle.c with literal of complex floating type
  2012-01-13 22:25 [Bug c++/51854] New: ICE in mangle.c with literal of complex floating type hstong at ca dot ibm.com
@ 2012-01-13 22:30 ` pinskia at gcc dot gnu.org
  2012-01-16 10:54 ` [Bug c++/51854] [4.4/4.5/4.6/4.7 Regression] " rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-13 22:30 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|powerpc64-unknown-linux-gnu |
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-01-13
               Host|powerpc64-unknown-linux-gnu |
     Ever Confirmed|0                           |1
      Known to fail|                            |4.7.0

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-13 22:25:28 UTC ---
4.3 gave the following sorry:
t.cc:11: sorry, unimplemented: call_expr cannot be mangled due to a defect in
the C++ ABI

Confirmed.


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

* [Bug c++/51854] [4.4/4.5/4.6/4.7 Regression] ICE in mangle.c with literal of complex floating type
  2012-01-13 22:25 [Bug c++/51854] New: ICE in mangle.c with literal of complex floating type hstong at ca dot ibm.com
  2012-01-13 22:30 ` [Bug c++/51854] " pinskia at gcc dot gnu.org
@ 2012-01-16 10:54 ` rguenth at gcc dot gnu.org
  2012-01-16 18:42 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-01-16 10:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.3.6
   Target Milestone|---                         |4.4.7
            Summary|ICE in mangle.c with        |[4.4/4.5/4.6/4.7
                   |literal of complex floating |Regression] ICE in mangle.c
                   |type                        |with literal of complex
                   |                            |floating type


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

* [Bug c++/51854] [4.4/4.5/4.6/4.7 Regression] ICE in mangle.c with literal of complex floating type
  2012-01-13 22:25 [Bug c++/51854] New: ICE in mangle.c with literal of complex floating type hstong at ca dot ibm.com
  2012-01-13 22:30 ` [Bug c++/51854] " pinskia at gcc dot gnu.org
  2012-01-16 10:54 ` [Bug c++/51854] [4.4/4.5/4.6/4.7 Regression] " rguenth at gcc dot gnu.org
@ 2012-01-16 18:42 ` jakub at gcc dot gnu.org
  2012-01-16 21:08 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-01-16 18:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-01-16 18:29:41 UTC ---
I wonder whether:
--- gcc/cp/mangle.c.jj    2012-01-13 21:47:31.000000000 +0100
+++ gcc/cp/mangle.c    2012-01-16 19:26:48.474088778 +0100
@@ -2927,6 +2927,25 @@ write_template_arg_literal (const tree v
     write_real_cst (value);
     break;

+      case COMPLEX_CST:
+    if (TREE_CODE (TREE_REALPART (value)) == INTEGER_CST
+        && TREE_CODE (TREE_IMAGPART (value)) == INTEGER_CST)
+      {
+        write_integer_cst (TREE_REALPART (value));
+        write_char ('_');
+        write_integer_cst (TREE_IMAGPART (value));
+      }
+    else if (TREE_CODE (TREE_REALPART (value)) == REAL_CST
+         && TREE_CODE (TREE_IMAGPART (value)) == REAL_CST)
+      {
+        write_real_cst (TREE_REALPART (value));
+        write_char ('_');
+        write_real_cst (TREE_IMAGPART (value));
+      }
+    else
+      gcc_unreachable ();
+    break;
+
       case STRING_CST:
     sorry ("string literal in function template signature");
     break;


isn't the right fix for this (of course, missing testcases etc.).


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

* [Bug c++/51854] [4.4/4.5/4.6/4.7 Regression] ICE in mangle.c with literal of complex floating type
  2012-01-13 22:25 [Bug c++/51854] New: ICE in mangle.c with literal of complex floating type hstong at ca dot ibm.com
                   ` (2 preceding siblings ...)
  2012-01-16 18:42 ` jakub at gcc dot gnu.org
@ 2012-01-16 21:08 ` jason at gcc dot gnu.org
  2012-01-16 21:36 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2012-01-16 21:08 UTC (permalink / raw)
  To: gcc-bugs

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

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] 8+ messages in thread

* [Bug c++/51854] [4.4/4.5/4.6/4.7 Regression] ICE in mangle.c with literal of complex floating type
  2012-01-13 22:25 [Bug c++/51854] New: ICE in mangle.c with literal of complex floating type hstong at ca dot ibm.com
                   ` (3 preceding siblings ...)
  2012-01-16 21:08 ` jason at gcc dot gnu.org
@ 2012-01-16 21:36 ` jason at gcc dot gnu.org
  2012-01-16 21:56 ` [Bug c++/51854] [4.4/4.5/4.6 " jason at gcc dot gnu.org
  2012-01-16 22:11 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2012-01-16 21:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2012-01-16 21:32:18 UTC ---
Author: jason
Date: Mon Jan 16 21:32:14 2012
New Revision: 183222

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183222
Log:
    PR c++/51854
    * mangle.c (write_template_arg_literal): Handle complex.

Added:
    trunk/gcc/testsuite/g++.dg/abi/mangle60.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/mangle.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/51854] [4.4/4.5/4.6 Regression] ICE in mangle.c with literal of complex floating type
  2012-01-13 22:25 [Bug c++/51854] New: ICE in mangle.c with literal of complex floating type hstong at ca dot ibm.com
                   ` (4 preceding siblings ...)
  2012-01-16 21:36 ` jason at gcc dot gnu.org
@ 2012-01-16 21:56 ` jason at gcc dot gnu.org
  2012-01-16 22:11 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2012-01-16 21:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2012-01-16 21:50:02 UTC ---
Author: jason
Date: Mon Jan 16 21:49:58 2012
New Revision: 183224

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183224
Log:
    PR c++/51854
    * mangle.c (write_template_arg_literal): Sorry instead of aborting.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/abi/mangle60.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/mangle.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/51854] [4.4/4.5/4.6 Regression] ICE in mangle.c with literal of complex floating type
  2012-01-13 22:25 [Bug c++/51854] New: ICE in mangle.c with literal of complex floating type hstong at ca dot ibm.com
                   ` (5 preceding siblings ...)
  2012-01-16 21:56 ` [Bug c++/51854] [4.4/4.5/4.6 " jason at gcc dot gnu.org
@ 2012-01-16 22:11 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2012-01-16 22:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.4.7                       |4.6.3

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2012-01-16 21:53:37 UTC ---
ICE fixed for 4.6.3; mangling fixed for 4.7.0.  I don't think this is worth
fixing in 4.4/4.5.


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

end of thread, other threads:[~2012-01-16 21:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-13 22:25 [Bug c++/51854] New: ICE in mangle.c with literal of complex floating type hstong at ca dot ibm.com
2012-01-13 22:30 ` [Bug c++/51854] " pinskia at gcc dot gnu.org
2012-01-16 10:54 ` [Bug c++/51854] [4.4/4.5/4.6/4.7 Regression] " rguenth at gcc dot gnu.org
2012-01-16 18:42 ` jakub at gcc dot gnu.org
2012-01-16 21:08 ` jason at gcc dot gnu.org
2012-01-16 21:36 ` jason at gcc dot gnu.org
2012-01-16 21:56 ` [Bug c++/51854] [4.4/4.5/4.6 " jason at gcc dot gnu.org
2012-01-16 22:11 ` 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).