This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/21173] [4.0/4.1 regression] miscompiled pointer subtraction broke Linux kernel


------- Additional Comments From dberlin at gcc dot gnu dot org  2005-04-24 15:27 -------
Subject: Re:  [4.0/4.1 regression] miscompiled
	pointer subtraction broke Linux kernel


> tree-ssa-pre uses force_gimple_operand with SIMPLE==false, so if
> expr is already a valid rhs, force_gimple_operand should do nothing.
> If it does, I consider that to be a bug.
> 
> Your patch to use unshare_expr is IMHO unnecessarily expensive.
> 
> 
> 

Here's the gdb trace, btw:

 Breakpoint 3, create_expression_by_pieces (block=0x400c4870,
expr=0x88403f0, stmts=0x400c6510) at tree-ssa-pre.c:1322

expr came from a node in ANTIC_IN, we *can't* modify it, because it's
not a copy.


(gdb) p debug_generic_stmt (expr)
(charD.3 *) &0B->typeD.1681;
...

1388            newexpr = force_gimple_operand (folded,
(gdb) n
1390            if (forced_stmts)
(gdb) p debug_generic_stmt (expr)
(charD.3 *) &D.1708_3->typeD.1681;

tada!


This is the reason we have to unshare it before passing it in.




-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21173


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]