Backport PRs 42859, 43107, 43164, 43165, 43166, 43180, 43188, 43191, 43209, 43229 and more

Backport testcases from mainline.

2010-03-13  H.J. Lu  <hongjiu.lu@intel.com>

	Backport from mainline:
	2010-03-11  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/43257
	* g++.dg/torture/pr43257.C: New test.

	2010-03-11  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/43255
	* gcc.c-torture/compile/pr43255.c: New testcase.

	2010-03-11  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* gcc.dg/pr43280.c: New testcase.

	2010-03-10  Jan Hubicka   <jh@suse.cz>

	* gcc.c-torture/compile/pr43288.c: New test.

	2010-03-10  Andrey Belevantsev  <abel@ispras.ru>

	PR middle-end/42859
	* g++.dg/eh/pr42859.C: New test.

	2010-03-09  Jakub Jelinek  <jakub@redhat.com>

	PR debug/43299
	* gcc.dg/pr43299.c: New test.

	2010-03-08  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/43269
	* gcc.c-torture/execute/pr43269.c: New testcase.

	2010-03-04  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/43164
	PR tree-optimization/43191
	* gcc.c-torture/compile/pr43164.c: New test.
	* gcc.c-torture/compile/pr43191.c: Likewise.

	2010-03-04  Changpeng Fang  <changpeng.fang@amd.com>

	PR middle-end/43209
	* gcc.dg/tree-ssa/ivopts-4.c: New.

	2010-03-03  Jakub Jelinek  <jakub@redhat.com>

	PR debug/43229
	* gfortran.dg/pr43229.f90: New test.

	PR debug/43237
	* gcc.dg/debug/dwarf2/pr43237.c: New test.

	2010-03-02  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/43180
	* gfortran.dg/internal_pack_10.f90: New test.

	2010-02-26  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/43188
	* gcc.c-torture/compile/pr43188.c: New testcase.

	2010-02-25  Jakub Jelinek  <jakub@redhat.com>

	PR debug/43166
	* gfortran.dg/debug/pr43166.f: New test.

	PR debug/43165
	* gcc.dg/torture/pr43165.c: New test.

	2010-02-23  Jakub Jelinek  <jakub@redhat.com>

	PR target/43107
	* gcc.target/i386/pr43107.c: New test.

From-SVN: r157426
This commit is contained in:
H.J. Lu 2010-03-13 16:58:19 +00:00 committed by H.J. Lu
parent 29e6823978
commit d4b2958245
18 changed files with 464 additions and 0 deletions

View File

@ -1,3 +1,82 @@
2010-03-13 H.J. Lu <hongjiu.lu@intel.com>
Backport from mainline:
2010-03-11 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/43257
* g++.dg/torture/pr43257.C: New test.
2010-03-11 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43255
* gcc.c-torture/compile/pr43255.c: New testcase.
2010-03-11 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* gcc.dg/pr43280.c: New testcase.
2010-03-10 Jan Hubicka <jh@suse.cz>
* gcc.c-torture/compile/pr43288.c: New test.
2010-03-10 Andrey Belevantsev <abel@ispras.ru>
PR middle-end/42859
* g++.dg/eh/pr42859.C: New test.
2010-03-09 Jakub Jelinek <jakub@redhat.com>
PR debug/43299
* gcc.dg/pr43299.c: New test.
2010-03-08 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43269
* gcc.c-torture/execute/pr43269.c: New testcase.
2010-03-04 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/43164
PR tree-optimization/43191
* gcc.c-torture/compile/pr43164.c: New test.
* gcc.c-torture/compile/pr43191.c: Likewise.
2010-03-04 Changpeng Fang <changpeng.fang@amd.com>
PR middle-end/43209
* gcc.dg/tree-ssa/ivopts-4.c: New.
2010-03-03 Jakub Jelinek <jakub@redhat.com>
PR debug/43229
* gfortran.dg/pr43229.f90: New test.
PR debug/43237
* gcc.dg/debug/dwarf2/pr43237.c: New test.
2010-03-02 Paul Thomas <pault@gcc.gnu.org>
PR fortran/43180
* gfortran.dg/internal_pack_10.f90: New test.
2010-02-26 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43188
* gcc.c-torture/compile/pr43188.c: New testcase.
2010-02-25 Jakub Jelinek <jakub@redhat.com>
PR debug/43166
* gfortran.dg/debug/pr43166.f: New test.
PR debug/43165
* gcc.dg/torture/pr43165.c: New test.
2010-02-23 Jakub Jelinek <jakub@redhat.com>
PR target/43107
* gcc.target/i386/pr43107.c: New test.
2010-03-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.target/arm/sibcall-1.c: Allow PLT to appear with pic code.

