public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11596] New: ICE with int templates
@ 2003-07-19 22:01 weiss at sztaki dot hu
  2003-07-19 22:23 ` [Bug c++/11596] [3.4 Regression] " pinskia at physics dot uc dot edu
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: weiss at sztaki dot hu @ 2003-07-19 22:01 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: ICE with int templates
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: weiss at sztaki dot hu
                CC: gcc-bugs at gcc dot gnu dot org

The following example causes an ICE:


gonzo:~ # cat foo.cc
template <int A, int B, int C, bool D=(A<B)>
struct a
{
  enum { value = D? A+B: A+C };
};


template <int A>
struct b
{
//   enum { value = a<A,A,A>::value };  // compiles
//   enum { value = a<A,1,A>::value };  // compiles as well
//   enum { value = a<1,A,A>::value };  // compiles as well
  enum { value = a<1,1,A>::value };  // ICE
};


int main()
{
  return b<1>::value;
}

gonzo:~ # g++-cvs -v
Reading specs from /gml/shared/gcc-cvs/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs
Configured with: ../gcc/configure --prefix=/gml/shared/gcc-cvs --enable-shared
--enable-languages=c,c++ --enable-threads=posix
Thread model: posix
gcc version 3.4 20030719 (experimental)

gonzo:~ # g++-cvs foo.cc
foo.cc:14: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


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

* [Bug c++/11596] [3.4 Regression] ICE with int templates
  2003-07-19 22:01 [Bug c++/11596] New: ICE with int templates weiss at sztaki dot hu
@ 2003-07-19 22:23 ` pinskia at physics dot uc dot edu
  2003-07-21 13:18 ` nathan at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-19 22:23 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-valid-code
           Priority|P2                          |P1
   Last reconfirmed|0000-00-00 00:00:00         |2003-07-19 22:23:45
               date|                            |
            Summary|ICE with int templates      |[3.4 Regression] ICE with
                   |                            |int templates


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-19 22:23 -------
I can confirm this on the mainline (20030719).
>From Phil's regression hunter: Search converges between 2003-07-08-trunk (#330) and 
2003-07-09-trunk (#331).


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

* [Bug c++/11596] [3.4 Regression] ICE with int templates
  2003-07-19 22:01 [Bug c++/11596] New: ICE with int templates weiss at sztaki dot hu
  2003-07-19 22:23 ` [Bug c++/11596] [3.4 Regression] " pinskia at physics dot uc dot edu
@ 2003-07-21 13:18 ` nathan at gcc dot gnu dot org
  2003-07-23 23:24 ` janis187 at us dot ibm dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: nathan at gcc dot gnu dot org @ 2003-07-21 13:18 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


nathan at gcc dot gnu dot org changed:

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


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

* [Bug c++/11596] [3.4 Regression] ICE with int templates
  2003-07-19 22:01 [Bug c++/11596] New: ICE with int templates weiss at sztaki dot hu
  2003-07-19 22:23 ` [Bug c++/11596] [3.4 Regression] " pinskia at physics dot uc dot edu
  2003-07-21 13:18 ` nathan at gcc dot gnu dot org
@ 2003-07-23 23:24 ` janis187 at us dot ibm dot com
  2003-07-25 10:16 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: janis187 at us dot ibm dot com @ 2003-07-23 23:24 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


janis187 at us dot ibm dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mmitchel at gcc dot gnu dot
                   |                            |org


------- Additional Comments From janis187 at us dot ibm dot com  2003-07-23 23:24 -------
The regression in PR 11596 was introduced or exposed by a very large           
patch whose ChangeLog entries begin:

--- gcc/gcc/ChangeLog ---

2003-07-08  Mark Mitchell  <mark@codesourcery.com>

        * fold-const.c (make_range): Do not access operand 1 for a
        zero-operand operator.

--- gcc/gcc/cp/ChangeLog ---

2003-07-08  Mark Mitchell  <mark@codesourcery.com>

        * cp-tree.def (NON_DEPENDENT_EXPR): New node.
        * cp-tree.h (build_call_from_tree): Remove.
        (build_member_call): Likewise.
        (dependent_template_arg_p): Remove.
        (any_dependent_template_arguments_p): New function.
        (dependent_template_id_p): Likewise.
        (any_type_dependent_arguments_p): Likewise.
        (build_non_dependent_expr): Likewise.
        (build_non_dependent_args): Likewise.
        (build_x_compound_expr): Adjust prototype.

The regression hunt took place on i686-pc-linux-gnu and used the
submitter's test case.


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

* [Bug c++/11596] [3.4 Regression] ICE with int templates
  2003-07-19 22:01 [Bug c++/11596] New: ICE with int templates weiss at sztaki dot hu
                   ` (2 preceding siblings ...)
  2003-07-23 23:24 ` janis187 at us dot ibm dot com
@ 2003-07-25 10:16 ` cvs-commit at gcc dot gnu dot org
  2003-07-25 10:27 ` nathan at gcc dot gnu dot org
  2003-07-25 13:05 ` nathan at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-07-25 10:16 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-07-25 10:16 -------
