This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/20641] New: Missed optimization on the tree level (malloc attribute)
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Mar 2005 20:59:21 -0000
- Subject: [Bug tree-optimization/20641] New: Missed optimization on the tree level (malloc attribute)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Give the following code, we don't optimize it on the tree level:
typedef __SIZE_TYPE__ size_t;
extern void link_error();
extern void *f (size_t) __attribute__((__malloc__));
static int x;
void test3(void)
{
int *ptr1, *ptr2;
ptr1 = &x;
ptr2 = (int*) f(sizeof (int));
*ptr1 = 12;
*ptr2 = 8;
if (*ptr1 != 12)
link_error(); //<-- This should be gone
}
--
Summary: Missed optimization on the tree level (malloc attribute)
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: missed-optimization, TREE
Severity: enhancement
Priority: P2
Component: tree-optimization
AssignedTo: unassigned 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=20641