public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/11658] New: Wrong error message
@ 2003-07-24 11:53 bonzini at gnu dot org
2003-07-24 11:55 ` [Bug c/11658] " bonzini at gnu dot org
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: bonzini at gnu dot org @ 2003-07-24 11:53 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=11658
Summary: Wrong error message
Product: gcc
Version: 3.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bonzini at gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
This error has been wrong for a long time. It gives an erroneous "wrong
arguments to binary !=" even though there is no != in the source code.
The distilled test case is extremely simple:
struct a {
};
int
bug(struct a *m)
{
return (*m || 1);
}
Thank you very much,
Paolo
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/11658] Wrong error message
2003-07-24 11:53 [Bug c/11658] New: Wrong error message bonzini at gnu dot org
@ 2003-07-24 11:55 ` bonzini at gnu dot org
2003-07-24 11:58 ` pinskia at physics dot uc dot edu
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: bonzini at gnu dot org @ 2003-07-24 11:55 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=11658
------- Additional Comments From bonzini at gnu dot org 2003-07-24 11:54 -------
Created an attachment (id=4470)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4470&action=view)
test case for PR11658
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/11658] Wrong error message
2003-07-24 11:53 [Bug c/11658] New: Wrong error message bonzini at gnu dot org
2003-07-24 11:55 ` [Bug c/11658] " bonzini at gnu dot org
@ 2003-07-24 11:58 ` pinskia at physics dot uc dot edu
2003-07-24 13:00 ` bonzini at gnu dot org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-24 11:58 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=11658
pinskia at physics dot uc dot edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |diagnostic
Last reconfirmed|0000-00-00 00:00:00 |2003-07-24 11:58:29
date| |
------- Additional Comments From pinskia at physics dot uc dot edu 2003-07-24 11:58 -------
I can confirm this on the mainline (20030723) but I think the problem is there is an
implicated !=0 there created by the c front-end.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/11658] Wrong error message
2003-07-24 11:53 [Bug c/11658] New: Wrong error message bonzini at gnu dot org
2003-07-24 11:55 ` [Bug c/11658] " bonzini at gnu dot org
2003-07-24 11:58 ` pinskia at physics dot uc dot edu
@ 2003-07-24 13:00 ` bonzini at gnu dot org
2003-08-23 0:58 ` dhazeghi at yahoo dot com
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: bonzini at gnu dot org @ 2003-07-24 13:00 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=11658
------- Additional Comments From bonzini at gnu dot org 2003-07-24 13:00 -------
Subject: Re: Wrong error message
> I can confirm this on the mainline (20030723) but I think
> the problem is there is an
> implicated !=0 there created by the c front-end.
Yes, I suspected it. The error should be issued when the incorrect != is
created.
Paolo
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/11658] Wrong error message
2003-07-24 11:53 [Bug c/11658] New: Wrong error message bonzini at gnu dot org
` (2 preceding siblings ...)
2003-07-24 13:00 ` bonzini at gnu dot org
@ 2003-08-23 0:58 ` dhazeghi at yahoo dot com
2003-10-04 21:13 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-08-23 0:58 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=11658
dhazeghi at yahoo dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.4 |---
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/11658] Wrong error message
2003-07-24 11:53 [Bug c/11658] New: Wrong error message bonzini at gnu dot org
` (3 preceding siblings ...)
2003-08-23 0:58 ` dhazeghi at yahoo dot com
@ 2003-10-04 21:13 ` pinskia at gcc dot gnu dot org
2003-10-24 18:08 ` dhazeghi at yahoo dot com
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-04 21:13 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=11658
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mrnobo1024 at yahoo dot com
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-10-04 21:13 -------
*** Bug 12509 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/11658] Wrong error message
2003-07-24 11:53 [Bug c/11658] New: Wrong error message bonzini at gnu dot org
` (4 preceding siblings ...)
2003-10-04 21:13 ` pinskia at gcc dot gnu dot org
@ 2003-10-24 18:08 ` dhazeghi at yahoo dot com
2004-01-19 19:06 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-10-24 18: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=11658
dhazeghi at yahoo dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2003-08-17 12:47:19 |2003-10-24 18:07:02
date| |
------- Additional Comments From dhazeghi at yahoo dot com 2003-10-24 18:07 -------
Still present.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/11658] Wrong error message
2003-07-24 11:53 [Bug c/11658] New: Wrong error message bonzini at gnu dot org
` (5 preceding siblings ...)
2003-10-24 18:08 ` dhazeghi at yahoo dot com
@ 2004-01-19 19:06 ` pinskia at gcc dot gnu dot org
2004-02-02 13:44 ` bonzini at gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-19 19:06 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11658
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/11658] Wrong error message
2003-07-24 11:53 [Bug c/11658] New: Wrong error message bonzini at gnu dot org
` (6 preceding siblings ...)
2004-01-19 19:06 ` pinskia at gcc dot gnu dot org
@ 2004-02-02 13:44 ` bonzini at gnu dot org
2004-02-03 11:21 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: bonzini at gnu dot org @ 2004-02-02 13:44 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bonzini at gnu dot org 2004-02-02 13:44 -------
It is related to this code in c-common.c (c_common_truthvalue_conversion):
When could it be wrong for C++?!? And do "all callers" now handle ERROR_MARK
properly?
#if 0 /* This appears to be wrong for C++. */
/* These really should return error_mark_node after 2.4 is stable.
But not all callers handle ERROR_MARK properly. */
switch (TREE_CODE (TREE_TYPE (expr)))
{
case RECORD_TYPE:
error ("struct type value used where scalar is required");
return truthvalue_false_node;
case UNION_TYPE:
error ("union type value used where scalar is required");
return truthvalue_false_node;
case ARRAY_TYPE:
error ("array type value used where scalar is required");
return truthvalue_false_node;
default:
break;
}
#endif /* 0 */
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |bonzini at gnu dot org
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11658
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/11658] Wrong error message
2003-07-24 11:53 [Bug c/11658] New: Wrong error message bonzini at gnu dot org
` (7 preceding siblings ...)
2004-02-02 13:44 ` bonzini at gnu dot org
@ 2004-02-03 11:21 ` cvs-commit at gcc dot gnu dot org
2004-02-03 11:22 ` cvs-commit at gcc dot gnu dot org
2004-02-03 16:37 ` pinskia at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-03 11:21 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-02-03 11:21 -------
Subject: Bug 11658
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: paolo@gcc.gnu.org 2004-02-03 11:21:01
Modified files:
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gcc.dg: 20040203-1.c
gcc/testsuite/gcc.dg/noncompile: 20040203-1.cc 20040203-2.cc
20040203-3.cc
Log message:
2004-02-03 Paolo Bonzini <bonzini@gnu.org>
PR c/11658
PR c/13994
* gcc.dg/noncompile/20040203-1.c: New test.
* gcc.dg/noncompile/20040203-2.c: Likewise.
* gcc.dg/noncompile/20040203-3.c: Likewise.
* gcc.dg/20040203-1.c: Likewise.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3455&r2=1.3456
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/20040203-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/noncompile/20040203-1.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/noncompile/20040203-2.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/noncompile/20040203-3.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11658
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/11658] Wrong error message
2003-07-24 11:53 [Bug c/11658] New: Wrong error message bonzini at gnu dot org
` (8 preceding siblings ...)
2004-02-03 11:21 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-03 11:22 ` cvs-commit at gcc dot gnu dot org
2004-02-03 16:37 ` pinskia at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-03 11:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-02-03 11:22 -------
Subject: Bug 11658
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: paolo@gcc.gnu.org 2004-02-03 11:22:41
Modified files:
gcc : ChangeLog Makefile.in c-common.c c-convert.c
c-lang.c c-objc-common.c c-parse.in c-tree.h
c-typeck.c
gcc/objc : Make-lang.in objc-act.c objc-lang.c
Log message:
2004-02-03 Paolo Bonzini <bonzini@gnu.org>
PR c/11658
PR c/13994
* Makefile.in (c-parse.o, c-convert.o, c-typeck.o): Depend
on langhooks.h.
* objc/Make-lang.in (objc-parse.o): Depend on langhooks.h.
* c-parse.in, c-convert.c, c-typeck.c, objc/objc-act.c:
Include langhooks.h. Replace c_common_truthvalue_conversion
with the truthvalue_conversion language hook throughout.
(expr_no_commas): Call default_conversion before save_expr
for the first term of the production 'x ? : y'.
* c-common.c (c_common_truthvalue_conversion): Remove
obsolete block. Invoke recursively the hook instead
of this function.
* c-convert.c (convert): handle ERROR_MARK_NODE.
* c-typeck.c (build_binary_op): handle ERROR_MARK_NODE
returned by the truthvalue_conversion language hook.
* c-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Use
c_objc_common_truthvalue_conversion.
* c-objc-common.c (c_objc_common_truthvalue_conversion):
New function.
* c-tree.h (c_objc_common_truthvalue_conversion): Declare it.
* objc/objc-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Use
c_objc_common_truthvalue_conversion.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.2618&r2=2.2619
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/Makefile.in.diff?cvsroot=gcc&r1=1.1240&r2=1.1241
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&r1=1.479&r2=1.480
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-convert.c.diff?cvsroot=gcc&r1=1.18&r2=1.19
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-lang.c.diff?cvsroot=gcc&r1=1.119&r2=1.120
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-objc-common.c.diff?cvsroot=gcc&r1=1.37&r2=1.38
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-parse.in.diff?cvsroot=gcc&r1=1.196&r2=1.197
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-tree.h.diff?cvsroot=gcc&r1=1.136&r2=1.137
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&r1=1.274&r2=1.275
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/objc/Make-lang.in.diff?cvsroot=gcc&r1=1.69&r2=1.70
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/objc/objc-act.c.diff?cvsroot=gcc&r1=1.203&r2=1.204
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/objc/objc-lang.c.diff?cvsroot=gcc&r1=1.39&r2=1.40
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11658
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c/11658] Wrong error message
2003-07-24 11:53 [Bug c/11658] New: Wrong error message bonzini at gnu dot org
` (9 preceding siblings ...)
2004-02-03 11:22 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-03 16:37 ` pinskia at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-03 16:37 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-02-03 16:37 -------
Fixed for 3.5.0.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11658
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2004-02-03 16:37 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-24 11:53 [Bug c/11658] New: Wrong error message bonzini at gnu dot org
2003-07-24 11:55 ` [Bug c/11658] " bonzini at gnu dot org
2003-07-24 11:58 ` pinskia at physics dot uc dot edu
2003-07-24 13:00 ` bonzini at gnu dot org
2003-08-23 0:58 ` dhazeghi at yahoo dot com
2003-10-04 21:13 ` pinskia at gcc dot gnu dot org
2003-10-24 18:08 ` dhazeghi at yahoo dot com
2004-01-19 19:06 ` pinskia at gcc dot gnu dot org
2004-02-02 13:44 ` bonzini at gnu dot org
2004-02-03 11:21 ` cvs-commit at gcc dot gnu dot org
2004-02-03 11:22 ` cvs-commit at gcc dot gnu dot org
2004-02-03 16:37 ` 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).