This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/29751] New: Missed optimization of restrict pointer assigned value
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Nov 2006 13:10:10 -0000
- Subject: [Bug tree-optimization/29751] New: Missed optimization of restrict pointer assigned value
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In the following program, the if() is only removed if one removes the line
"r[1]=0;". (4.3.0 20061107; x86_64-unknown-linux-gnu-gcc)
#include <stdlib.h>
void foo (void);
int main() {
int *restrict r;
r = malloc(2*sizeof(int));
r[0] = 0;
r[1] = 0;
if(r[0]) foo();
return 0;
}
main ()
{
int * restrict r;
void * D.1998;
<bb 2>:
D.1998 = malloc (8);
r = (int * restrict) D.1998;
*r = 0;
*(r + 4B) = 0;
if (*r != 0) goto <L0>; else goto <L1>;
<L0>:;
foo ();
<L1>:;
return 0;
}
--
Summary: Missed optimization of restrict pointer assigned value
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29751