diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2008-08-11 18:56:32 +0000 |
---|---|---|
committer | H.J. Lu <hongjiu.lu@intel.com> | 2008-08-11 18:56:32 +0000 |
commit | f1b793fc430b5c4e560f0e37308ad119c51dfff8 (patch) | |
tree | 80550c8430db7f27a01de93a9e9e5bcba5850ea5 | |
parent | 4f5355ab86d8b8916666db2b3b219f063adefecf (diff) |
Merged with trunk at revision 138957.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/stack@138961 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 22 | ||||
-rw-r--r-- | gcc/DATESTAMP | 2 | ||||
-rw-r--r-- | gcc/ada/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/ada/exp_ch4.adb | 63 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/Make-lang.in | 4 | ||||
-rw-r--r-- | gcc/ada/gsocket.h | 4 | ||||
-rw-r--r-- | gcc/ada/s-oscons-tmplt.c | 8 | ||||
-rw-r--r-- | gcc/ada/socket.c | 4 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 10 | ||||
-rw-r--r-- | gcc/doc/install.texi | 2 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 28 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/20080806-1.c (renamed from gcc/testsuite/gcc.target/s390/20080806-1.c) | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr36901-3.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr36901-4.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr36901.h | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr36998.c | 23 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/uninit-pr20644-O0.c | 24 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/uninit-pr20644.c | 24 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/exp0_eval.adb | 31 | ||||
-rw-r--r-- | gcc/tree-ssa.c | 22 | ||||
-rw-r--r-- | libstdc++-v3/ChangeLog | 5 | ||||
-rwxr-xr-x | libstdc++-v3/configure | 143 | ||||
-rw-r--r-- | libstdc++-v3/configure.ac | 5 |
24 files changed, 343 insertions, 121 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5451f950606..7f1ce9eead9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,25 @@ +2008-08-11 Michael Matz <matz@suse.de> + + * i386/i386.c (override_options): Move initialisation from + flag_schedule_insns_after_reload to here from ... + (optimization_options): ... here. + +2008-08-11 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/36998 + * dwarf2out.c (compute_barrier_args_size_1, + compute_barrier_args_size): Temporarily remove assertions. + +2008-08-10 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + PR middle-end/20644 + * tree-ssa.c (struct walk_data): Add new flag + warn_possibly_uninitialized. + (warn_uninitialized_var): Use it. + (warn_uninitialized_vars): New. + (execute_early_warn_uninitialized): Call it. + (execute_late_warn_uninitialized): Likewise. + 2008-08-09 Andrew Pinski <andrew_pinski@playstation.sony.com> PR middle-end/36238 diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 2c0c8feac09..f658a4e9d1c 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20080810 +20080811 diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index bcdcda7147b..68857260db9 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,18 @@ +2008-08-11 Joel Sherrill <joel.sherrill@oarcorp.com> + + * s-oscons-tmplt.c: RTEMS defines AF_INET6 but does support it. + * gsocket.h, socket.c: Update to support RTEMS. + * gcc-interface/Make-lang.in: Include CFLAGS_FOR_TARGET when cross. + +2008-08-10 Samuel Tardieu <sam@rfc1149.net> + Robert Dewar <dewar@adacore.com> + + * exp_ch4.adb (Expand_N_Op_Expon): Force evaluation of + left argument even when right argument is 0. + (Expand_N_Op_Mod): Ditto when right argument is 1. + (Expand_N_Op_Multiply): Ditto when any argument is 0. + (Expand_N_Op_Rem): Ditto when right argument is 1. + 2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org> * gcc-interface/misc.c (gnat_handle_option): Replace set_Wunused diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index d4c0407bb0a..2f95a84207d 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -5471,6 +5471,13 @@ package body Exp_Ch4 is -- X ** 0 = 1 (or 1.0) if Expv = 0 then + + -- Call Remove_Side_Effects to ensure that any side effects + -- in the ignored left operand (in particular function calls + -- to user defined functions) are properly executed. + + Remove_Side_Effects (Base); + if Ekind (Typ) in Integer_Kind then Xnode := Make_Integer_Literal (Loc, Intval => 1); else @@ -5945,6 +5952,12 @@ package body Exp_Ch4 is and then Compile_Time_Known_Value (Right) and then Expr_Value (Right) = Uint_1 then + -- Call Remove_Side_Effects to ensure that any side effects in + -- the ignored left operand (in particular function calls to + -- user defined functions) are properly executed. + + Remove_Side_Effects (Left); + Rewrite (N, Make_Integer_Literal (Loc, 0)); Analyze_And_Resolve (N, Typ); return; @@ -5993,17 +6006,17 @@ package body Exp_Ch4 is -------------------------- procedure Expand_N_Op_Multiply (N : Node_Id) is - Loc : constant Source_Ptr := Sloc (N); - Lop : constant Node_Id := Left_Opnd (N); - Rop : constant Node_Id := Right_Opnd (N); + Loc : constant Source_Ptr := Sloc (N); + Lop : constant Node_Id := Left_Opnd (N); + Rop : constant Node_Id := Right_Opnd (N); - Lp2 : constant Boolean := - Nkind (Lop) = N_Op_Expon - and then Is_Power_Of_2_For_Shift (Lop); + Lp2 : constant Boolean := + Nkind (Lop) = N_Op_Expon + and then Is_Power_Of_2_For_Shift (Lop); - Rp2 : constant Boolean := - Nkind (Rop) = N_Op_Expon - and then Is_Power_Of_2_For_Shift (Rop); + Rp2 : constant Boolean := + Nkind (Rop) = N_Op_Expon + and then Is_Power_Of_2_For_Shift (Rop); Ltyp : constant Entity_Id := Etype (Lop); Rtyp : constant Entity_Id := Etype (Rop); @@ -6016,14 +6029,28 @@ package body Exp_Ch4 is if Is_Integer_Type (Typ) then - -- N * 0 = 0 * N = 0 for integer types + -- N * 0 = 0 for integer types - if (Compile_Time_Known_Value (Rop) - and then Expr_Value (Rop) = Uint_0) - or else - (Compile_Time_Known_Value (Lop) - and then Expr_Value (Lop) = Uint_0) + if Compile_Time_Known_Value (Rop) + and then Expr_Value (Rop) = Uint_0 then + -- Call Remove_Side_Effects to ensure that any side effects in + -- the ignored left operand (in particular function calls to + -- user defined functions) are properly executed. + + Remove_Side_Effects (Lop); + + Rewrite (N, Make_Integer_Literal (Loc, Uint_0)); + Analyze_And_Resolve (N, Typ); + return; + end if; + + -- Similar handling for 0 * N = 0 + + if Compile_Time_Known_Value (Lop) + and then Expr_Value (Lop) = Uint_0 + then + Remove_Side_Effects (Rop); Rewrite (N, Make_Integer_Literal (Loc, Uint_0)); Analyze_And_Resolve (N, Typ); return; @@ -6502,6 +6529,12 @@ package body Exp_Ch4 is and then Compile_Time_Known_Value (Right) and then Expr_Value (Right) = Uint_1 then + -- Call Remove_Side_Effects to ensure that any side effects in the + -- ignored left operand (in particular function calls to user defined + -- functions) are properly executed. + + Remove_Side_Effects (Left); + Rewrite (N, Make_Integer_Literal (Loc, 0)); Analyze_And_Resolve (N, Typ); return; diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in index cff834b5e1d..40017100128 100644 --- a/gcc/ada/gcc-interface/Make-lang.in +++ b/gcc/ada/gcc-interface/Make-lang.in @@ -933,9 +933,9 @@ OSCONS_EXTRACT=../../../$(DECC) -DNATIVE \ ./s-oscons-tmplt.exe > s-oscons-tmplt.s else -OSCONS_CPP=$(GCC_FOR_TARGET) -E -C \ +OSCONS_CPP=$(GCC_FOR_TARGET) $(CFLAGS_FOR_TARGET) -E -C \ -DTARGET=\"$(target)\" s-oscons-tmplt.c > s-oscons-tmplt.i -OSCONS_EXTRACT=$(GCC_FOR_TARGET) -S s-oscons-tmplt.i +OSCONS_EXTRACT=$(GCC_FOR_TARGET) $(CFLAGS_FOR_TARGET) -S s-oscons-tmplt.i endif ada/s-oscons.ads : ada/s-oscons-tmplt.c ada/gsocket.h ada/xoscons.adb ada/xutil.ads ada/xutil.adb diff --git a/gcc/ada/gsocket.h b/gcc/ada/gsocket.h index 58c4abb6e5e..0dca1a9f503 100644 --- a/gcc/ada/gsocket.h +++ b/gcc/ada/gsocket.h @@ -216,7 +216,7 @@ #if defined (_AIX) || defined (__FreeBSD__) || defined (__hpux__) || defined (__osf__) || defined (_WIN32) || defined (__APPLE__) # define HAVE_THREAD_SAFE_GETxxxBYyyy 1 -#elif defined (sgi) || defined (linux) || defined (__GLIBC__) || (defined (sun) && defined (__SVR4) && !defined (__vxworks)) +#elif defined (sgi) || defined (linux) || defined (__GLIBC__) || (defined (sun) && defined (__SVR4) && !defined (__vxworks)) || defined(__rtems__) # define HAVE_GETxxxBYyyy_R 1 #endif @@ -226,7 +226,7 @@ # define Need_Netdb_Buffer 0 #endif -#if defined (__FreeBSD__) || defined (__vxworks) +#if defined (__FreeBSD__) || defined (__vxworks) || defined(__rtems__) # define Has_Sockaddr_Len 1 #else # define Has_Sockaddr_Len 0 diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c index 8017c382137..614a8660d9b 100644 --- a/gcc/ada/s-oscons-tmplt.c +++ b/gcc/ada/s-oscons-tmplt.c @@ -829,6 +829,14 @@ CND(VEOL2, "Alternative EOL") #endif CND(AF_INET, "IPv4 address family") +/** + ** RTEMS lies and defines AF_INET6 even though there is no IPV6 support. + ** Its TCP/IP stack is in transition. It has newer .h files but no IPV6 yet. + **/ +#if defined(__rtems__) +# undef AF_INET6 +#endif + #ifndef AF_INET6 # define AF_INET6 -1 #else diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c index 9653aae1dfa..aadc9b084f7 100644 --- a/gcc/ada/socket.c +++ b/gcc/ada/socket.c @@ -240,7 +240,7 @@ __gnat_safe_getservbyname (const char *name, const char *proto, struct servent *rh; int ri; -#if defined(__linux__) || defined(__GLIBC__) +#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__) (void) getservbyname_r (name, proto, ret, buf, buflen, &rh); #else rh = getservbyname_r (name, proto, ret, buf, buflen); @@ -256,7 +256,7 @@ __gnat_safe_getservbyport (int port, const char *proto, struct servent *rh; int ri; -#if defined(__linux__) || defined(__GLIBC__) +#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__) (void) getservbyport_r (port, proto, ret, buf, buflen, &rh); #else rh = getservbyport_r (port, proto, ret, buf, buflen); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 1535e0f017f..4a2894d580e 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3173,6 +3173,11 @@ override_options (bool main_args_p) *p = '\0'; } + /* When scheduling description is not available, disable scheduler pass + so it won't slow down the compilation and make x87 code slower. */ + if (!TARGET_SCHEDULE) + flag_schedule_insns_after_reload = flag_schedule_insns = 0; + if (!PARAM_SET_P (PARAM_SIMULTANEOUS_PREFETCHES)) set_param_value ("simultaneous-prefetches", ix86_cost->simultaneous_prefetches); @@ -3942,11 +3947,6 @@ optimization_options (int level, int size ATTRIBUTE_UNUSED) flag_schedule_insns = 0; #endif - /* When scheduling description is not available, disable scheduler pass - so it won't slow down the compilation and make x87 code slower. */ - if (!TARGET_SCHEDULE) - flag_schedule_insns_after_reload = flag_schedule_insns = 0; - if (TARGET_MACHO) /* The Darwin libraries never set errno, so we might as well avoid calling them when that's the only reason we would. */ diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 7c9564419bb..a69a0859ce0 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -2416,7 +2416,7 @@ AIX: @uref{http://www.bullfreeware.com,,Bull's Freeware and Shareware Archive for AIX}; @item -@uref{http://pware.hvcc.edu,,Hudson Valley Community College Open Source Softeware for IBM System p}; +@uref{http://pware.hvcc.edu,,Hudson Valley Community College Open Source Software for IBM System p}; @item @uref{http://www.perzl.org/aix,,AIX 5L and 6 Open Source Packages}. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index a142aae5d15..8cfbf38aa35 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -1281,9 +1281,6 @@ compute_barrier_args_size_1 (rtx insn, HOST_WIDE_INT cur_args_size, barrier_args_size [INSN_UID (dest)] = cur_args_size; VEC_safe_push (rtx, heap, *next, dest); } - else - gcc_assert (barrier_args_size[INSN_UID (dest)] - == cur_args_size); } } @@ -1341,8 +1338,6 @@ compute_barrier_args_size (void) { /* The insns starting with this label have been already scanned or are in the worklist. */ - gcc_assert (barrier_args_size[INSN_UID (insn)] - == cur_args_size); break; } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c73e8bc9d58..942a81ae798 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,31 @@ +2008-08-11 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/36998 + * gcc.dg/pr36998.c: New test. + +2008-08-11 Andreas Krebbel <krebbel1@de.ibm.com> + + * gcc.target/s390/20080806-1.c: Move testcase ... + * gcc.c-torture/compile/20080806-1.c: ... to here and make it + stack size sensitive. + +2008-08-10 Samuel Tardieu <sam@rfc1149.net> + + * gnat.dg/exp0_eval.adb: New. + +2008-08-10 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + PR middle-end/20644 + * gcc.dg/uninit-pr20644-O0.c: New. + * gcc.dg/uninit-pr20644.c: New. + +2008-08-10 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + PR 36901 + * gcc.dg/pr36901.h: Do not depend on limits.h. + * gcc.dg/pr36901-3.c: Update. + * gcc.dg/pr36901-4.c: Update. + 2008-08-09 Andrew Pinski <andrew_pinski@playstation.sony.com> PR middle-end/36238 diff --git a/gcc/testsuite/gcc.target/s390/20080806-1.c b/gcc/testsuite/gcc.c-torture/compile/20080806-1.c index 6086a435144..c54e7397f5d 100644 --- a/gcc/testsuite/gcc.target/s390/20080806-1.c +++ b/gcc/testsuite/gcc.c-torture/compile/20080806-1.c @@ -1,7 +1,10 @@ /* This used to ICE on s390x due to a reload bug. */ -/* { dg-do compile } */ -/* { dg-options "-O2" } */ +#if defined(STACK_SIZE) && (STACK_SIZE < 65536) + #define BYTES 64 +#else + #define BYTES 65400 +#endif int gl2; typedef __SIZE_TYPE__ size_t; @@ -12,7 +15,7 @@ void f1 () { int i2; - unsigned char bf[64 * 1024 + 4]; + unsigned char bf[BYTES]; for (i2 = 0; i2 < 3; i2++) { diff --git a/gcc/testsuite/gcc.dg/pr36901-3.c b/gcc/testsuite/gcc.dg/pr36901-3.c index 50e0d7207a1..1f357421476 100644 --- a/gcc/testsuite/gcc.dg/pr36901-3.c +++ b/gcc/testsuite/gcc.dg/pr36901-3.c @@ -6,5 +6,4 @@ void foo(void) int s = sc; } /* { dg-message "file included" "In file included" { target *-*-* } 0 } */ -/* { dg-warning "overflow" "overflow" { target *-*-* } 0 } */ -/* { dg-error "overflow" "overflow" { target *-*-* } 0 } */ +/* { dg-error "ordered comparison of pointer with integer zero" "pedantic error" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/pr36901-4.c b/gcc/testsuite/gcc.dg/pr36901-4.c index 319c2c24103..f1d261657af 100644 --- a/gcc/testsuite/gcc.dg/pr36901-4.c +++ b/gcc/testsuite/gcc.dg/pr36901-4.c @@ -6,6 +6,4 @@ void foo(void) int s = sc; } /* { dg-message "from " "In file included" { target *-*-* } 0 } */ -/* { dg-warning "overflow" "overflow" { target *-*-* } 0 } */ -/* { dg-error "overflow" "overflow" { target *-*-* } 0 } */ -/* { dg-error "#include_next is a GCC extension" "#include_next" { target *-*-* } 0 } */ +/* { dg-error "ordered comparison of pointer with integer zero" "pedantic error" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/pr36901.h b/gcc/testsuite/gcc.dg/pr36901.h index aff2cb39c6f..e08d156412a 100644 --- a/gcc/testsuite/gcc.dg/pr36901.h +++ b/gcc/testsuite/gcc.dg/pr36901.h @@ -1,2 +1,2 @@ -#include <limits.h> -static int sc = INT_MAX + 1; +int sc = (&sc > 0); + diff --git a/gcc/testsuite/gcc.dg/pr36998.c b/gcc/testsuite/gcc.dg/pr36998.c new file mode 100644 index 00000000000..f0669b4fd50 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr36998.c @@ -0,0 +1,23 @@ +/* PR rtl-optimization/36998 */ +/* { dg-do compile } */ +/* { dg-options "-Os -fasynchronous-unwind-tables" } */ +/* { dg-options "-Os -mpreferred-stack-boundary=2 -fasynchronous-unwind-tables" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ + +void foo (const char *, ...) __attribute__ ((noreturn)); +int bar (const char *, ...); +extern __SIZE_TYPE__ strlen (const char *); +int baz (char *, char *, int, void *); + +void +test (char *w, int x, char *y, char *z) +{ + char *p, b[32]; + for (p = y; *p; p += strlen (p) + 1) + { + baz (w, p, x, z); + foo ("msg1 %s", b); + } + for (p = y; *p; p += strlen (p) + 1) + bar (" %s", p); + foo ("msg2 %s", b); +} diff --git a/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c b/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c new file mode 100644 index 00000000000..092d4116495 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c @@ -0,0 +1,24 @@ +/* PR 20644 */ +/* { dg-do compile } */ +/* { dg-options "-O0 -Wuninitialized" } */ +int foo () +{ + int i = 0; + int j; + + if (1 == i) + return j; /* { dg-bogus "uninitialized" "uninitialized" { xfail *-*-* } 10 } */ + + return 0; +} + +int bar () +{ + int i = 1; + int j; + + if (1 == i) + return j; /* { dg-warning "uninitialized" "uninitialized" { target *-*-* } 21 } */ + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/uninit-pr20644.c b/gcc/testsuite/gcc.dg/uninit-pr20644.c new file mode 100644 index 00000000000..e13910becd1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-pr20644.c @@ -0,0 +1,24 @@ +/* PR 20644 */ +/* { dg-do compile } */ +/* { dg-options "-O -Wuninitialized" } */ +int foo () +{ + int i = 0; + int j; + + if (1 == i) + return j; + + return 0; +} + +int bar () +{ + int i = 1; + int j; + + if (1 == i) + return j; /* { dg-warning "uninitialized" "uninitialized" { target *-*-* } 18 } */ + + return 0; +} diff --git a/gcc/testsuite/gnat.dg/exp0_eval.adb b/gcc/testsuite/gnat.dg/exp0_eval.adb new file mode 100644 index 00000000000..11edd7d097c --- /dev/null +++ b/gcc/testsuite/gnat.dg/exp0_eval.adb @@ -0,0 +1,31 @@ +-- { dg-do run } +with Interfaces; use Interfaces; +procedure Exp0_Eval is + + F_Count : Natural := 0; + + function F return Integer is + begin + F_Count := F_Count + 1; + return 1; + end F; + + function F return Unsigned_32 is + begin + F_Count := F_Count + 1; + return 1; + end F; + + R : constant Integer := + F ** 0 + + F * 0 + + 0 * F + + Integer (Unsigned_32'(F) mod 1) + + Integer (Unsigned_32'(F) rem 1); + pragma Warnings (Off, R); +begin + if F_Count /= 5 then + raise Program_Error + with "incorrect numbers of calls to F:" & F_Count'Img; + end if; +end Exp0_Eval; diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index 4c7592e6f18..74968bf5539 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -1430,6 +1430,7 @@ warn_uninit (tree t, const char *gmsgid, void *data) struct walk_data { gimple stmt; bool always_executed; + bool warn_possibly_uninitialized; }; /* Called via walk_tree, look for SSA_NAMEs that have empty definitions @@ -1450,7 +1451,7 @@ warn_uninitialized_var (tree *tp, int *walk_subtrees, void *data_) if (data->always_executed) warn_uninit (t, "%qD is used uninitialized in this function", data->stmt); - else + else if (data->warn_possibly_uninitialized) warn_uninit (t, "%qD may be used uninitialized in this function", data->stmt); *walk_subtrees = 0; @@ -1496,12 +1497,14 @@ warn_uninitialized_phi (gimple phi) } static unsigned int -execute_early_warn_uninitialized (void) +warn_uninitialized_vars (bool warn_possibly_uninitialized) { gimple_stmt_iterator gsi; basic_block bb; struct walk_data data; + data.warn_possibly_uninitialized = warn_possibly_uninitialized; + calculate_dominance_info (CDI_POST_DOMINATORS); FOR_EACH_BB (bb) @@ -1521,6 +1524,19 @@ execute_early_warn_uninitialized (void) } static unsigned int +execute_early_warn_uninitialized (void) +{ + /* Currently, this pass runs always but + execute_late_warn_uninitialized only runs with optimization. With + optimization we want to warn about possible uninitialized as late + as possible, thus don't do it here. However, without + optimization we need to warn here about "may be uninitialized". + */ + warn_uninitialized_vars (/*warn_possibly_uninitialized=*/!optimize); + return 0; +} + +static unsigned int execute_late_warn_uninitialized (void) { basic_block bb; @@ -1529,7 +1545,7 @@ execute_late_warn_uninitialized (void) /* Re-do the plain uninitialized variable check, as optimization may have straightened control flow. Do this first so that we don't accidentally get a "may be" warning when we'd have seen an "is" warning later. */ - execute_early_warn_uninitialized (); + warn_uninitialized_vars (/*warn_possibly_uninitialized=*/1); FOR_EACH_BB (bb) for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi)) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f674cd6410d..73ca33f88b4 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2008-08-11 Paolo Carlini <paolo.carlini@oracle.com> + + * configure.ac: Run GLIBCXX_CHECK_STDIO_MACROS unconditionally. + * configure: Regenerate. + 2008-08-10 Paolo Carlini <paolo.carlini@oracle.com> * include/tr1_impl/type_traits (_DEFINE_SPEC*): Simplify. diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index fd776092e1f..67070dd29c7 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -18249,6 +18249,77 @@ fi +# For common values of EOF, SEEK_CUR, SEEK_END. + + + echo "$as_me:$LINENO: checking for EOF == -1, SEEK_CUR == 1, SEEK_END == 2" >&5 +echo $ECHO_N "checking for EOF == -1, SEEK_CUR == 1, SEEK_END == 2... $ECHO_C" >&6 + if test "${glibcxx_cv_stdio_macros+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +#if ((EOF != -1) || (SEEK_CUR != 1) || (SEEK_END != 2)) + unusual values... + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + glibcxx_cv_stdio_macros=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +glibcxx_cv_stdio_macros=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi + + echo "$as_me:$LINENO: result: $glibcxx_cv_stdio_macros" >&5 +echo "${ECHO_T}$glibcxx_cv_stdio_macros" >&6 + if test x"$glibcxx_cv_stdio_macros" = x"yes"; then + +cat >>confdefs.h <<\_ACEOF +#define _GLIBCXX_STDIO_MACROS 1 +_ACEOF + + fi + + # Only do link tests if native. Else, hardcode. if $GLIBCXX_IS_NATIVE; then @@ -41812,78 +41883,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - # - - - echo "$as_me:$LINENO: checking for EOF == -1, SEEK_CUR == 1, SEEK_END == 2" >&5 -echo $ECHO_N "checking for EOF == -1, SEEK_CUR == 1, SEEK_END == 2... $ECHO_C" >&6 - if test "${glibcxx_cv_stdio_macros+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdio.h> -int -main () -{ -#if ((EOF != -1) || (SEEK_CUR != 1) || (SEEK_END != 2)) - unusual values... - #endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - glibcxx_cv_stdio_macros=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -glibcxx_cv_stdio_macros=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -fi - - echo "$as_me:$LINENO: result: $glibcxx_cv_stdio_macros" >&5 -echo "${ECHO_T}$glibcxx_cv_stdio_macros" >&6 - if test x"$glibcxx_cv_stdio_macros" = x"yes"; then - -cat >>confdefs.h <<\_ACEOF -#define _GLIBCXX_STDIO_MACROS 1 -_ACEOF - - fi - - - # For TLS support. # Check whether --enable-tls or --disable-tls was given. diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 6f530b3faa4..ea5f14a4ad1 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -122,6 +122,8 @@ GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING([no]) # Checks for operating systems support that don't require linking. GLIBCXX_CHECK_SYSTEM_ERROR +# For common values of EOF, SEEK_CUR, SEEK_END. +GLIBCXX_CHECK_STDIO_MACROS # Only do link tests if native. Else, hardcode. if $GLIBCXX_IS_NATIVE; then @@ -167,9 +169,6 @@ if $GLIBCXX_IS_NATIVE; then # For gettimeofday support. GLIBCXX_CHECK_GETTIMEOFDAY - # - GLIBCXX_CHECK_STDIO_MACROS - # For TLS support. GCC_CHECK_TLS |