public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/23777] Does not remove all references to var
       [not found] <bug-23777-10053@http.gcc.gnu.org/bugzilla/>
@ 2006-01-11  5:49 ` pinskia at gcc dot gnu dot org
  2007-03-05 16:55 ` rguenth at gcc dot gnu dot org
  2007-03-05 16:56 ` rguenth at gcc dot gnu dot org
  2 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-11  5:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2006-01-11 05:49 -------
Actually there is a call clobbering issue here or something like that because I
see now where the address of multilib_exclusions_raw escaping (I have to look
where we mark the variable as call clobbering).


-- 


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



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

* [Bug tree-optimization/23777] Does not remove all references to var
       [not found] <bug-23777-10053@http.gcc.gnu.org/bugzilla/>
  2006-01-11  5:49 ` [Bug tree-optimization/23777] Does not remove all references to var pinskia at gcc dot gnu dot org
@ 2007-03-05 16:55 ` rguenth at gcc dot gnu dot org
  2007-03-05 16:56 ` rguenth at gcc dot gnu dot org
  2 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-03-05 16:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from rguenth at gcc dot gnu dot org  2007-03-05 16:55 -------
Subject: Bug 23777

Author: rguenth
Date: Mon Mar  5 16:55:23 2007
New Revision: 122558

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

        PR tree-optimization/23777
        * gcc.dg/tree-ssa/pr23777.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/pr23777.c
Modified:
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug tree-optimization/23777] Does not remove all references to var
       [not found] <bug-23777-10053@http.gcc.gnu.org/bugzilla/>
  2006-01-11  5:49 ` [Bug tree-optimization/23777] Does not remove all references to var pinskia at gcc dot gnu dot org
  2007-03-05 16:55 ` rguenth at gcc dot gnu dot org
@ 2007-03-05 16:56 ` rguenth at gcc dot gnu dot org
  2 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-03-05 16:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from rguenth at gcc dot gnu dot org  2007-03-05 16:56 -------
This is fixed now on the mainline.  Supposedly by

Author: dnovillo
Date: Fri Mar  2 19:20:14 2007
New Revision: 122484

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122484
Log:

        * tree-ssa-structalias.c (could_have_pointers): Tidy.
        (get_constraint_for): Likewise.
        (do_structure_copy): Likewise.
        (find_func_aliases): Fix references to MODIFY_EXPR.
        (intra_create_variable_infos): Tidy.
        * tree-ssa-operands.c (add_virtual_operand): Add argument
        IS_CALL_SITE.
        When adding members of alias sets, if IS_CALL_SITE is true and
        the symbol is not call-clobbered, skip it.
        Adjust all callers.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


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


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

* [Bug tree-optimization/23777] Does not remove all references to var
  2005-09-08  9:59 [Bug tree-optimization/23777] New: " rguenth at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-09-08 12:10 ` pinskia at gcc dot gnu dot org
@ 2005-09-08 18:26 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-08 18:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-08 18:26 -------
There is another way of fixing this to force ccp do look at those array references even though the 
statement has aliased loads.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement


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


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

* [Bug tree-optimization/23777] Does not remove all references to var
  2005-09-08  9:59 [Bug tree-optimization/23777] New: " rguenth at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-09-08 12:06 ` pinskia at gcc dot gnu dot org
@ 2005-09-08 12:10 ` pinskia at gcc dot gnu dot org
  2005-09-08 18:26 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-08 12:10 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-08 12:09 -------
With Paolo's testcase we get the following tree dump in .ch (after copy loop header):
g (o)
{
  static const char * const multilib_exclusions_raw[1] = {0B};
  const char * const * q;
  static const char * const multilib_exclusions_raw[1] = {0B};
  _Bool D.1280;
  const char * const D.1279;

<bb 0>:
  #   multilib_exclusions_raw_11 = V_MAY_DEF <multilib_exclusions_raw_9>;
  #   TMT.6_12 = V_MAY_DEF <TMT.6_10>;
  f (o_3);
  #   VUSE <multilib_exclusions_raw_11>;
  D.1279_18 = multilib_exclusions_raw[0];
  q_19 = &multilib_exclusions_raw[1];
  if (D.1279_18 != 0B) goto <L0>; else goto <L2>;

  # TMT.6_22 = PHI <TMT.6_14(1), TMT.6_12(0)>;
  # multilib_exclusions_raw_21 = PHI <multilib_exclusions_raw_13(1), multilib_exclusions_raw_11(0)>;
  # q_20 = PHI <q_6(1), q_19(0)>;
<L0>:;
  #   multilib_exclusions_raw_13 = V_MAY_DEF <multilib_exclusions_raw_21>;
  #   TMT.6_14 = V_MAY_DEF <TMT.6_22>;
  f (o_3);
  #   VUSE <multilib_exclusions_raw_13>;
  #   VUSE <TMT.6_14>;
  D.1279_4 = *q_20;
  q_6 = q_20 + 4B;
  if (D.1279_4 != 0B) goto <L0>; else goto <L2>;

<L2>:;
  return;


Note how there is a V_MAY_DEF on the first f for multilib_exclusions_raw.  That is just wrong since 
multilib_exclusions_raw cannot change.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |alias


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


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

* [Bug tree-optimization/23777] Does not remove all references to var
  2005-09-08  9:59 [Bug tree-optimization/23777] New: " rguenth at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-09-08 12:03 ` bonzini at gcc dot gnu dot org