View File

@ -0,0 +1,23 @@
// { dg-do compile }
void start (void);
void
ptw32_terminate (void)
{
try
{
try
{
start ();
}
catch (int)
{
}
catch (int)
{
}
}
catch (int)
{
}
}

View File

@ -0,0 +1,30 @@
/* { dg-do assemble } */
class A {};
class B {};
static void *func (int n)
{
void *p;
if (p == 0) throw ::A ();
}
static void *func (int n, B const &)
{
try {
return func (n);
}
catch (::A const &) {
}
return func (n);
}
void *f1 (int n)
{
return func (n, B());
}
void *f2 (int n)
{
return func (n, B());
}

View File

@ -0,0 +1,16 @@
struct S0
{
unsigned char f0;
int:0;
};
struct S1
{
struct S0 f0;
};
struct S1 func_34 (void)
{
struct S1 l_221 = { { 1 } };
return l_221;
}

View File

@ -0,0 +1,6 @@
int *__attribute__((__aligned__(16))) *p;
int main (void)
{
return **p;
}

View File

@ -0,0 +1,46 @@
struct S0
{
};
struct S1
{
unsigned f0:27;
const unsigned:0;
};
struct S2
{
unsigned f2:1;
};
unsigned char g_4[1][8][3][1][1][1];
unsigned char *g_17;
unsigned char **g_16[1][10][7];
struct S2 g_35 = {
0
};
struct S2 *g_34 = &g_35;
struct S1 func_86 (unsigned char p_87, struct S2 **p_89)
{
struct S1 l_92[6][8][1][1] = {
16143586
}
;
return l_92[0][0][0][0];
}
void func_28 (struct S1 p_30, const struct S1 p_32)
{
}
void func_70 (unsigned char p_72)
{
unsigned char *const *l_93 = &g_17;
struct S2 **l_94;
unsigned char *const *l_97 = &g_17;
func_28 (func_86 (p_72, 0),
func_86 (p_72, &g_34));
}

View File

@ -0,0 +1,33 @@
int safe (int);
static unsigned foo (unsigned ui1, unsigned ui2)
{
return ui1 + ui2;
}
int g_22;
int *volatile g_23 = &g_22;
int **g_282[8][10][1];
int *g_330 = &g_22;
volatile unsigned g_348;
int g_397;
void int32func (const unsigned char p_10)
{
if (foo
(~
(p_10 |
(*g_282[(unsigned long) g_397 % 8][(unsigned) g_22 % 10][g_348 % 1]) ==
(*g_282[(unsigned long) g_397 % 8][(unsigned) g_22 % 10][g_348 % 1])),
1))
{
}
else if (*g_330 >=
safe (*g_23 ^
(**g_282[(unsigned long) g_397 % 8][(unsigned) g_22 % 10]
[g_348 % 1])) & **g_282[8][10][1], 1)
{
}
}

View File

@ -0,0 +1 @@
static int a __attribute__ ((common));

View File

@ -0,0 +1,31 @@
int g_21;
int g_211;
int g_261;
static void __attribute__((noinline,noclone))
func_32 (int b)
{
if (b) {
lbl_370:
g_21 = 1;
}
for (g_261 = -1; g_261 > -2; g_261--) {
if (g_211 + 1) {
return;
} else {
g_21 = 1;
goto lbl_370;
}
}
}
extern void abort (void);
int main(void)
{
func_32(0);
if (g_261 != -1)
abort ();
return 0;
}

View File

@ -0,0 +1,31 @@
/* PR debug/43237 */
/* { dg-do compile } */
/* { dg-options "-g -O2 -dA -fno-merge-debug-strings" } */
struct S
{
int *a;
int b;
int **c;
int d;
};
void foo (struct S *);
void bar (struct S *);
int
baz (void)
{
struct S s;
foo (&s);
{
int a[s.b];
int *c[s.d];
s.a = a;
s.c = c;
bar (&s);
}
return 0;
}
/* { dg-final { scan-assembler-not "LLST\[^\\r\\n\]*DW_AT_upper_bound" } } */

View File

