public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/30895]  New: [4.1/4.2/4.3 regression] ICE with complex values in template parameter
@ 2007-02-20 21:03 reichelt at gcc dot gnu dot org
  2007-02-20 21:10 ` [Bug c++/30895] " reichelt at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-02-20 21:03 UTC (permalink / raw)
  To: gcc-bugs

The following code snippet triggers an ICE since GCC 3.4.0:

=====================================
template<int> struct A {};

template<typename T> struct B
{
  A<T(0i)> a1;
  A<T(0i)> a2;
};
=====================================

bug.cc:6: internal compiler error: in cp_tree_equal, at cp/tree.c:1858
Please submit a full bug report, [etc.]

Before we got the message:
bug.cc:5: sorry, unimplemented: `complex_cst' not supported by dump_expr
bug.cc:5: sorry, unimplemented: `complex_cst' not supported by dump_expr
bug.cc:6: sorry, unimplemented: `complex_cst' not supported by dump_expr
bug.cc:6: sorry, unimplemented: `complex_cst' not supported by dump_expr

I'm not quite sure whether the code is valid or not.
It does compile with "0.0" instead of "0i".
So if we consider complex types as basic arithmetic types,
the code should be valid IMHO.
OTOH, we don't allow casts from complex int to int.
But if we don't instantiate B this shouldn't matter IMHO.


-- 
           Summary: [4.1/4.2/4.3 regression] ICE with complex values in
                    template parameter
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


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

* [Bug c++/30895] [4.1/4.2/4.3 regression] ICE with complex values in template parameter
  2007-02-20 21:03 [Bug c++/30895] New: [4.1/4.2/4.3 regression] ICE with complex values in template parameter reichelt at gcc dot gnu dot org
@ 2007-02-20 21:10 ` reichelt at gcc dot gnu dot org
  2007-02-20 21:23 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-02-20 21:10 UTC (permalink / raw)
  To: gcc-bugs



-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.3


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


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

* [Bug c++/30895] [4.1/4.2/4.3 regression] ICE with complex values in template parameter
  2007-02-20 21:03 [Bug c++/30895] New: [4.1/4.2/4.3 regression] ICE with complex values in template parameter reichelt at gcc dot gnu dot org
  2007-02-20 21:10 ` [Bug c++/30895] " reichelt at gcc dot gnu dot org
@ 2007-02-20 21:23 ` pinskia at gcc dot gnu dot org
  2007-02-28  6:55 ` patchapp at dberlin dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-20 21:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-02-20 21:23 -------
> OTOH, we don't allow casts from complex int to int.
We should as this is a GCC extension.

>I'm not quite sure whether the code is valid or not.
It is valid as we are using two extensions to C++, complex and complex integers
(I say two because the former is C99, while the latter is an extension to C99).


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-02-20 21:23:49
               date|                            |


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


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

* [Bug c++/30895] [4.1/4.2/4.3 regression] ICE with complex values in template parameter
  2007-02-20 21:03 [Bug c++/30895] New: [4.1/4.2/4.3 regression] ICE with complex values in template parameter reichelt at gcc dot gnu dot org
  2007-02-20 21:10 ` [Bug c++/30895] " reichelt at gcc dot gnu dot org
  2007-02-20 21:23 ` pinskia at gcc dot gnu dot org
@ 2007-02-28  6:55 ` patchapp at dberlin dot org
  2007-03-04 19:51 ` simartin at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: patchapp at dberlin dot org @ 2007-02-28  6:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from patchapp at dberlin dot org  2007-02-28 06:55 -------
Subject: Bug number PR c++/30895

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-02/msg02193.html


-- 


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


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

* [Bug c++/30895] [4.1/4.2/4.3 regression] ICE with complex values in template parameter
  2007-02-20 21:03 [Bug c++/30895] New: [4.1/4.2/4.3 regression] ICE with complex values in template parameter reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-02-28  6:55 ` patchapp at dberlin dot org
