* [Bug c++/25861] tree check fail at c-common.c:2430
2006-01-19 18:46 [Bug c++/25861] New: tree check fail at c-common.c:2430 dcb314 at hotmail dot com
@ 2006-01-19 18:48 ` dcb314 at hotmail dot com
2006-01-19 18:53 ` pinskia at gcc dot gnu dot org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: dcb314 at hotmail dot com @ 2006-01-19 18:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from dcb314 at hotmail dot com 2006-01-19 18:48 -------
Created an attachment (id=10676)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10676&action=view)
C++ source code
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25861
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/25861] tree check fail at c-common.c:2430
2006-01-19 18:46 [Bug c++/25861] New: tree check fail at c-common.c:2430 dcb314 at hotmail dot com
2006-01-19 18:48 ` [Bug c++/25861] " dcb314 at hotmail dot com
@ 2006-01-19 18:53 ` pinskia at gcc dot gnu dot org
2006-01-19 18:54 ` pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-19 18:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2006-01-19 18:53 -------
Reducing.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25861
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/25861] tree check fail at c-common.c:2430
2006-01-19 18:46 [Bug c++/25861] New: tree check fail at c-common.c:2430 dcb314 at hotmail dot com
2006-01-19 18:48 ` [Bug c++/25861] " dcb314 at hotmail dot com
2006-01-19 18:53 ` pinskia at gcc dot gnu dot org
@ 2006-01-19 18:54 ` pinskia at gcc dot gnu dot org
2006-01-19 19:17 ` dcb314 at hotmail dot com
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-19 18:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2006-01-19 18:54 -------
This has been faling since at least 20051219.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25861
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/25861] tree check fail at c-common.c:2430
2006-01-19 18:46 [Bug c++/25861] New: tree check fail at c-common.c:2430 dcb314 at hotmail dot com
` (2 preceding siblings ...)
2006-01-19 18:54 ` pinskia at gcc dot gnu dot org
@ 2006-01-19 19:17 ` dcb314 at hotmail dot com
2006-01-19 20:16 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: dcb314 at hotmail dot com @ 2006-01-19 19:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from dcb314 at hotmail dot com 2006-01-19 19:17 -------
(In reply to comment #3)
> This has been faling since at least 20051219.
I rather suspect there would be a useful job for someone
to take each weekly snapshot of gcc 4.2 and make
sure it compiles some recentish distribution of Linux
from one of the big players like Suse or Redhat.
It would be an easy for anyone with access to a compile
farm.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25861
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/25861] tree check fail at c-common.c:2430
2006-01-19 18:46 [Bug c++/25861] New: tree check fail at c-common.c:2430 dcb314 at hotmail dot com
` (3 preceding siblings ...)
2006-01-19 19:17 ` dcb314 at hotmail dot com
@ 2006-01-19 20:16 ` pinskia at gcc dot gnu dot org
2006-01-19 20:18 ` [Bug c/25861] [4.2 Regression] " pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-19 20:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2006-01-19 20:16 -------
Semi reduced:
void f(void);
class PNotifierFunction
{
public:
PNotifierFunction(
void * obj
) {
void * object;
object = ((&(obj)&&(obj)!=__null)?(obj): (f(),(obj)));
}
};
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25861
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/25861] [4.2 Regression] tree check fail at c-common.c:2430
2006-01-19 18:46 [Bug c++/25861] New: tree check fail at c-common.c:2430 dcb314 at hotmail dot com
` (4 preceding siblings ...)
2006-01-19 20:16 ` pinskia at gcc dot gnu dot org
@ 2006-01-19 20:18 ` pinskia at gcc dot gnu dot org
2006-01-19 20:20 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-19 20:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2006-01-19 20:18 -------
Reduced C testcase:
int f(void *a)
{
return !(&a);
}
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|c++ |c
Ever Confirmed|0 |1
GCC host triplet|x86_64-suse-linux |
Keywords| |ice-on-valid-code
Last reconfirmed|0000-00-00 00:00:00 |2006-01-19 20:18:57
date| |
Summary|tree check fail at c- |[4.2 Regression] tree check
|common.c:2430 |fail at c-common.c:2430
Target Milestone|--- |4.2.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25861
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/25861] [4.2 Regression] tree check fail at c-common.c:2430
2006-01-19 18:46 [Bug c++/25861] New: tree check fail at c-common.c:2430 dcb314 at hotmail dot com
` (5 preceding siblings ...)
2006-01-19 20:18 ` [Bug c/25861] [4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-01-19 20:20 ` pinskia at gcc dot gnu dot org
2006-01-23 19:17 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-19 20:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pinskia at gcc dot gnu dot org 2006-01-19 20:20 -------
Caused by:
2005-12-14 Ben Elliston <bje@au.ibm.com>
* c-common.c (c_common_truthvalue_conversion): Generalise warning
for addresses converted to booleans; not just function addresses.
* c-typeck.c (build_binary_op): Warn for address comparisons which
can never be NULL (eg. func == NULL or &var == NULL).
* common.opt (Walways-true): New option.
* c-opts.c (c_common_handle_option): Set it with -Wall.
* doc/invoke.texi: Document it.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bje at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25861
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/25861] [4.2 Regression] tree check fail at c-common.c:2430
2006-01-19 18:46 [Bug c++/25861] New: tree check fail at c-common.c:2430 dcb314 at hotmail dot com
` (6 preceding siblings ...)
2006-01-19 20:20 ` pinskia at gcc dot gnu dot org
@ 2006-01-23 19:17 ` pinskia at gcc dot gnu dot org
2006-01-24 16:16 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-23 19:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from pinskia at gcc dot gnu dot org 2006-01-23 19:17 -------
This is easy to fix.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25861
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/25861] [4.2 Regression] tree check fail at c-common.c:2430
2006-01-19 18:46 [Bug c++/25861] New: tree check fail at c-common.c:2430 dcb314 at hotmail dot com
` (7 preceding siblings ...)
2006-01-23 19:17 ` pinskia at gcc dot gnu dot org
@ 2006-01-24 16:16 ` pinskia at gcc dot gnu dot org
2006-01-25 20:40 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-24 16:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from pinskia at gcc dot gnu dot org 2006-01-24 16:16 -------
The full patch (with some cleanup) is:
Index: c-common.c
===================================================================
--- c-common.c (revision 110173)
+++ c-common.c (working copy)
@@ -2456,25 +2456,26 @@ c_common_truthvalue_conversion (tree exp
case ADDR_EXPR:
{
- if (DECL_P (TREE_OPERAND (expr, 0))
- && !DECL_WEAK (TREE_OPERAND (expr, 0)))
+ tree inner = TREE_OPERAND (expr, 0);
+ if (DECL_P (inner)
+ && (TREE_CODE (inner) == PARM_DECL || !DECL_WEAK (inner)))
{
/* Common Ada/Pascal programmer's mistake. We always warn
about this since it is so bad. */
warning (OPT_Walways_true, "the address of %qD, will always
evaluate as %<true%>",
- TREE_OPERAND (expr, 0));
+ inner);
return truthvalue_true_node;
}
/* If we are taking the address of an external decl, it might be
zero if it is weak, so we cannot optimize. */
- if (DECL_P (TREE_OPERAND (expr, 0))
- && DECL_EXTERNAL (TREE_OPERAND (expr, 0)))
+ if (DECL_P (inner)
+ && DECL_EXTERNAL (inner))
break;
- if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 0)))
+ if (TREE_SIDE_EFFECTS (inner))
return build2 (COMPOUND_EXPR, truthvalue_type_node,
- TREE_OPERAND (expr, 0), truthvalue_true_node);
+ inner, truthvalue_true_node);
else
return truthvalue_true_node;
}
I am testing this right now.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25861
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/25861] [4.2 Regression] tree check fail at c-common.c:2430
2006-01-19 18:46 [Bug c++/25861] New: tree check fail at c-common.c:2430 dcb314 at hotmail dot com
` (8 preceding siblings ...)
2006-01-24 16:16 ` pinskia at gcc dot gnu dot org
@ 2006-01-25 20:40 ` pinskia at gcc dot gnu dot org
2006-01-26 14:59 ` pinskia at gcc dot gnu dot org
2006-01-26 15:00 ` pinskia at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-25 20:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from pinskia at gcc dot gnu dot org 2006-01-25 20:40 -------
Patch posted:
http://gcc.gnu.org/ml/gcc-patches/2006-01/msg01762.html
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2006-
| |01/msg01762.html
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25861
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/25861] [4.2 Regression] tree check fail at c-common.c:2430
2006-01-19 18:46 [Bug c++/25861] New: tree check fail at c-common.c:2430 dcb314 at hotmail dot com
` (9 preceding siblings ...)
2006-01-25 20:40 ` pinskia at gcc dot gnu dot org
@ 2006-01-26 14:59 ` pinskia at gcc dot gnu dot org
2006-01-26 15:00 ` pinskia at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-26 14:59 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from pinskia at gcc dot gnu dot org 2006-01-26 14:59 -------
Subject: Bug 25861
Author: pinskia
Date: Thu Jan 26 14:59:26 2006
New Revision: 110256
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110256
Log:
2006-01-26 Andrew Pinski <pinskia@physics.uc.edu>
PR C/25861
* c-common.c (c_common_truthvalue_conversion) <case ADDR_EXPR>:
Use a new variable, inner. PARM_DECLs are always non-weak.
2006-01-26 Andrew Pinski <pinskia@physics.uc.edu>
PR C/25861
* gcc.c-torture/compile/pr25861.c: New test.
Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr25861.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-common.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25861
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/25861] [4.2 Regression] tree check fail at c-common.c:2430
2006-01-19 18:46 [Bug c++/25861] New: tree check fail at c-common.c:2430 dcb314 at hotmail dot com
` (10 preceding siblings ...)
2006-01-26 14:59 ` pinskia at gcc dot gnu dot org
@ 2006-01-26 15:00 ` pinskia at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-26 15:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from pinskia at gcc dot gnu dot org 2006-01-26 14:59 -------
Fixed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25861
^ permalink raw reply [flat|nested] 13+ messages in thread