Hi, The patch is to enable shrink-wrap for TARGET_ARM and TARGET_THUMB2.
Bootstrapped and no make check regression. All previous Linaro shrink-wrap bugs (http://goo.gl/6fGg5) are verified. Is it OK? Thanks! -Zhenqiang ChangeLog: 2013-03-21 Bernd Schmidt <[email protected]> Zhenqiang Chen <[email protected]> * config/arm/arm-protos.h: Add and update function protos. * config/arm/arm.c (use_simple_return_p): New added. (thumb2_expand_return): Check simple_return flag. * config/arm/arm.md: Add simple_return and conditional simple_return. * config/arm/iterators.md: Add iterator for return and simple_return. testsuite/ChangeLog: 2013-03-21 Zhenqiang Chen <[email protected]> * gcc.dg/shrink-wrap-alloca.c: New added. * gcc.dg/shrink-wrap-pretend.c: New added. * gcc.dg/shrink-wrap-sibcall.c: New added.
2-enable-shrink-wrap-for-arm.patch
Description: Binary data
/* { dg-do compile } */
/* { dg-options "-O2 -g" } */
extern int * alloca(int);
int *p;
void test(int a)
{
if (a > 0)
p = alloca(4);
}
/* { dg-do compile } */
/* { dg-options "-O2 -g" } */
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#define DEBUG_BUFFER_SIZE 80
int unifi_debug = 5;
void unifi_trace(void* ospriv, int level, const char *fmt, ...)
{
static char s[DEBUG_BUFFER_SIZE];
va_list args;
unsigned int len;
if (!ospriv) return;
if(unifi_debug >= level)
{
va_start(args, fmt);
len = vsnprintf(&(s)[0], (DEBUG_BUFFER_SIZE), fmt, args);
va_end(args);
if (len >= DEBUG_BUFFER_SIZE)
{
(s)[DEBUG_BUFFER_SIZE - 2] = '\n';
(s)[DEBUG_BUFFER_SIZE - 1] = 0;
}
printf("%s", s);
}
}
/* { dg-do compile } */
/* { dg-options "-O2 -g" } */
unsigned char a, b, d, f, g;
int test();
int baz (int c)
{
if (c == 0) return test();
if (b & 1)
{
g = 0;
int e = (a & 0x0f) - (g & 0x0f);
if (!a) b |= 0x80;
a = e + test();
f = g/5 + a*3879 + b *2985;
}
else
{
f = g + a*39879 + b *25;
}
return test();
}