Subject: Bug 11596

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	nathan@gcc.gnu.org	2003-07-25 10:16:13

Modified files:
	gcc/cp         : ChangeLog pt.c 
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/g++.dg/ext: packed2.C 
Added files:
	gcc/testsuite/g++.dg/template: defarg3.C 

Log message:
	cp:
	PR c++/11596
	* pt.c (maybe_fold_nontype_arg, maybe_fold_nontype_args): Remove.
	(tsubst_template_arg): New.
	(tsubst_template_arg_vector): Rename to ...
	(tsubst_template_args): ... this. Accept a TREE_LIST form. Use
	tsubst_template_arg.
	(coerce_template_parms): Use tsubst_template_arg for default
	value.
	(tsubst_template_parms): Likewise.
	(tsubst_aggr_type): Adjust.
	(tsubst_decl): Likewise.
	(tsubst): Use tsubst_template_arg for a DOMAIN. Adjust.
	(tsubst_copy) <TEMPLATE_ID_EXPR case>: Use tsubst_template_args.
	testsuite:
	PR 11596
	* g++.dg/template/defarg3.C: New test.
	
	* g++.dg/ext/packed2.C: Pack member struct too. Explain why.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3552&r2=1.3553
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.734&r2=1.735
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2916&r2=1.2917
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/defarg3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/packed2.C.diff?cvsroot=gcc&r1=1.1&r2=1.2


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

* [Bug c++/11596] [3.4 Regression] ICE with int templates
  2003-07-19 22:01 [Bug c++/11596] New: ICE with int templates weiss at sztaki dot hu
                   ` (3 preceding siblings ...)
  2003-07-25 10:16 ` cvs-commit at gcc dot gnu dot org
@ 2003-07-25 10:27 ` nathan at gcc dot gnu dot org
  2003-07-25 13:05 ` nathan at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: nathan at gcc dot gnu dot org @ 2003-07-25 10:27 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


nathan at gcc dot gnu dot org changed:

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


------- Additional Comments From nathan at gcc dot gnu dot org  2003-07-25 10:27 -------
2003-07-25  Nathan Sidwell  <nathan@codesourcery.com>

	PR c++/11596
	* pt.c (maybe_fold_nontype_arg, maybe_fold_nontype_args): Remove.
	(tsubst_template_arg): New.
	(tsubst_template_arg_vector): Rename to ...
	(tsubst_template_args): ... this. Accept a TREE_LIST form. Use
	tsubst_template_arg.
	(coerce_template_parms): Use tsubst_template_arg for default
	value.
	(tsubst_template_parms): Likewise.
	(tsubst_aggr_type): Adjust.
	(tsubst_decl): Likewise.
	(tsubst): Use tsubst_template_arg for a DOMAIN. Adjust.
	(tsubst_copy) <TEMPLATE_ID_EXPR case>: Use tsubst_template_args.


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

* [Bug c++/11596] [3.4 Regression] ICE with int templates
  2003-07-19 22:01 [Bug c++/11596] New: ICE with int templates weiss at sztaki dot hu
                   ` (4 preceding siblings ...)
  2003-07-25 10:27 ` nathan at gcc dot gnu dot org
@ 2003-07-25 13:05 ` nathan at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: nathan at gcc dot gnu dot org @ 2003-07-25 13:05 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


nathan at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org


------- Additional Comments From nathan at gcc dot gnu dot org  2003-07-25 13:05 -------
*** Bug 11548 has been marked as a duplicate of this bug. ***


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

end of thread, other threads:[~2003-07-25 13:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-19 22:01 [Bug c++/11596] New: ICE with int templates weiss at sztaki dot hu
2003-07-19 22:23 ` [Bug c++/11596] [3.4 Regression] " pinskia at physics dot uc dot edu
2003-07-21 13:18 ` nathan at gcc dot gnu dot org
2003-07-23 23:24 ` janis187 at us dot ibm dot com
2003-07-25 10:16 ` cvs-commit at gcc dot gnu dot org
2003-07-25 10:27 ` nathan at gcc dot gnu dot org
2003-07-25 13:05 ` nathan 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).