public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/36347]  New: points-to sets should be always kept for call-clobbering
@ 2008-05-27 13:42 rguenth at gcc dot gnu dot org
  2008-05-28  8:58 ` [Bug tree-optimization/36347] " rguenth at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-05-27 13:42 UTC (permalink / raw)
  To: gcc-bugs

typedef unsigned long my_uintptr_t;

int check_a(my_uintptr_t tagged_ptr);

int __attribute__((noinline)) try_a(my_uintptr_t x)
{
  my_uintptr_t heap[2];
  my_uintptr_t *hp = heap;

  hp[0] = x;
  hp[1] = 0;
  return check_a((my_uintptr_t)(void*)((char*)hp + 1));
}


<bb 2>:
  # heap_10 = VDEF <heap_9(D)>
  heap[0] = x_2(D);
  # heap_11 = VDEF <heap_10>
  heap[1] = 0;
  D.1562_4 = &heap + 1;
  D.1563_5 = (long unsigned int) D.1562_4;
  # heap_12 = VDEF <heap_11>
  D.1561_6 = check_a (D.1563_5);
  return D.1561_6;


The points-to solution for D.1562_4 is D.1562_4 = { heap }, but we drop
that to

D.1562_4, its value escapes, points-to anything

because the pointer is never dereferenced.  This causes all addressable
variables to escape at the call to check_a, which pessimizes code and
causes useless VOPs.


-- 
           Summary: points-to sets should be always kept for call-clobbering
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, alias
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/36347] points-to sets should be always kept for call-clobbering
  2008-05-27 13:42 [Bug tree-optimization/36347] New: points-to sets should be always kept for call-clobbering rguenth at gcc dot gnu dot org
@ 2008-05-28  8:58 ` rguenth at gcc dot gnu dot org
  2008-05-29 10:33 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-05-28  8:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2008-05-28 08:58 -------
I have a fix (fixing PR36346 fixes this as well).


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |36346
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-05-28 08:58:13
               date|                            |


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/36347] points-to sets should be always kept for call-clobbering
  2008-05-27 13:42 [Bug tree-optimization/36347] New: points-to sets should be always kept for call-clobbering rguenth at gcc dot gnu dot org
  2008-05-28  8:58 ` [Bug tree-optimization/36347] " rguenth at gcc dot gnu dot org
@ 2008-05-29 10:33 ` rguenth at gcc dot gnu dot org
  2008-05-29 10:33 ` rguenth at gcc dot gnu dot org
  2008-05-30 19:53 ` rguenth at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-05-29 10:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2008-05-29 10:32 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.4.0


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/36347] points-to sets should be always kept for call-clobbering
  2008-05-27 13:42 [Bug tree-optimization/36347] New: points-to sets should be always kept for call-clobbering rguenth at gcc dot gnu dot org
  2008-05-28  8:58 ` [Bug tree-optimization/36347] " rguenth at gcc dot gnu dot org
  2008-05-29 10:33 ` rguenth at gcc dot gnu dot org
@ 2008-05-29 10:33 ` rguenth at gcc dot gnu dot org
  2008-05-30 19:53 ` rguenth at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-05-29 10:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2008-05-29 10:32 -------
Subject: Bug 36347

Author: rguenth
Date: Thu May 29 10:31:58 2008
New Revision: 136152

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136152
Log:
2008-05-29  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/36343
        PR tree-optimization/36346
        PR tree-optimization/36347
        * tree-flow.h (clobber_what_p_points_to): Declare.
        * tree-ssa-structalias.c (set_uids_in_ptset): Whether the
        pointed-to variable is dereferenced is irrelevant to whether
        the pointer can access the pointed-to variable.
        (clobber_what_p_points_to): New function.
        * tree-ssa-alias.c (set_initial_properties): Use it.
        * tree-ssa.c (verify_flow_sensitive_alias_info): Adjust
        call clobber check for NMTs.

        * gcc.c-torture/execute/pr36343.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/pr36343.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-flow.h
    trunk/gcc/tree-ssa-alias.c
    trunk/gcc/tree-ssa-structalias.c
    trunk/gcc/tree-ssa.c


-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/36347] points-to sets should be always kept for call-clobbering
  2008-05-27 13:42 [Bug tree-optimization/36347] New: points-to sets should be always kept for call-clobbering rguenth at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-05-29 10:33 ` rguenth at gcc dot gnu dot org
@ 2008-05-30 19:53 ` rguenth at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-05-30 19:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2008-05-30 19:52 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-05-30 19:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-27 13:42 [Bug tree-optimization/36347] New: points-to sets should be always kept for call-clobbering rguenth at gcc dot gnu dot org
2008-05-28  8:58 ` [Bug tree-optimization/36347] " rguenth at gcc dot gnu dot org
2008-05-29 10:33 ` rguenth at gcc dot gnu dot org
2008-05-29 10:33 ` rguenth at gcc dot gnu dot org
2008-05-30 19:53 ` rguenth 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).