public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/23777] New: Does not remove all references to var
@ 2005-09-08 9:59 rguenth at gcc dot gnu dot org
2005-09-08 10:01 ` [Bug tree-optimization/23777] " rguenth at gcc dot gnu dot org
` (5 more replies)
0 siblings, 6 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-09-08 9:59 UTC (permalink / raw)
To: gcc-bugs
The tree optimizers cannot remove all references to multilib_exclusions_var,
while RTL does.
--
Summary: Does not remove all references to var
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: missed-optimization, TREE
Severity: normal
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=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
* [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 ` [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
` (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
` (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
` (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
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).