public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/22335] New: DOM creates missed matched types
@ 2005-07-07 0:36 pinskia at gcc dot gnu dot org
2005-07-07 0:39 ` [Bug tree-optimization/22335] " pinskia at gcc dot gnu dot org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-07 0:36 UTC (permalink / raw)
To: gcc-bugs
Take the following C code (and compile it at -O1 -fdelete-null-pointer-checks) :
int t(int *a)
{
int i;
*a = 1;
i = a == 0;
return i;
}
We get the wrong type for the rhs of the modify statement of i:
t1.c: In function 't':
t1.c:2: error: statement types mismatch
iD.1266_2 = 0;
intD.0
_BoolD.1063
--
Summary: DOM creates missed matched types
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22335
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/22335] DOM creates missed matched types
2005-07-07 0:36 [Bug tree-optimization/22335] New: DOM creates missed matched types pinskia at gcc dot gnu dot org
@ 2005-07-07 0:39 ` pinskia at gcc dot gnu dot org
2005-07-07 0:40 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-07 0:39 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-07 00:39 -------
Created an attachment (id=9219)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9219&action=view)
Patch which is used to find this
Note this was reduced from tree-cfg.c, the reason why VRP did not find this in
tree-cfg.c is because had SRA'd yet so we did know that the value was the same
yet.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22335
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/22335] DOM creates missed matched types
2005-07-07 0:36 [Bug tree-optimization/22335] New: DOM creates missed matched types pinskia at gcc dot gnu dot org
2005-07-07 0:39 ` [Bug tree-optimization/22335] " pinskia at gcc dot gnu dot org
@ 2005-07-07 0:40 ` pinskia at gcc dot gnu dot org
2005-07-07 1:04 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-07 0:40 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |law at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22335
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/22335] DOM creates missed matched types
2005-07-07 0:36 [Bug tree-optimization/22335] New: DOM creates missed matched types pinskia at gcc dot gnu dot org
2005-07-07 0:39 ` [Bug tree-optimization/22335] " pinskia at gcc dot gnu dot org
2005-07-07 0:40 ` pinskia at gcc dot gnu dot org
@ 2005-07-07 1:04 ` pinskia at gcc dot gnu dot org
2005-07-08 18:43 ` [Bug tree-optimization/22335] DOM creates mis-matched types pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-07 1:04 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-07 01:04 -------
I have a patch to fix this.
The bug is in lookup_avail_expr.
It only returns boolean_false_node/boolean_true_node which is wrong.
It should be using constant_boolean_node instead.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-07-07 01:04:39
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22335
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/22335] DOM creates mis-matched types
2005-07-07 0:36 [Bug tree-optimization/22335] New: DOM creates missed matched types pinskia at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-07-07 1:04 ` pinskia at gcc dot gnu dot org
@ 2005-07-08 18:43 ` pinskia at gcc dot gnu dot org
2005-07-08 19:13 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-08 18:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-08 18:43 -------
Another testcase for a different related problem but still in DOM:
void abort(void) __attribute__((__noreturn__));
typedef struct {
int container;
} edge_iterator;
struct ls_expr
{
int index;
int stores;
struct ls_expr * next;
};
struct ls_expr * pre_ldst_mems;
edge_iterator ei;
void
store_motion (void)
{
struct ls_expr * ptr, **prev_next_ptr_ptr;
edge_iterator ei1;
edge_iterator ei2;
int a = ptr != ((void *)0);
for (ptr = pre_ldst_mems, prev_next_ptr_ptr = &pre_ldst_mems;
ptr != ((void *)0);
ptr = *prev_next_ptr_ptr)
if (!((ptr)->stores))
*prev_next_ptr_ptr = ptr->next;
else
prev_next_ptr_ptr = &ptr->next;
for (ptr = pre_ldst_mems; ptr != 0; ptr = ptr->next)
;
ei1 = ei;
ei2 = ei1;
if (!ei2.container)
abort ();
ei2 = ei1;
if (!ei2.container)
abort ();
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22335
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/22335] DOM creates mis-matched types
2005-07-07 0:36 [Bug tree-optimization/22335] New: DOM creates missed matched types pinskia at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-07-08 18:43 ` [Bug tree-optimization/22335] DOM creates mis-matched types pinskia at gcc dot gnu dot org
@ 2005-07-08 19:13 ` pinskia at gcc dot gnu dot org
2005-07-12 17:03 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-08 19:13 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-08 19:12 -------
Patch posted here: <http://gcc.gnu.org/ml/gcc-patches/2005-07/msg00593.html>.
--
What |Removed |Added
----------------------------------------------------------------------------
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2005-
| |07/msg00593.html
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22335
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/22335] DOM creates mis-matched types
2005-07-07 0:36 [Bug tree-optimization/22335] New: DOM creates missed matched types pinskia at gcc dot gnu dot org
` (6 preceding siblings ...)
2005-07-12 17:03 ` pinskia at gcc dot gnu dot org
@ 2005-07-12 17:03 ` cvs-commit at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-07-12 17:03 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-07-12 17:03 -------
Subject: Bug 22335
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: pinskia@gcc.gnu.org 2005-07-12 17:02:54
Modified files:
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gcc.dg: pr22335-1.c pr22335-2.c
Log message:
2005-07-12 Andrew Pinski <pinskia@physics.uc.edu>
PR tree-opt/22335
* gcc.dg/pr22335-1.c: New test.
* gcc.dg/pr22335-2.c: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5753&r2=1.5754
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr22335-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr22335-2.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22335
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/22335] DOM creates mis-matched types
2005-07-07 0:36 [Bug tree-optimization/22335] New: DOM creates missed matched types pinskia at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-07-08 19:13 ` pinskia at gcc dot gnu dot org
@ 2005-07-12 17:03 ` cvs-commit at gcc dot gnu dot org
2005-07-12 17:03 ` pinskia at gcc dot gnu dot org
2005-07-12 17:03 ` cvs-commit at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-07-12 17:03 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-07-12 17:00 -------
Subject: Bug 22335
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: pinskia@gcc.gnu.org 2005-07-12 17:00:03
Modified files:
gcc : ChangeLog tree-ssa-dom.c
Log message:
2005-07-12 Andrew Pinski <pinskia@physics.uc.edu>
PR tree-opt/22335
* tree-ssa-dom.c (eliminate_redundant_computations): Reject the prop if
requiring a cast in a non RHS of modify_expr. Add a cast when required.
(lookup_avail_expr): Use constant_boolean_node instead
of boolean_false_node/boolean_true_node.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9417&r2=2.9418
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-dom.c.diff?cvsroot=gcc&r1=2.121&r2=2.122
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22335
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/22335] DOM creates mis-matched types
2005-07-07 0:36 [Bug tree-optimization/22335] New: DOM creates missed matched types pinskia at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-07-12 17:03 ` cvs-commit at gcc dot gnu dot org
@ 2005-07-12 17:03 ` pinskia at gcc dot gnu dot org
2005-07-12 17:03 ` cvs-commit at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-12 17:03 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-12 17:02 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22335
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2005-07-12 17:03 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-07 0:36 [Bug tree-optimization/22335] New: DOM creates missed matched types pinskia at gcc dot gnu dot org
2005-07-07 0:39 ` [Bug tree-optimization/22335] " pinskia at gcc dot gnu dot org
2005-07-07 0:40 ` pinskia at gcc dot gnu dot org
2005-07-07 1:04 ` pinskia at gcc dot gnu dot org
2005-07-08 18:43 ` [Bug tree-optimization/22335] DOM creates mis-matched types pinskia at gcc dot gnu dot org
2005-07-08 19:13 ` pinskia at gcc dot gnu dot org
2005-07-12 17:03 ` cvs-commit at gcc dot gnu dot org
2005-07-12 17:03 ` pinskia at gcc dot gnu dot org
2005-07-12 17:03 ` cvs-commit 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).