@ 2007-03-04 19:51 ` simartin at gcc dot gnu dot org
  2007-03-05  4:00 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: simartin at gcc dot gnu dot org @ 2007-03-04 19:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from simartin at gcc dot gnu dot org  2007-03-04 19:51 -------
Subject: Bug 30895

Author: simartin
Date: Sun Mar  4 19:50:54 2007
New Revision: 122532

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122532
Log:
2007-03-04  Simon Martin  <simartin@users.sourceforge.net>

        PR c++/30895
        * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.

Added:
    trunk/gcc/testsuite/g++.dg/parse/template23.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/tree.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/30895] [4.1/4.2/4.3 regression] ICE with complex values in template parameter
  2007-02-20 21:03 [Bug c++/30895] New: [4.1/4.2/4.3 regression] ICE with complex values in template parameter reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-03-04 19:51 ` simartin at gcc dot gnu dot org
@ 2007-03-05  4:00 ` mmitchel at gcc dot gnu dot org
  2007-03-05 22:56 ` simartin at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-03-05  4:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from mmitchel at gcc dot gnu dot org  2007-03-05 04:00 -------
Simon --

Would you please test and apply the patch to 4.1 and 4.2 as well?

Thanks,

-- Mark


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simartin at gcc dot gnu dot
                   |                            |org
         AssignedTo|unassigned at gcc dot gnu   |simartin at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
           Priority|P3                          |P2


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


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

* [Bug c++/30895] [4.1/4.2/4.3 regression] ICE with complex values in template parameter
  2007-02-20 21:03 [Bug c++/30895] New: [4.1/4.2/4.3 regression] ICE with complex values in template parameter reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-03-05  4:00 ` mmitchel at gcc dot gnu dot org
@ 2007-03-05 22:56 ` simartin at gcc dot gnu dot org
  2007-03-05 23:05 ` simartin at gcc dot gnu dot org
  2007-03-09 18:21 ` simartin at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: simartin at gcc dot gnu dot org @ 2007-03-05 22:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from simartin at gcc dot gnu dot org  2007-03-05 22:56 -------
Subject: Bug 30895

Author: simartin
Date: Mon Mar  5 22:55:58 2007
New Revision: 122578

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122578
Log:
2007-03-05  Simon Martin  <simartin@users.sourceforge.net>

        PR c++/30895
        * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/parse/template23.C
Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/tree.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/30895] [4.1/4.2/4.3 regression] ICE with complex values in template parameter
  2007-02-20 21:03 [Bug c++/30895] New: [4.1/4.2/4.3 regression] ICE with complex values in template parameter reichelt at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-03-05 22:56 ` simartin at gcc dot gnu dot org
@ 2007-03-05 23:05 ` simartin at gcc dot gnu dot org
  2007-03-09 18:21 ` simartin at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: simartin at gcc dot gnu dot org @ 2007-03-05 23:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from simartin at gcc dot gnu dot org  2007-03-05 23:05 -------
Subject: Bug 30895

Author: simartin
Date: Mon Mar  5 23:05:29 2007
New Revision: 122579

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122579
Log:
2007-03-05  Simon Martin  <simartin@users.sourceforge.net>

        PR c++/30895
        * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/parse/template23.C
Modified:
    branches/gcc-4_2-branch/gcc/cp/ChangeLog
    branches/gcc-4_2-branch/gcc/cp/tree.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/30895] [4.1/4.2/4.3 regression] ICE with complex values in template parameter
  2007-02-20 21:03 [Bug c++/30895] New: [4.1/4.2/4.3 regression] ICE with complex values in template parameter reichelt at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-03-05 23:05 ` simartin at gcc dot gnu dot org
@ 2007-03-09 18:21 ` simartin at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: simartin at gcc dot gnu dot org @ 2007-03-09 18:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from simartin at gcc dot gnu dot org  2007-03-09 18:21 -------
Fixed in 4.1, 4.2 and 4.3.


-- 

simartin at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2007-03-09 18:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-20 21:03 [Bug c++/30895] New: [4.1/4.2/4.3 regression] ICE with complex values in template parameter reichelt at gcc dot gnu dot org
2007-02-20 21:10 ` [Bug c++/30895] " reichelt at gcc dot gnu dot org
2007-02-20 21:23 ` pinskia at gcc dot gnu dot org
2007-02-28  6:55 ` patchapp at dberlin dot org
2007-03-04 19:51 ` simartin at gcc dot gnu dot org
2007-03-05  4:00 ` mmitchel at gcc dot gnu dot org
2007-03-05 22:56 ` simartin at gcc dot gnu dot org
2007-03-05 23:05 ` simartin at gcc dot gnu dot org
2007-03-09 18:21 ` simartin at gcc dot gnu dot 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).