Backport PRs 40642, 40758, 41212, 41242, 41248, 41275, 41295, 41347, 41470, 41476

2009-09-28  H.J. Lu  <hongjiu.lu@intel.com>

	Backport from mainline:
	2009-09-26  Andreas Schwab  <schwab@linux-m68k.org>

	PR c/41476
	* gcc.dg/cond-constqual-1.c: New test.

	2009-09-26  Michael Matz  <matz@suse.de>

	PR lto/40758
	PR middle-end/41470
	* gcc.dg/pr41470.c: New test.

	2009-09-23  Alexandre Oliva  <aoliva@redhat.com>

	PR debug/41248
	* gcc.dg/pr41248.c: New.

	2009-09-22  Alexandre Oliva  <aoliva@redhat.com>

	PR debug/41295
	* gcc.dg/pr41295.c: New.

	2009-09-20  Andrew Pinski  <pinskia@gcc.gnu.org>

	PR middle-end/40642
	* g++.dg/torture/pr40642.C: New testcase.

	2009-09-17  Michael Matz  <matz@suse.de>

	PR middle-end/41347
	* gfortran.dg/pr41347.f90: New test.

	2009-09-16  Michael Matz  <matz@suse.de>

	PR fortran/41212
	* gfortran.dg/pr41212.f90: New test.

	2009-09-11  Michael Matz  <matz@suse.de>

	PR middle-end/41275
	* g++.dg/tree-ssa/pr41275.C: New test.

	2009-09-11  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/41242
	* gfortran.dg/proc_ptr_comp_21.f90: New.

From-SVN: r152250
This commit is contained in:
H.J. Lu 2009-09-28 20:38:53 +00:00 committed by H.J. Lu
parent db74cb693c
commit c2ed3e6e48
10 changed files with 336 additions and 1 deletions

View File

@ -1,3 +1,52 @@
2009-09-28 H.J. Lu <hongjiu.lu@intel.com>
Backport from mainline:
2009-09-26 Andreas Schwab <schwab@linux-m68k.org>
PR c/41476
* gcc.dg/cond-constqual-1.c: New test.
2009-09-26 Michael Matz <matz@suse.de>
PR lto/40758
PR middle-end/41470
* gcc.dg/pr41470.c: New test.
2009-09-23 Alexandre Oliva <aoliva@redhat.com>
PR debug/41248
* gcc.dg/pr41248.c: New.
2009-09-22 Alexandre Oliva <aoliva@redhat.com>
PR debug/41295
* gcc.dg/pr41295.c: New.
2009-09-20 Andrew Pinski <pinskia@gcc.gnu.org>
PR middle-end/40642
* g++.dg/torture/pr40642.C: New testcase.
2009-09-17 Michael Matz <matz@suse.de>
PR middle-end/41347
* gfortran.dg/pr41347.f90: New test.
2009-09-16 Michael Matz <matz@suse.de>
PR fortran/41212
* gfortran.dg/pr41212.f90: New test.
2009-09-11 Michael Matz <matz@suse.de>
PR middle-end/41275
* g++.dg/tree-ssa/pr41275.C: New test.
2009-09-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/41242
* gfortran.dg/proc_ptr_comp_21.f90: New.
2009-09-23 Dodji Seketeli <dodji@redhat.com>
PR debug/41065
@ -58,7 +107,6 @@
PR fortran/39876
* gfortran.dg/intrinsic_3.f90: New.
2009-09-10 H.J. Lu <hongjiu.lu@intel.com>
* gcc.dg/pr41241.c: Removed.

View File

@ -0,0 +1,26 @@
// { dg-do compile }
// { dg-options "-fprofile-generate" }
// GCC used to ICE with some EH edge missing.
inline void* operator new(__SIZE_TYPE__, void* p) throw() { return p; }
inline void operator delete (void*, void*) throw() { }
template<typename T> void foo(void* p, T t)
{
new(p) T(t);
}
void bar();
template<typename T> struct A
{
T* p;
A() { try { foo(p, T()); } catch(...) {} }
A(const A&) { try { bar(); } catch(...) { throw; } }
};
A<A<int> > a;

View File

@ -0,0 +1,16 @@
// PR middle-end/41275
// { dg-do compile }
// { dg-options "-O2" }
// this used to ICE
struct ErrmsgWindow
{
virtual ~ErrmsgWindow()
{
extern int _switch_mode_errorstr;
_switch_mode_errorstr = 42;
}
};
void ShowErrorMessage(void)
{
ErrmsgWindow w;
}

View File

@ -0,0 +1,15 @@
/* Test for const qualification of type of conditional expression. */
/* { dg-do compile } */
/* { dg-options "" } */
int foo (int) __attribute__ ((const));
const int i;
void
test (void)
{
__typeof__ (1 ? foo (0) : 0) texpr;
__typeof__ (1 ? i : 0) texpr2;
texpr = 0; /* { dg-bogus "read-only variable" "conditional expression with call to const function" } */
texpr2 = 0; /* { dg-error "read-only variable" "conditional expression with const variable" } */
}

View File

@ -0,0 +1,27 @@
/* { dg-do compile } */
/* { dg-options "-O2 -g" } */
struct __gcov_var {
unsigned int offset;
unsigned int buffer[(1 << 10) + 1];
} __gcov_var;
unsigned int * gcov_write_words (unsigned int words) {
unsigned int *result;
result = &__gcov_var.buffer[__gcov_var.offset];
return result;
}
struct gcov_ctr_summary { };
struct gcov_summary {
unsigned int checksum;
struct gcov_ctr_summary ctrs[1];
};
void __gcov_write_unsigned (unsigned int);
void __gcov_write_summary (unsigned int tag,
const struct gcov_summary *summary)
{
unsigned ix;
const struct gcov_ctr_summary *csum;
__gcov_write_unsigned (summary->checksum);
for (csum = summary->ctrs, ix = 1; ix--; csum++) { }
}