@ -0,0 +1,30 @@
/* { dg-do run } */
/* { dg-require-effective-target stdint_types } */
/* { dg-options "-O2" } */
#include <stdint.h>
extern void abort (void);
uint64_t __attribute__((noinline))
byteswap64(uint64_t x)
{
uint32_t a = x >> 32;
uint32_t b = (uint32_t) x;
return ((uint64_t) ((((((b)) >> (8)) | (((b)) << (32 - (8)))) & 0xff00ff00L)
| (((((b)) << (8)) | (((b)) >> (32 - (8)))) & 0x00ff00ffL)) << 32)
| (uint64_t) ((((((a)) >> (8)) | (((a)) << (32 - (8)))) & 0xff00ff00L)
| (((((a)) << (8)) | (((a)) >> (32 - (8)))) & 0x00ff00ffL));
}
int
main ()
{
uint64_t in = (uint64_t)0x01020304 << 32 | 0x05060708;
uint64_t cmp = (uint64_t)0x08070605 << 32 | 0x04030201;
if (cmp != byteswap64 (in))
abort ();
return 0;
}

View File

@ -0,0 +1,28 @@
/* PR debug/43299 */
/* { dg-do assemble } */
/* { dg-options "-g -O2" } */
extern void *emit_insn (void *);
__attribute__((noinline))
void *gen_load_locked_si (void *x, void *y)
{
return x;
}
__attribute__((noinline))
void *gen_load_locked_di (void *x, void *y)
{
return x;
}
void
emit_load_locked (int mode, void *reg, void *mem)
{
void * (*fn) (void *, void *) = ((void *)0);
if (mode == 9)
fn = gen_load_locked_si;
else if (mode == 10)
fn = gen_load_locked_di;
emit_insn (fn (reg, mem));
}

View File

@ -0,0 +1,17 @@
/* PR debug/43165 */
/* { dg-options "-g" } */
struct __attribute__((packed)) S
{
unsigned char a;
unsigned short b;
unsigned short c;
unsigned d : 24;
};
void
foo (struct S p)
{
for (; p.c; p.c++)
;
}

View File

@ -0,0 +1,8 @@
/* { dg-do compile } */
/* { dg-options "-O1" } */
void foo(int *p, long i, int j)
{
do {
p[i]++;
} while (i += j);
}

View File

@ -0,0 +1,20 @@
/* PR target/43107 */
/* { dg-do compile } */
/* { dg-options "-O3 -mavx" } */
extern void bar (float b[4][4]);
void
foo ()
{
float a[4][4], b[4][4];
int i, j;
for (i = 0; i < 4; i++)
{
for (j = 0; j < 4; j++)
a[i][j] = 0;
for (j = 0; j < 4; j++)
b[i][j] = a[i][j];
}
bar (b);
}

View File

@ -0,0 +1,14 @@
C PR debug/43166
C { dg-do compile }
C { dg-options "-O" }
SUBROUTINE FOO ()
INTEGER V1
COMMON // V1
END
SUBROUTINE BAR ()
INTEGER V0,V1,V2,V3
COMMON // V1(4),V2(85,4),V3
DO V3=1,V1(1)
V0=V2(V3,1)
END DO
END

View File

@ -0,0 +1,41 @@
! { dg-do run }
! Test the fix for PR43180, in which patch which reduced the use of
! internal_pack/unpack messed up the passing of ru(1)%c as the actual
! argument at line 23 in this testcase.
!
! Contributed by Harald Anlauf <anlauf@gmx.de>
! further reduced by Tobias Burnus <burnus@gcc.gnu.org>
!
module mo_obs_rules
type t_set
integer :: use = 42
end type t_set
type t_rules
character(len=40) :: comment
type(t_set) :: c (1)
end type t_rules
type (t_rules), save :: ru (1)
contains
subroutine get_rule (c)
type(t_set) :: c (:)
ru(1)%c(:)%use = 99
if (any (c(:)%use .ne. 42)) call abort
call set_set_v (ru(1)%c, c)
if (any (c(:)%use .ne. 99)) call abort
contains
subroutine set_set_v (src, dst)
type(t_set), intent(in) :: src(1)
type(t_set), intent(inout) :: dst(1)
if (any (src%use .ne. 99)) call abort
if (any (dst%use .ne. 42)) call abort
dst = src
end subroutine set_set_v
end subroutine get_rule
end module mo_obs_rules
program test
use mo_obs_rules
type(t_set) :: c (1)
call get_rule (c)
end program test
! { dg-final { cleanup-modules "mo_obs_rules" } }

View File

@ -0,0 +1,10 @@
! PR debug/43229
! { dg-do compile }
! { dg-options "-g -O3 -ffast-math" }
! { dg-options "-g -O3 -ffast-math -msse3" { target { i?86-*-* x86_64-*-* } } }
function foo (c, d)
real(8) :: c(6), d(6), foo
x = sum (c * d)
foo = exp (-x)
end function foo