public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/12566] New: ugly ERROR_MARK use
@ 2003-10-10 8:42 nathan at gcc dot gnu dot org
2003-10-11 2:35 ` [Bug c++/12566] " pinskia at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: nathan at gcc dot gnu dot org @ 2003-10-10 8:42 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=12566
Summary: ugly ERROR_MARK use
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: nathan at gcc dot gnu dot org
ReportedBy: nathan at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
> Two, the C++ frontend uses build (ERROR_MARK, type) in cp_fname_init. This
> is horrible, but I haven't gotten around to fixing it yet. Nathan, what is
> the point of doing that rather than just leaving DECL_INITIAL null?
I think it must be something about it being an initializer for a constant.
Without the init, something else complains. We should be able to be cleaner
by making a better 'magic' initializer with some kind of dependent value.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/12566] ugly ERROR_MARK use
2003-10-10 8:42 [Bug c++/12566] New: ugly ERROR_MARK use nathan at gcc dot gnu dot org
@ 2003-10-11 2:35 ` pinskia at gcc dot gnu dot org
2003-10-12 1:06 ` carlo at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-11 2:35 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=12566
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-10-11 02:35:33
date| |
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/12566] ugly ERROR_MARK use
2003-10-10 8:42 [Bug c++/12566] New: ugly ERROR_MARK use nathan at gcc dot gnu dot org
2003-10-11 2:35 ` [Bug c++/12566] " pinskia at gcc dot gnu dot org
@ 2003-10-12 1:06 ` carlo at gcc dot gnu dot org
2003-10-24 8:08 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: carlo at gcc dot gnu dot org @ 2003-10-12 1:06 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=12566
------- Additional Comments From carlo at gcc dot gnu dot org 2003-10-12 01:06 -------
On the topic of ugly ERROR_MARK usage,
are you aware of the fact that C_EXP_ORIGINAL_CODE,
defined in c-common.h, is used to (sometimes) read
the value of tree_exp::complexity of expressions
that never use (or explicitely set) C_EXP_ORIGINAL_CODE?
The result is that the value returned by C_EXP_ORIGINAL_CODE
for those expressions, which is 0 as a result of the
memset() in make_node(), is interpreted as ERROR_MARK,
which coincidently has value 0 too.
In most cases this results in an boolean expression
to evaluate to false, like in:
if (C_EXP_ORIGINAL_CODE(exp) == PLUS_EXPR)
but a for example in parser_build_binary_op() it is
indirectly also used as array index, doing something
like:
code1 = C_EXP_ORIGINAL_CODE (arg1);
[...]
use TREE_CODE_CLASS (code1)
I ran into this when I tried to use the apparently by
most expression types unused 'complexity' element for
something else.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/12566] ugly ERROR_MARK use
2003-10-10 8:42 [Bug c++/12566] New: ugly ERROR_MARK use nathan at gcc dot gnu dot org
2003-10-11 2:35 ` [Bug c++/12566] " pinskia at gcc dot gnu dot org
2003-10-12 1:06 ` carlo at gcc dot gnu dot org
@ 2003-10-24 8:08 ` cvs-commit at gcc dot gnu dot org
2003-10-24 8:08 ` nathan at gcc dot gnu dot org
2003-12-04 9:45 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-10-24 8:08 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=12566
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2003-10-24 07:59 -------
Subject: Bug 12566
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: nathan@gcc.gnu.org 2003-10-24 07:59:42
Modified files:
gcc/cp : ChangeLog class.c cp-tree.h decl.c method.c
pt.c semantics.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/inherit: covariant9.C covariant10.C
covariant11.C
Log message:
cp:
PR c++/12698, c++/12699, c++/12700, c++/12566
* cp-tree.h (THUNK_ALIAS_P, THUNK_ALIAS): New.
(debug_class, debug_thunks): New.
* class.c (dump_class_hierarchy_1): New break out from ...
(dump_class_hierarchy): ... here.
(dump_thunk, debug_thunks, debug_class): New.
(update_vtable_entry_for_fn): Add ssizetype casts. Correct
continued search for primary binfo via virtual.
(build_vtbl_initializer): Follow covariant thunk alias.
* method.c (make_thunk): Clear DECL_THUNKS of the thunk.
(finish_thunk): Look for an alias of the covariant thunk and point
to it.
(use_thunk): We should never use an alias.
* semantics.c (emit_associated_thunks): Do not emit aliases.
PR c++/12566
* cp-tree.h (cp_fname_init): Add TYPE pointer param.
* decl.c (cp_fname_init): Add TYPE pointer param. Set it. Don't
create an ad-hoc ERROR_MARK.
(cp_make_fname_decl): Adjust.
* pt.c (tsubst_expr): Adjust.
testsuite:
PR c++/12698, c++/12699, c++/12700, c++/12566
* g++.dg/inherit/covariant9.C: New test.
* g++.dg/inherit/covariant10.C: New test.
* g++.dg/inherit/covariant11.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3743&r2=1.3744
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&r1=1.579&r2=1.580
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.929&r2=1.930
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1149&r2=1.1150
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/method.c.diff?cvsroot=gcc&r1=1.269&r2=1.270
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.790&r2=1.791
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.370&r2=1.371
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3140&r2=1.3141
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/inherit/covariant9.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/inherit/covariant10.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/inherit/covariant11.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/12566] ugly ERROR_MARK use
2003-10-10 8:42 [Bug c++/12566] New: ugly ERROR_MARK use nathan at gcc dot gnu dot org
` (2 preceding siblings ...)
2003-10-24 8:08 ` cvs-commit at gcc dot gnu dot org
@ 2003-10-24 8:08 ` nathan at gcc dot gnu dot org
2003-12-04 9:45 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: nathan at gcc dot gnu dot org @ 2003-10-24 8:08 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=12566
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-10-24 08:08 -------
2003-10-24 Nathan Sidwell <nathan@codesourcery.com>
PR c++/12698, c++/12699, c++/12700, c++/12566
* cp-tree.h (THUNK_ALIAS_P, THUNK_ALIAS): New.
(debug_class, debug_thunks): New.
* class.c (dump_class_hierarchy_1): New break out from ...
(dump_class_hierarchy): ... here.
(dump_thunk, debug_thunks, debug_class): New.
(update_vtable_entry_for_fn): Add ssizetype casts. Correct
continued search for primary binfo via virtual.
(build_vtbl_initializer): Follow covariant thunk alias.
* method.c (make_thunk): Clear DECL_THUNKS of the thunk.
(finish_thunk): Look for an alias of the covariant thunk and point
to it.
(use_thunk): We should never use an alias.
* semantics.c (emit_associated_thunks): Do not emit aliases.
PR c++/12566
* cp-tree.h (cp_fname_init): Add TYPE pointer param.
* decl.c (cp_fname_init): Add TYPE pointer param. Set it. Don't
create an ad-hoc ERROR_MARK.
(cp_make_fname_decl): Adjust.
* pt.c (tsubst_expr): Adjust.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/12566] ugly ERROR_MARK use
2003-10-10 8:42 [Bug c++/12566] New: ugly ERROR_MARK use nathan at gcc dot gnu dot org
` (3 preceding siblings ...)
2003-10-24 8:08 ` nathan at gcc dot gnu dot org
@ 2003-12-04 9:45 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-04 9:45 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |3.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12566
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-12-04 9:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-10 8:42 [Bug c++/12566] New: ugly ERROR_MARK use nathan at gcc dot gnu dot org
2003-10-11 2:35 ` [Bug c++/12566] " pinskia at gcc dot gnu dot org
2003-10-12 1:06 ` carlo at gcc dot gnu dot org
2003-10-24 8:08 ` cvs-commit at gcc dot gnu dot org
2003-10-24 8:08 ` nathan at gcc dot gnu dot org
2003-12-04 9:45 ` pinskia 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).