public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
[parent not found: <bug-23659-4@http.gcc.gnu.org/bugzilla/>]
* [Bug tree-optimization/23659] New: Should able to add dereferencing (statements with VUSE) without rerunning may_alias
@ 2005-08-31 17:00 pinskia at gcc dot gnu dot org
  2005-08-31 17:02 ` [Bug tree-optimization/23659] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-31 17:00 UTC (permalink / raw)
  To: gcc-bugs

An example of this comes from PR 18298:
extern "C" int strcmp (const char*, const char*);

char s[2048] = "a";

inline bool foo(const char *str) {
  return !strcmp(s,str);
}
int main() {
  while(!(foo(""))) {
    s[0] = '\0';
  }
  return 0;
}

In fab, we replace:
  #   VUSE <s_1>;
  D.1754_4 = strcmp (&s[0], &""[0]);

With   
  D.1777_6 = (const unsigned char *) &s[0];
  D.1778_9 = *D.1777_6;
  D.1779_3 = (int) D.1778_9;
  D.1754_4 = D.1779_3;

And the "  D.1778_9 = *D.1777_6;" statement does not have a VUSE which causes wrong code if we 
have a V_MAY_DEF/V_MUST_DEF above (which happens in the testcase).

The main reason why I am asking this question so that in the tree combiner, I don't want to rerun 
may_alias after each time I run the tree combiner which just becomes too expensive.

An example for the tree combiner would be:
int f(char *a)
{
  int b = strlen(a);
  return b == 0;
}

-- 
           Summary: Should able to add dereferencing (statements with VUSE)
                    without rerunning may_alias
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: tree-optimization
        AssignedTo: dnovillo at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2021-05-04 12:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-23659-6528@http.gcc.gnu.org/bugzilla/>
2005-11-12  5:32 ` [Bug tree-optimization/23659] Should able to add dereferencing (statements with VUSE) without rerunning may_alias pinskia at gcc dot gnu dot org
2006-03-01 12:10 ` rakdver at gcc dot gnu dot org
2006-03-01 14:30 ` dnovillo at gcc dot gnu dot org
     [not found] <bug-23659-4@http.gcc.gnu.org/bugzilla/>
2021-05-04 12:04 ` rguenth at gcc dot gnu.org
2005-08-31 17:00 [Bug tree-optimization/23659] New: " pinskia at gcc dot gnu dot org
2005-08-31 17:02 ` [Bug tree-optimization/23659] " pinskia at gcc dot gnu dot org
2005-08-31 21:41 ` steven at gcc dot gnu dot org
2005-08-31 21:57 ` dnovillo 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).