public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/22555] New: array in struct disables salias subvars for other fields
@ 2005-07-19  8:58 rguenth at gcc dot gnu dot org
  2005-07-19  9:00 ` [Bug tree-optimization/22555] " 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 @ 2005-07-19  8:58 UTC (permalink / raw)
  To: gcc-bugs

struct {
        int i;
        int j;
        int x[2];
} a;

int foo(void)
{
        a.i = 1;
        a.j = 0;
        a.x[0] = 5;
        return a.i + a.j;
}

does not get optimized, because salias disables subvars for a
because it contains an array.  I have a simple patch in testing.

-- 
           Summary: array in struct disables salias subvars for other fields
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, alias
          Severity: enhancement
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug tree-optimization/22555] array in struct disables salias subvars for other fields
  2005-07-19  8:58 [Bug tree-optimization/22555] New: array in struct disables salias subvars for other fields rguenth at gcc dot gnu dot org
@ 2005-07-19  9:00 ` rguenth at gcc dot gnu dot org
  2005-07-22 18:22 ` pinskia 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 @ 2005-07-19  9:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at gcc dot gnu dot org  2005-07-19 08:57 -------
Which again uncovers latent bugs in IVOPTs.  Argh.

-- 


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


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

* [Bug tree-optimization/22555] array in struct disables salias subvars for other fields
  2005-07-19  8:58 [Bug tree-optimization/22555] New: array in struct disables salias subvars for other fields rguenth at gcc dot gnu dot org
  2005-07-19  9:00 ` [Bug tree-optimization/22555] " rguenth at gcc dot gnu dot org
@ 2005-07-22 18:22 ` pinskia at gcc dot gnu dot org
  2005-08-11 13:39 ` rguenth at gcc dot gnu dot org
  2005-09-07 15:25 ` cvs-commit at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-22 18:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-22 18:15 -------
Confirmed, a slightly smaller testcase:
struct a
{
  int i;
  int j;
  int x[2];
} a;
int foo(void)
{
  a.i = 1;
  a.j = 0;
  return a.i + a.j;
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-07-22 18:15:58
               date|                            |


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


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

* [Bug tree-optimization/22555] array in struct disables salias subvars for other fields
  2005-07-19  8:58 [Bug tree-optimization/22555] New: array in struct disables salias subvars for other fields rguenth at gcc dot gnu dot org
  2005-07-19  9:00 ` [Bug tree-optimization/22555] " rguenth at gcc dot gnu dot org
  2005-07-22 18:22 ` pinskia at gcc dot gnu dot org
@ 2005-08-11 13:39 ` rguenth at gcc dot gnu dot org
  2005-09-07 15:25 ` cvs-commit at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-08-11 13:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at gcc dot gnu dot org  2005-08-11 13:39 -------
Ok, patch finally has all latent problems fixed.  Maybe we can consider this for
4.2.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |23111
              nThis|                            |
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2005-
                   |                            |08/msg00685.html
           Keywords|                            |patch


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


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

* [Bug tree-optimization/22555] array in struct disables salias subvars for other fields
  2005-07-19  8:58 [Bug tree-optimization/22555] New: array in struct disables salias subvars for other fields rguenth at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-08-11 13:39 ` rguenth at gcc dot gnu dot org
@ 2005-09-07 15:25 ` cvs-commit at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-07 15:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-09-07 15:25 -------
Subject: Bug 22555

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	improved-aliasing-branch
Changes by:	rguenth@gcc.gnu.org	2005-09-07 15:25:13

Modified files:
	gcc            : tree-dfa.c tree-ssa-alias.c 
	                 tree-ssa-loop-ivopts.c tree-ssa-loop.c 
	                 tree-ssa-operands.c tree-ssa-structalias.c 
Added files:
	gcc            : ChangeLog.iab 
	gcc/testsuite  : ChangeLog.iab 
	gcc/testsuite/gcc.dg/tree-ssa: alias-3.c 

Log message:
	2005-09-07  Richard Guenther  <rguenther@suse.de>
	
	PR tree-optimization/22555
	* tree-dfa.c (okay_component_ref_for_subvars): Do not give up,
	if one structure field is an array.
	* tree-ssa-alias.c (create_overlap_variables_for): Likewise.
	* tree-ssa-structalias.c (create_variable_info_for): Likewise.
	(get_constraint_for_component_ref): Do not assert we can not
	only be accessing padding if we deal with an ARRAY_REF.
	* tree-ssa-loop-ivopts.c (rewrite_use): Mark new vars in stmt
	for renaming.
	* tree-ssa-loop.c (pass_iv_optimize): Schedule TODO_update_ssa.
	* tree-ssa-operands.c (get_expr_operands): Continue scanning
	operands even if we found a subvar, but ignore VOPs in this
	case.
	
	* gcc.dg/tree-ssa/alias-3.c: New testcase.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.iab.diff?cvsroot=gcc&only_with_tag=improved-aliasing-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-dfa.c.diff?cvsroot=gcc&only_with_tag=improved-aliasing-branch&r1=2.63&r2=2.63.4.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-alias.c.diff?cvsroot=gcc&only_with_tag=improved-aliasing-branch&r1=2.109&r2=2.109.4.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-loop-ivopts.c.diff?cvsroot=gcc&only_with_tag=improved-aliasing-branch&r1=2.87&r2=2.87.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-loop.c.diff?cvsroot=gcc&only_with_tag=improved-aliasing-branch&r1=2.33.6.1&r2=2.33.6.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-operands.c.diff?cvsroot=gcc&only_with_tag=improved-aliasing-branch&r1=2.100&r2=2.100.4.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-structalias.c.diff?cvsroot=gcc&only_with_tag=improved-aliasing-branch&r1=2.27&r2=2.27.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.iab.diff?cvsroot=gcc&only_with_tag=improved-aliasing-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/alias-3.c.diff?cvsroot=gcc&only_with_tag=improved-aliasing-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

end of thread, other threads:[~2005-09-07 15:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-19  8:58 [Bug tree-optimization/22555] New: array in struct disables salias subvars for other fields rguenth at gcc dot gnu dot org
2005-07-19  9:00 ` [Bug tree-optimization/22555] " rguenth at gcc dot gnu dot org
2005-07-22 18:22 ` pinskia at gcc dot gnu dot org
2005-08-11 13:39 ` rguenth at gcc dot gnu dot org
2005-09-07 15:25 ` cvs-commit 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).