View File

@ -0,0 +1,91 @@
/* { dg-do compile } */
/* { dg-options "-O1 -g" } */
enum reg_class
{
BASE_REGS,
GENERAL_REGS,
LIM_REG_CLASSES
};
static __inline__ unsigned char
hard_reg_set_subset_p (const unsigned long x[4], const unsigned long y[4])
{
return ((x[0] & ~y[0]) == 0
&& (x[1] & ~y[1]) == 0
&& (x[2] & ~y[2]) == 0
&& (x[3] & ~y[3]) == 0);
}
static __inline__ unsigned char
hard_reg_set_equal_p (const unsigned long x[4], const unsigned long y[4])
{
return x[0] == y[0]
&& x[1] == y[1]
&& x[2] == y[2]
&& x[3] == y[3];
}
extern unsigned long reg_class_contents[(int) LIM_REG_CLASSES][4];
extern int ira_important_classes_num;
extern enum reg_class ira_important_classes[(int) LIM_REG_CLASSES];
extern enum reg_class ira_reg_class_intersect[(int) LIM_REG_CLASSES][(int)
LIM_REG_CLASSES];
extern unsigned char ira_reg_classes_intersect_p[(int) LIM_REG_CLASSES][(int)
LIM_REG_CLASSES];
extern enum reg_class ira_reg_class_super_classes[(int) LIM_REG_CLASSES][(int)
LIM_REG_CLASSES];
static unsigned long temp_hard_regset[4];
static void
setup_reg_class_relations (void)
{
int i, cl1, cl2, cl3;
unsigned long temp_set2[4];
for (cl1 = 0; cl1 < (int) LIM_REG_CLASSES; cl1++)
{
ira_reg_class_super_classes[cl1][0] = LIM_REG_CLASSES;
for (cl2 = 0; cl2 < (int) LIM_REG_CLASSES; cl2++)
{
ira_reg_classes_intersect_p[cl1][cl2] = 0;
{
unsigned long *scan_tp_ = (temp_set2), *scan_fp_ =
(reg_class_contents[cl2]);
scan_tp_[1] = scan_fp_[1];
scan_tp_[2] = scan_fp_[2];
scan_tp_[3] = scan_fp_[3];
}
for (i = 0; i < ira_important_classes_num; i++)
{
cl3 = ira_important_classes[i];
{
unsigned long *scan_tp_ = (temp_hard_regset), *scan_fp_ =
(reg_class_contents[cl3]);
scan_tp_[0] = scan_fp_[0];
scan_tp_[1] = scan_fp_[1];
scan_tp_[3] = scan_fp_[3];
}
if (!hard_reg_set_subset_p (temp_hard_regset, temp_set2)
|| (hard_reg_set_equal_p (temp_hard_regset, temp_set2)
&& hard_reg_set_subset_p (reg_class_contents[cl3],
reg_class_contents[(int)
ira_reg_class_intersect
[cl1]
[cl2]])))
ira_reg_class_intersect[cl1][cl2] = (enum reg_class) cl3;
}
}
}
}
static void
find_reg_class_closure (void)
{
setup_reg_class_relations ();
}
void
ira_init (void)
{
find_reg_class_closure ();
}

View File

@ -0,0 +1,18 @@
/* { dg-do compile } */
/* { dg-options "-fexceptions" } */
void *
af (void *a)
{
return a;
}
void
bf (void)
{
void *p;
{
int i = 1;
char v[i];
p = af (v);
}
cf (p);
}

View File

@ -0,0 +1,34 @@
! { dg-do run }
! { dg-options "-O2" }
program m
double precision :: y,z
call b(1.0d0,y,z)
if (ABS (z - 1.213) > 0.1) call abort
contains
subroutine b( x, y, z)
implicit none
double precision :: x,y,z
integer :: i, k
double precision :: h, r
y = 1.0d0
z = 0.0d0
h = 0
DO k = 1,10
h = h + 1.0d0/k
r = 1
DO i = 1,k
r = (x/(2*i) ) * r
END DO
y = y + (-1)**k * r
z = z + (-1)**(k+1) * h * r
IF ( ABS(2*k/x*r) < 1d-6 ) EXIT
END DO
z = 2*y
end subroutine b
end program m

View File

@ -0,0 +1,32 @@
! { dg-do compile }
! { dg-options "-O3" }
module hsl_ma41_m
implicit none
contains
subroutine solve_ma41
integer, dimension(20) :: info
call prininfo(15, info)
end subroutine solve_ma41
subroutine prininfo (ni, info)
integer, intent(in) :: ni
integer, intent(in), dimension(:) :: info
integer i
call prinfo
contains
subroutine prinfo
do i = 1, ni
write(*,'(i5,1x,i0)') i, info(i)
end do
end subroutine prinfo
end subroutine prininfo
end module hsl_ma41_m

View File

@ -0,0 +1,28 @@
! { dg-do compile }
!
! PR 41242: [4.5 Regression] PPC call rejected (related to user-defined assignment?)
!
! Original test case by Juergen Reuter <reuter@physik.uni-freiburg.de>
! Modified by Janus Weil <janus@gcc.gnu.org>
type :: nf_t
procedure(integer), nopass, pointer :: get_n_in
end type
interface assignment(=)
procedure op_assign
end interface
type(nf_t) :: prc_lib
prc_lib = "foobar"
print *, prc_lib%get_n_in()
contains
elemental subroutine op_assign (str, ch)
type(nf_t), intent(out) :: str
character(len=*), intent(in) :: ch
end subroutine
end