diff options
author | Andreas Krebbel <Andreas.Krebbel@de.ibm.com> | 2011-02-08 16:46:20 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2011-02-08 16:46:20 +0000 |
commit | 1431a37d18b824f33030779e975f13839e37b61a (patch) | |
tree | ec98643e2bd17603656260755035f72f22efeb13 /gcc | |
parent | 3865a06fb99d4a893989b7bbf3fc81f4c5cbf354 (diff) | |
download | gcc-1431a37d18b824f33030779e975f13839e37b61a.zip gcc-1431a37d18b824f33030779e975f13839e37b61a.tar.gz gcc-1431a37d18b824f33030779e975f13839e37b61a.tar.bz2 |
re PR middle-end/47646 (Revision 169918 caused many testsuite failures)
2011-02-08 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
PR middle-end/47646
* gcc.dg/pr39666-2.c (foo2): If the location of the statement
using the variable is known the warning is emitted there.
* gcc.dg/uninit-pr19430.c (foo): Likewise.
* g++.dg/warn/Wuninitialized-5.C (foo): Likewise.
* c-c++-common/pr20000.c (g): Both warnings occur at the return
statement.
(vg): Likewise.
* gcc.dg/noreturn-1.c (foo5): Likewise.
* objc.dg/attributes/method-noreturn-1.m (method1): Likewise.
(method2): Likewise.
* gfortran.dg/pr25923.f90 (baz): The warning will now be issued for
the return statement using the uninitialized variable.
* gfortran.dg/pr39666-2.f90 (f): Likewise.
From-SVN: r169927
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 19 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/pr20000.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/warn/Wuninitialized-5.C | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/noreturn-1.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr39666-2.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/uninit-pr19430.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr25923.f90 | 4 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr39666-2.f90 | 4 | ||||
-rw-r--r-- | gcc/testsuite/objc.dg/attributes/method-noreturn-1.m | 4 |
9 files changed, 34 insertions, 15 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a9c1bf4..5a39fa6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,22 @@ +2011-02-08 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> + + PR middle-end/47646 + * gcc.dg/pr39666-2.c (foo2): If the location of the statement + using the variable is known the warning is emitted there. + * gcc.dg/uninit-pr19430.c (foo): Likewise. + * g++.dg/warn/Wuninitialized-5.C (foo): Likewise. + + * c-c++-common/pr20000.c (g): Both warnings occur at the return + statement. + (vg): Likewise. + * gcc.dg/noreturn-1.c (foo5): Likewise. + * objc.dg/attributes/method-noreturn-1.m (method1): Likewise. + (method2): Likewise. + + * gfortran.dg/pr25923.f90 (baz): The warning will now be issued for + the return statement using the uninitialized variable. + * gfortran.dg/pr39666-2.f90 (f): Likewise. + 2011-02-08 Richard Guenther <rguenther@suse.de> PR middle-end/47639 diff --git a/gcc/testsuite/c-c++-common/pr20000.c b/gcc/testsuite/c-c++-common/pr20000.c index 1fcd178..3c0fb88 100644 --- a/gcc/testsuite/c-c++-common/pr20000.c +++ b/gcc/testsuite/c-c++-common/pr20000.c @@ -10,7 +10,7 @@ void h(void) __attribute__((noreturn)); int g(void) { return 1; /* { dg-warning "function declared 'noreturn' has a 'return' statement" } */ -} /* { dg-warning "'noreturn' function does return" } */ +} /* { dg-warning "'noreturn' function does return" "" { target *-*-* } 12 } */ int g2(void) { h(); @@ -25,7 +25,7 @@ int vg2(void); /* { dg-bogus ".noreturn. function returns non-void value" } */ int vg(void) { return 1; /* { dg-warning "function declared 'noreturn' has a 'return' statement" "" { target c } 27 } */ -} /* { dg-warning "'noreturn' function does return" "" { target c } 28 } */ +} /* { dg-warning "'noreturn' function does return" "" { target c } 27 } */ int vg2(void) { h(); diff --git a/gcc/testsuite/g++.dg/warn/Wuninitialized-5.C b/gcc/testsuite/g++.dg/warn/Wuninitialized-5.C index 26add34..787d3c7 100644 --- a/gcc/testsuite/g++.dg/warn/Wuninitialized-5.C +++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-5.C @@ -5,7 +5,7 @@ int foo (int i) { - int j; // { dg-warning "may be used uninitialized" } + int j; switch (i) { case -__INT_MAX__ - 1 ... -1: @@ -18,5 +18,5 @@ foo (int i) j = 4; break; } - return j; + return j; // { dg-warning "may be used uninitialized" } } diff --git a/gcc/testsuite/gcc.dg/noreturn-1.c b/gcc/testsuite/gcc.dg/noreturn-1.c index 1e7a778..a379678 100644 --- a/gcc/testsuite/gcc.dg/noreturn-1.c +++ b/gcc/testsuite/gcc.dg/noreturn-1.c @@ -35,7 +35,7 @@ void foo5(void) { return; /* { dg-warning "'noreturn' has a 'return' statement" "detect invalid return" } */ -} /* { dg-warning "function does return" "detect return from noreturn" } */ +} /* { dg-warning "function does return" "detect return from noreturn" { target c } 37 } */ extern void foo6(void); void diff --git a/gcc/testsuite/gcc.dg/pr39666-2.c b/gcc/testsuite/gcc.dg/pr39666-2.c index e4ef1d5..9ca119b 100644 --- a/gcc/testsuite/gcc.dg/pr39666-2.c +++ b/gcc/testsuite/gcc.dg/pr39666-2.c @@ -5,7 +5,7 @@ int foo (int i) { - int j; /* { dg-warning "may be used uninitialized" } */ + int j; switch (i) { case -__INT_MAX__ - 1 ... -1: @@ -18,5 +18,5 @@ foo (int i) j = 4; break; } - return j; + return j; /* { dg-warning "may be used uninitialized" } */ } diff --git a/gcc/testsuite/gcc.dg/uninit-pr19430.c b/gcc/testsuite/gcc.dg/uninit-pr19430.c index 53810c5..4d2b4f6 100644 --- a/gcc/testsuite/gcc.dg/uninit-pr19430.c +++ b/gcc/testsuite/gcc.dg/uninit-pr19430.c @@ -18,8 +18,8 @@ foo (int i) int foo2( void ) { - int rc; /* { dg-warning "'rc' is used uninitialized in this function" } */ - return rc; + int rc; + return rc; /* { dg-warning "'rc' is used uninitialized in this function" } */ *&rc = 0; } diff --git a/gcc/testsuite/gfortran.dg/pr25923.f90 b/gcc/testsuite/gfortran.dg/pr25923.f90 index e7f6f6e..9140d35 100644 --- a/gcc/testsuite/gfortran.dg/pr25923.f90 +++ b/gcc/testsuite/gfortran.dg/pr25923.f90 @@ -10,7 +10,7 @@ implicit none contains - function baz(arg) result(res) ! { dg-warning "res.yr' may be" "PR45505" { xfail ilp32 } } + function baz(arg) result(res) ! { dg-bogus "res.yr' may be" "PR45505" { xfail ilp32 } } type(bar), intent(in) :: arg type(bar) :: res logical, external:: some_func @@ -19,7 +19,7 @@ contains else res = arg end if - end function baz ! { dg-bogus "res.yr' may be" "PR45505" { xfail ilp32 } } + end function baz ! { dg-warning "res.yr' may be" "PR45505" { xfail ilp32 } } end module foo diff --git a/gcc/testsuite/gfortran.dg/pr39666-2.f90 b/gcc/testsuite/gfortran.dg/pr39666-2.f90 index 720a716..633d0ba 100644 --- a/gcc/testsuite/gfortran.dg/pr39666-2.f90 +++ b/gcc/testsuite/gfortran.dg/pr39666-2.f90 @@ -2,7 +2,7 @@ ! { dg-do compile } ! { dg-options "-O2 -Wuninitialized" } -FUNCTION f(n) ! { dg-warning "may be used uninitialized" } +FUNCTION f(n) INTEGER, INTENT(in) :: n REAL :: f @@ -11,4 +11,4 @@ FUNCTION f(n) ! { dg-warning "may be used uninitialized" } CASE (0); f = 0.0 CASE (2:); f = 1.0 END SELECT -END FUNCTION +END FUNCTION ! { dg-warning "may be used uninitialized" } diff --git a/gcc/testsuite/objc.dg/attributes/method-noreturn-1.m b/gcc/testsuite/objc.dg/attributes/method-noreturn-1.m index af051a6..717d6e6 100644 --- a/gcc/testsuite/objc.dg/attributes/method-noreturn-1.m +++ b/gcc/testsuite/objc.dg/attributes/method-noreturn-1.m @@ -18,11 +18,11 @@ + (id) method1 { return self; /* { dg-warning "function declared .noreturn. has a .return. statement" } */ -} /* { dg-warning ".noreturn. function does return" } */ +} /* { dg-warning ".noreturn. function does return" "" { target *-*-* } 20 } */ - (id) method2 { return self; /* { dg-warning "function declared .noreturn. has a .return. statement" } */ -} /* { dg-warning ".noreturn. function does return" } */ +} /* { dg-warning ".noreturn. function does return" "" { target *-*-* } 24 } */ + (id) method3 { abort (); |