Using the min/max-with-assignment operators (<?= and >?=; a GNU extension to C++) where one or both of the arguments are of aggregate type (struct/class), causes an internal error (Segmentation fault). It doesn't matter if the relevant relational operator (< or >) has been defined for the types; an attempt to declare <?= or >?= itself for such types causes the error to occur on that line instead. If primitive types are used (pointers count for this) for both types, the code compiles successfully if comparison is defined on both types, or gives the correct error if it isn't (e.g. char* and double). This doesn't occur with just <? and >?; interestingly, the assignment forms don't seem to actually be documented in the manual, but do work on primitive types. Release: 3.1 Environment: System: Linux pippin.cs.oberlin.edu 2.4.17 #15 Fri Feb 1 14:02:22 EST 2002 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../gcc-3.1/configure --prefix=/usr/public --program-suffix=3 How-To-Repeat: Fortunately, this requires no includes or preprocessing. Example: // code starts here struct s_t { }; void foo(void) { s_t s; int i; s<?=i; } // output starts here bugtest.cc: In function `void foo()': bugtest.cc:4: internal error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. // end. Also try trivial modifications: switching the args on line 4, using "s" for both of them, using "i" for both of them, removing the '=', etc.; this is mainly how I got the details in the Description.
Fix: Fixed in GCC 3.3, GCC 3.4 with: http://gcc.gnu.org/ml/gcc-patches/2003-02/msg00194.html
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed.
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu> To: gcc-gnats@gcc.gnu.org Cc: Subject: Re: c++/7129 Date: Wed, 22 Jan 2003 21:07:23 -0600 (CST) This used to just give an error in 2.95, but ICEs ever since, so it's a regression. ------------------------------------------------------------------------- Wolfgang Bangerth email: bangerth@ticam.utexas.edu www: http://www.ticam.utexas.edu/~bangerth/
Responsible-Changed-From-To: unassigned->mmitchel Responsible-Changed-Why: Working on a fix.
From: mmitchel@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: c++/7129 Date: 4 Feb 2003 07:23:14 -0000 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2003-02-04 07:23:14 Modified files: gcc/cp : ChangeLog call.c operators.def gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/ext: max.C Log message: PR c++/7129 * call.c (z_candidate): Add args. (convert_class_to_reference): Set it. (implicit_conversion): Tidy. (add_candidate): Add args parameter. (add_function_candidate): Adjust call to add_candidate. (add_conv_candidate): Likewise. (build_builtin_candidate): Likewise. (build_user_type_conversion_1): Eliminate wasteful tree_cons usage. (build_new_function_call): Likewise. (build_object_call): Likewise. (add_candidates): New function. (build_new_op): Use it. (covert_like_real): Adjust call to build_over_call. (build_over_call): Remove args parameter. * operators.def: Add <?= and >?=. PR c++/7129 * testsuite/g++.dg/ext/max.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3190&r2=1.3191 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.354&r2=1.355 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/operators.def.diff?cvsroot=gcc&r1=1.12&r2=1.13 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2392&r2=1.2393 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/max.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
From: mmitchel@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: c++/7129 Date: 4 Feb 2003 07:39:08 -0000 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: mmitchel@gcc.gnu.org 2003-02-04 07:39:08 Modified files: gcc/cp : ChangeLog operators.def gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/ext: max.C Log message: PR c++/7129 * operators.def: Add <?= and >?=. PR c++/7129 * testsuite/g++.dg/ext/max.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.28&r2=1.3076.2.29 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/operators.def.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.11&r2=1.11.4.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.37&r2=1.2261.2.38 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/max.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
State-Changed-From-To: analyzed->closed State-Changed-Why: Fixed. See http://gcc.gnu.org/ml/gcc-patches/2003-02/msg00194.html