Summary: | [4.2 Regression] Wrong aliasing with global var grouping during call clobbering | ||
---|---|---|---|
Product: | gcc | Reporter: | Richard Biener <rguenth> |
Component: | tree-optimization | Assignee: | Diego Novillo <dnovillo> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | dberlin, gcc-bugs, mueller, pinskia |
Priority: | P3 | Keywords: | alias, wrong-code |
Version: | 4.2.0 | ||
Target Milestone: | 4.2.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2006-07-17 13:30:56 |
Description
Richard Biener
2006-07-17 12:51:12 UTC
Oh - build with -O2 --param global-var-threshold=1 Runnable testcase: extern void abort(void); struct Bar { int p; }; struct Foo { struct Bar *p; }; struct Bar p0 = { 0 }; struct Bar p1 = { 1 }; void bar(struct Foo *f) { f->p = &p0; } int foo(struct Foo *f) { f->p->p = 1; bar(f); return f->p->p; } int main() { struct Foo f; f.p = &p1; if (foo(&f) != 0) abort (); return 0; } Testing patch. The bug was in the alias pruning code. We need to handle .GLOBAL_VAR in access_can_touch_variable. A memory reference that uses a call-clobbered memory tag should always be considered to touch .GLOBAL_VAR. Subject: Re: [4.2 Regression] Wrong aliasing
with global var grouping during call clobbering
dnovillo at gcc dot gnu dot org wrote:
> ------- Comment #3 from dnovillo at gcc dot gnu dot org 2006-07-18 13:25 -------
>
> Testing patch. The bug was in the alias pruning code. We need to handle
> .GLOBAL_VAR in access_can_touch_variable. A memory reference that uses a
> call-clobbered memory tag should always be considered to touch .GLOBAL_VAR.
Yay for random invariants!
Subject: Bug 28410 Author: dnovillo Date: Tue Jul 18 17:27:57 2006 New Revision: 115564 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115564 Log: PR 28410 * tree-ssa-operands.c (access_can_touch_variable): Update comment. Return true if ALIAS is .GLOBAL_VAR. testsuite/ChangeLog PR 28410 * gcc.dg/tree-ssa/pr28410.c: New test. Added: trunk/gcc/testsuite/gcc.dg/tree-ssa/pr28410.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-operands.c |