Bug 45982 - [4.4 Regression] PTA does not track integers
Summary: [4.4 Regression] PTA does not track integers
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.6.0
: P2 normal
Target Milestone: 4.5.4
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-12 11:41 UTC by Richard Biener
Modified: 2012-03-13 13:21 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 4.1.2, 4.5.2, 4.6.0
Known to fail: 4.2.4, 4.3.5, 4.4.3, 4.5.1
Last reconfirmed: 2010-10-12 11:42:03


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2010-10-12 11:41:20 UTC
#include <stdint.h>

extern void abort (void);

uintptr_t __attribute__((pure,noinline,noclone))
foo (int *a)
{
  return (uintptr_t) a;
}

void __attribute__((noinline,noclone))
bar (uintptr_t a)
{
  int *p = (int *)a;
  *p = 1;
}

int main()
{
  int t = 0;
  bar (foo (&t));
  if (t != 1)
    abort ();
  return 0;
}


Related to PR45967.
Comment 1 Richard Biener 2010-10-12 11:42:03 UTC
Mine.
Comment 2 Richard Biener 2010-10-12 11:55:02 UTC
Which means, gcc.dg/tree-ssa/pr24287{,-2}.c are bogus.
Comment 3 Richard Biener 2010-10-13 11:31:26 UTC
Author: rguenth
Date: Wed Oct 13 11:31:22 2010
New Revision: 165418

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165418
Log:
2010-10-13  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/45982
	* tree-ssa-structalias.c (make_constraints_to): New function.
	(make_constraint_to): Implement in terms of make_constraints_to.
	(find_func_aliases): Properly make return values of pure/const
	functions escape if they assign to sth that is not a pointer.

	* gcc.dg/torture/pr45982.c: New testcase.
	* gcc.dg/tree-ssa/pr24287.c: Adjust.
	* gcc.dg/tree-ssa/pta-callused.c: Likewise.
	* gcc.dg/torture/pr39074-2.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr45982.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/torture/pr39074-2.c
    trunk/gcc/testsuite/gcc.dg/tree-ssa/pr24287.c
    trunk/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c
    trunk/gcc/tree-ssa-structalias.c
Comment 4 Richard Biener 2010-10-13 11:33:54 UTC
Author: rguenth
Date: Wed Oct 13 11:33:51 2010
New Revision: 165419

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165419
Log:
2010-10-13  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/45982
	* tree-ssa-structalias.c (make_constraints_to): New function.
	(make_constraint_to): Implement in terms of make_constraints_to.
	(find_func_aliases): Properly make return values of pure/const
	functions escape if they assign to sth that is not a pointer.

	* gcc.dg/torture/pr45982.c: New testcase.
	* gcc.dg/tree-ssa/pr24287.c: Adjust.
	* gcc.dg/tree-ssa/pta-callused.c: Likewise.
	* gcc.dg/torture/pr39074-2.c: Likewise.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/torture/pr45982.c
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/torture/pr39074-2.c
    branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/tree-ssa/pr24287.c
    branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c
    branches/gcc-4_5-branch/gcc/tree-ssa-structalias.c
Comment 5 Richard Biener 2010-10-13 11:38:36 UTC
Fixed on trunk and the 4.5 branch sofar, backport is possible.
Comment 6 Richard Biener 2011-06-27 12:13:44 UTC
4.3 branch is being closed, moving to 4.4.7 target.
Comment 7 Jakub Jelinek 2012-03-13 13:21:49 UTC
Fixed in 4.5+, 4.4 is no longer supported.