--- Comment #11 from rguenth at gcc dot gnu dot org 2009-02-04 12:31
---
This one fails also on the branches that have PTA.
int i;
long __attribute__((noinline,const)) bar(int ***p) { return (long)p; }
extern void abort (void);
int main()
{
int j;
int *y = &j;
int **a = &y, **x;
--- Comment #10 from rguenth at gcc dot gnu dot org 2009-02-04 12:26
---
This one fails on trunk (where we fall back to anything for empty points-to
sets, so just add some unrelated &j and the vops are wrong):
int i;
long __attribute__((noinline,const)) bar(int ***p) { return (long)p;
--- Comment #9 from rguenth at gcc dot gnu dot org 2009-02-04 12:16 ---
Testcase that is not fixed with removing the short-cutting:
int i;
long __attribute__((noinline,const)) bar(int ***p) { return (long)p; }
void __attribute__((noinline))
foo(void)
{
int *y;
int **a = &y, **x;
i
--- Comment #8 from rguenther at suse dot de 2009-02-04 09:35 ---
Subject: Re: PTA constraint processing for *x
= y is wrong
On Wed, 4 Feb 2009, dberlin at dberlin dot org wrote:
> --- Comment #7 from dberlin at gcc dot gnu dot org 2009-02-04 00:29
> ---
> Subject: Re: PTA
--- Comment #7 from dberlin at gcc dot gnu dot org 2009-02-04 00:29 ---
Subject: Re: PTA constraint processing for *x =
y is wrong
On Tue, Feb 3, 2009 at 9:24 AM, rguenther at suse dot de
wrote:
>
>
> --- Comment #6 from rguenther at suse dot de 2009-02-03 14:24 ---
--- Comment #6 from rguenther at suse dot de 2009-02-03 14:24 ---
Subject: Re: PTA constraint processing for *x
= y is wrong
On Tue, 3 Feb 2009, dberlin at dberlin dot org wrote:
> Subject: Re: PTA constraint processing for *x =
> y is wrong
>
> There used to be a *ANYTHIN
--- Comment #5 from dberlin at gcc dot gnu dot org 2009-02-03 14:16 ---
Subject: Re: PTA constraint processing for *x =
y is wrong
There used to be a *ANYTHING = ANYTHING constraint + ANYTHING
containing all the variables pointing to ANYTHING that would have
taken care of this
--- Comment #4 from rguenth at gcc dot gnu dot org 2009-02-03 09:17 ---
Yes, but as the store to y is via *x and x points to { ANYTHING } (via the
non-pointer (int ***)q) only (as x already includes ANYTHING we do not add
a for the second constraint), so for *x = &i we fail to add a to y
--- Comment #3 from dberlin at gcc dot gnu dot org 2009-02-02 19:42 ---
Eyeballing this, I think y should not end up empty anyway.
Shouldn't it have i in it's points-to set?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39074
--- Comment #2 from rguenth at gcc dot gnu dot org 2009-02-02 14:07 ---
Created an attachment (id=17227)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17227&action=view)
patch to warn about uninitialized pointer dereferences
This patch causes a warning for both testcases, the prog
--- Comment #1 from rguenth at gcc dot gnu dot org 2009-02-02 14:03 ---
We could for example warn for
/* { dg-do compile } */
/* { dg-options "-O -Wuninitialized" } */
int i;
int __attribute((const,noinline))
foo (int **p)
{
return i;
}
int bar(int *q)
{
int *p;
*q = 0;
int j =
11 matches
Mail list logo