@ 2005-09-08 12:06 ` pinskia at gcc dot gnu dot org
  2005-09-08 12:10 ` pinskia at gcc dot gnu dot org
  2005-09-08 18:26 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-08 12:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-08 12:04 -------
Reduced testcase:
static const char *const multilib_exclusions_raw[] = {0};
struct obstack {
  char *next_free;
};
static struct obstack multilib_obstack;
int main (int argc, const char **argv)
{
  const char *p;
  const char *const *q;
  f();
  q = multilib_exclusions_raw;
  while ((p = *q++) != (char *) 0)
  {   
    int __len = (__builtin_strlen (p));
    __builtin_memcpy ((multilib_obstack.next_free), 0, (__len));    
  }
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-09-08 12:04:06
               date|                            |


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


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

* [Bug tree-optimization/23777] Does not remove all references to var
  2005-09-08  9:59 [Bug tree-optimization/23777] New: " rguenth at gcc dot gnu dot org
  2005-09-08 10:01 ` [Bug tree-optimization/23777] " rguenth at gcc dot gnu dot org
  2005-09-08 10:06 ` rguenth at gcc dot gnu dot org
@ 2005-09-08 12:03 ` bonzini at gcc dot gnu dot org
  2005-09-08 12:06 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-09-08 12:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bonzini at gcc dot gnu dot org  2005-09-08 12:02 -------
Even more reduced:

extern void f(char *const *);
void g (char **o)
{
  static const char *const multilib_exclusions_raw[] = { 0 };
  const char *const *q = multilib_exclusions_raw;

  f (o);
  while (*q++)
    f (o);
}

The strange thing is, turn the loop into do...while, and it cannot eliminate
multilib_exclusions_raw not even at the RTL level.  Actually it cannot eliminate
the loop at all if it is a do...while.

Paolo

-- 


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


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

* [Bug tree-optimization/23777] Does not remove all references to var
  2005-09-08  9:59 [Bug tree-optimization/23777] New: " rguenth at gcc dot gnu dot org
  2005-09-08 10:01 ` [Bug tree-optimization/23777] " rguenth at gcc dot gnu dot org
@ 2005-09-08 10:06 ` rguenth at gcc dot gnu dot org
  2005-09-08 12:03 ` bonzini at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-09-08 10:06 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org


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


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

* [Bug tree-optimization/23777] Does not remove all references to var
  2005-09-08  9:59 [Bug tree-optimization/23777] New: " rguenth at gcc dot gnu dot org
@ 2005-09-08 10:01 ` rguenth at gcc dot gnu dot org
  2005-09-08 10:06 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-09-08 10:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at gcc dot gnu dot org  2005-09-08 10:00 -------
Created an attachment (id=9689)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9689&action=view)
reduced testcase from gcc.i

Testcase.  Compile with -O2, compare asm and tree-vars dump.
Note: testcase contains uses of uninitialized variables.

-- 


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


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

end of thread, other threads:[~2007-03-05 16:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-23777-10053@http.gcc.gnu.org/bugzilla/>
2006-01-11  5:49 ` [Bug tree-optimization/23777] Does not remove all references to var pinskia at gcc dot gnu dot org
2007-03-05 16:55 ` rguenth at gcc dot gnu dot org
2007-03-05 16:56 ` rguenth at gcc dot gnu dot org
2005-09-08  9:59 [Bug tree-optimization/23777] New: " rguenth at gcc dot gnu dot org
2005-09-08 10:01 ` [Bug tree-optimization/23777] " rguenth at gcc dot gnu dot org
2005-09-08 10:06 ` rguenth at gcc dot gnu dot org
2005-09-08 12:03 ` bonzini at gcc dot gnu dot org
2005-09-08 12:06 ` pinskia at gcc dot gnu dot org
2005-09-08 12:10 ` pinskia at gcc dot gnu dot org
2005-09-08 18:26 ` pinskia 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).