diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-03-25 15:55:32 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-03-25 15:55:32 +0000 |
commit | f62137abf2a8e0ab8e518c430d3d941b1debd894 (patch) | |
tree | 1c367f366688f38f5ad6393edcce0bf33cdbf458 | |
parent | db035724389adede03da923c4ffcc63f5a7fdb46 (diff) |
Merged with trunk at revision 145062.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/ix86/atom@145067 138bc75d-0d04-0410-961f-82ee72b054a4
69 files changed, 2437 insertions, 146 deletions
diff --git a/ChangeLog b/ChangeLog index e1d7bff2a5f..e8fe7ad02e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-03-25 Erven Rohou <erven.rohou@inria.fr> + + * MAINTAINERS: Update my email address. + 2009-03-18 Tom Tromey <tromey@redhat.com> * configure: Rebuild. diff --git a/MAINTAINERS b/MAINTAINERS index de674353509..85bd8c2eeef 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -424,7 +424,7 @@ Joern Rennecke joern.rennecke@arc.com Bernhard Reutner-Fischer rep.dot.nop@gmail.com Tom Rix trix@redhat.com Craig Rodrigues rodrigc@gcc.gnu.org -Erven Rohou erven.rohou@st.com +Erven Rohou erven.rohou@inria.fr Ira Rosen irar@il.ibm.com Maciej W. Rozycki macro@linux-mips.org Douglas Rupp rupp@gnat.com diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4980b956484..8eeb1053050 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,90 @@ +2009-03-25 Ralf Corsépius <ralf.corsepius@rtems.org> + + * config/arm/rtems-elf.h: Remove LINK_GCC_C_SEQUENCE_SPEC. + * config/rs6000/t-rtems: Remove MULTILIB_EXTRA_OPTS. + +2009-03-25 Richard Guenther <rguenther@suse.de> + + PR middle-end/39497 + * Makefile.in (dfp.o-warn): Use -fno-strict-aliasing instead + of -Wno-error. + +2009-03-25 Andrey Belevantsev <abel@ispras.ru> + + * config/ia64/ia64.c (ia64_set_sched_flags): Zero spec_info->mask when + neither of haifa/selective schedulers are working. + +2009-03-25 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> + + * doc/invoke.texi (Debugging Options): Fix description of + -fno-merge-debug-strings. + +2009-03-24 Hans-Peter Nilsson <hp@axis.com> + + * config/cris/libgcc.ver: New version-script. + * config/cris/t-linux (SHLIB_MAPFILES): Use it. + + * configure.ac <GAS features, nop mnemonic>: Add pattern + crisv32-*-* for "nop". + <GAS features, Thread-local storage>: Add item for CRIS and + CRIS v32. + * configure: Regenerate. + +2009-03-24 Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/39529 + * tree-vect-transform.c (vect_create_data_ref_ptr): Call + mark_sym_for_renaming for the tag copied to the new vector + pointer. + +2009-03-24 Arthur Loiret <aloiret@debian.org> + + * config.host (alpha*-*-linux*): Use driver-alpha.o and + alpha/x-alpha. + * config/alpha/linux.h (host_detect_local_cpu): Declare, add to + EXTRA_SPEC_FUNCTIONS. + (MCPU_MTUNE_NATIVE_SPECS, DRIVER_SELF_SPECS): New macros. + * config/alpha/driver-alpha.c, config/alpha/x-alpha: New. + * doc/invoke.texi (DEC Alpha Options): Document 'native' value for + -march and -mtune options. + +2009-03-24 Ralf Corsépius <ralf.corsepius@rtems.org> + + * config/m68k/t-rtems: Add m5329 multilib. + +2009-03-24 Dodji Seketeli <dodji@redhat.com> + Jakub Jelinek <jakub@redhat.com> + + PR debug/39524 + * dwarf2out.c (gen_variable_die): Avoid adding duplicate declaration + nodes. + +2009-03-23 Jakub Jelinek <jakub@redhat.com> + + PR c/39495 + * c-parser.c (c_parser_omp_for_loop): Call c_parser_binary_expression + instead of c_parser_expression_conv, if original_code isn't one of the + 4 allowed comparison codes, fail. + +2009-03-23 Richard Guenther <rguenther@suse.de> + + * cgraph.h (struct cgraph_node): Reorder fields for 64-bit hosts. + * tree.h (struct tree_type): Likewise. + * reload.h (struct insn_chain): Likewise. + * dwarf2out.c (struct dw_loc_descr_struct): Likewise. + * function.h (struct function): Likewise. + * tree-ssa-structalias.c (struct equiv_class_label): Likewise. + +2009-03-23 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/39516 + * lambda-code.c (perfect_nestify): Fix type of the uboundvar variable. + +2009-03-23 Bingfeng Mei <bmei@broadcom.com> + + * config.gcc (need_64bit_hwint): Make clear that need_64bit_hwint + should be set true if BITS_PER_WORD of target is bigger than 32 + 2009-03-22 Hans-Peter Nilsson <hp@axis.com> * config/cris/linux.h (CRIS_LINK_SUBTARGET_SPEC): @@ -377,8 +464,8 @@ 2009-03-07 Jan Hubicka <jh@suse.cz> PR target/39361 - * tree-inline.c (setup_one_parameter): Do replacement of const argument - by constant in SSA form. + * tree-inline.c (setup_one_parameter): Do replacement of const + argument by constant in SSA form. 2009-03-07 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 94d6f6e9d46..7e93ddc1aee 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20090322 +20090325 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index d4d6683b32f..8850231bb89 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -177,8 +177,8 @@ GCC_WARN_CFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn) build/gengtype-lex.o-warn = -Wno-error # SYSCALLS.c misses prototypes SYSCALLS.c.X-warn = -Wno-strict-prototypes -Wno-error -# dfp.c contains alias violations -dfp.o-warn = -Wno-error +# dfp.c contains many alias violations +dfp.o-warn = -fno-strict-aliasing # mips-tfile.c contains -Wcast-qual warnings. mips-tfile.o-warn = -Wno-error diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 6dfcb601597..ea0036c0ba2 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -7652,9 +7652,23 @@ c_parser_omp_for_loop (c_parser *parser, tree clauses, tree *par_clauses) if (c_parser_next_token_is_not (parser, CPP_SEMICOLON)) { location_t cond_loc = c_parser_peek_token (parser)->location; + struct c_expr cond_expr = c_parser_binary_expression (parser, NULL); - cond = c_parser_expression_conv (parser).value; + cond = cond_expr.value; cond = c_objc_common_truthvalue_conversion (cond_loc, cond); + switch (cond_expr.original_code) + { + case GT_EXPR: + case GE_EXPR: + case LT_EXPR: + case LE_EXPR: + break; + default: + /* Can't be cond = error_mark_node, because we want to preserve + the location until c_finish_omp_for. */ + cond = build1 (NOP_EXPR, boolean_type_node, error_mark_node); + break; + } protected_set_expr_location (cond, cond_loc); } c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 57d4772cdd5..29fc1ba4a4d 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -163,6 +163,10 @@ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) /* Ordering of all cgraph nodes. */ int order; + /* unique id for profiling. pid is not suitable because of different + number of cfg nodes with -fprofile-generate and -fprofile-use */ + int pid; + /* Set when function must be output - it is externally visible or its address is taken. */ unsigned needed : 1; @@ -186,10 +190,6 @@ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) into clone before compiling so the function in original form can be inlined later. This pointer points to the clone. */ tree inline_decl; - - /* unique id for profiling. pid is not suitable because of different - number of cfg nodes with -fprofile-generate and -fprofile-use */ - int pid; }; struct cgraph_edge GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"))) diff --git a/gcc/config.gcc b/gcc/config.gcc index f17607b2069..d89de15bacd 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -146,8 +146,9 @@ # system normally uses GNU as. # # need_64bit_hwint Set to yes if HOST_WIDE_INT must be 64 bits wide -# for this target. This is true iff this target -# supports "long" or "wchar_t" wider than 32 bits. +# for this target. This is true if this target +# supports "long" or "wchar_t" wider than 32 bits, +# or BITS_PER_WORD is wider than 32 bits. # The setting made here must match the one made in # other locations such as libcpp/configure.ac # diff --git a/gcc/config.host b/gcc/config.host index 0cd57ed87f9..b06d1648c73 100644 --- a/gcc/config.host +++ b/gcc/config.host @@ -94,6 +94,14 @@ case ${host} in esac case ${host} in + alpha*-*-linux*) + case ${target} in + alpha*-*-linux*) + host_extra_gcc_objs="driver-alpha.o" + host_xmake_file="${host_xmake_file} alpha/x-alpha" + ;; + esac + ;; i[34567]86-*-* \ | x86_64-*-* ) case ${target} in @@ -112,9 +120,6 @@ case ${host} in ;; esac ;; -esac - -case ${host} in rs6000-*-* \ | powerpc*-*-* ) case ${target} in diff --git a/gcc/config/alpha/driver-alpha.c b/gcc/config/alpha/driver-alpha.c new file mode 100644 index 00000000000..d787886d172 --- /dev/null +++ b/gcc/config/alpha/driver-alpha.c @@ -0,0 +1,100 @@ +/* Subroutines for the gcc driver. + Copyright (C) 2009 Free Software Foundation, Inc. + Contributed by Arthur Loiret <aloiret@debian.org> + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +<http://www.gnu.org/licenses/>. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" + +/* This will be called by the spec parser in gcc.c when it sees + a %:local_cpu_detect(args) construct. Currently it will be called + with either "cpu" or "tune" as argument depending on if -mcpu=native + or -mtune=native is to be substituted. + + It returns a string containing new command line parameters to be + put at the place of the above two options, depending on what CPU + this is executed. E.g. "-mcpu=ev6" on an Alpha 21264 for + -mcpu=native. If the routine can't detect a known processor, + the -mcpu or -mtune option is discarded. + + ARGC and ARGV are set depending on the actual arguments given + in the spec. */ +const char * +host_detect_local_cpu (int argc, const char **argv) +{ + const char *cpu = NULL; + char buf[128]; + FILE *f; + + static const struct cpu_names { + const char *const name; + const char *const cpu; + } cpu_names[] = { + { "EV79", "ev67" }, + { "EV7", "ev67" }, + { "EV69", "ev67" }, + { "EV68CX", "ev67" }, + { "EV68CB", "ev67" }, + { "EV68AL", "ev67" }, + { "EV67", "ev67" }, + { "EV6", "ev6" }, + { "PCA57", "pca56" }, + { "PCA56", "pca56" }, + { "EV56", "ev56" }, + { "EV5", "ev5" }, + { "LCA45", "ev45" }, + { "EV45", "ev45" }, + { "LCA4", "ev4" }, + { "EV4", "ev4" }, +/* { "EV3", "ev3" }, */ + { 0, 0 } + }; + + int i; + + if (argc < 1) + return NULL; + + if (strcmp (argv[0], "cpu") && strcmp (argv[0], "tune")) + return NULL; + + f = fopen ("/proc/cpuinfo", "r"); + if (f == NULL) + return NULL; + + while (fgets (buf, sizeof (buf), f) != NULL) + if (strncmp (buf, "cpu model", sizeof ("cpu model") - 1) == 0) + { + for (i = 0; cpu_names [i].name; i++) + if (strstr (buf, cpu_names [i].name) != NULL) + { + cpu = cpu_names [i].cpu; + break; + } + break; + } + + fclose (f); + + if (cpu == NULL) + return NULL; + + return concat ("-m", argv[0], "=", cpu, NULL); +} diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h index 94876f646de..0a32479d5d7 100644 --- a/gcc/config/alpha/linux.h +++ b/gcc/config/alpha/linux.h @@ -85,3 +85,19 @@ along with GCC; see the file COPYING3. If not see /* Define if long doubles should be mangled as 'g'. */ #define TARGET_ALTERNATE_LONG_DOUBLE_MANGLING + +/* -mcpu=native handling only makes sense with compiler running on + an Alpha chip. */ +#if defined(__alpha__) || defined(__alpha) +extern const char *host_detect_local_cpu (int argc, const char **argv); +# define EXTRA_SPEC_FUNCTIONS \ + { "local_cpu_detect", host_detect_local_cpu }, + +# define MCPU_MTUNE_NATIVE_SPECS \ + " %{mcpu=native:%<mcpu=native %:local_cpu_detect(cpu)}" \ + " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}" +#else +# define MCPU_MTUNE_NATIVE_SPECS "" +#endif + +#define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS diff --git a/gcc/config/alpha/x-alpha b/gcc/config/alpha/x-alpha new file mode 100644 index 00000000000..27b5f466903 --- /dev/null +++ b/gcc/config/alpha/x-alpha @@ -0,0 +1,3 @@ +driver-alpha.o: $(srcdir)/config/alpha/driver-alpha.c \ + $(CONFIG_H) $(SYSTEM_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< diff --git a/gcc/config/arm/rtems-elf.h b/gcc/config/arm/rtems-elf.h index ee8c118112a..dade74b1555 100644 --- a/gcc/config/arm/rtems-elf.h +++ b/gcc/config/arm/rtems-elf.h @@ -43,4 +43,3 @@ * with how this used to be defined. */ #undef LINK_GCC_C_SEQUENCE_SPEC -#define LINK_GCC_C_SEQUENCE_SPEC "%G %L" diff --git a/gcc/config/cris/libgcc.ver b/gcc/config/cris/libgcc.ver new file mode 100644 index 00000000000..e35de83100f --- /dev/null +++ b/gcc/config/cris/libgcc.ver @@ -0,0 +1,7 @@ +GCC_4.3 { + __Mul + __Div + __Udiv + __Mod + __Umod +} diff --git a/gcc/config/cris/t-linux b/gcc/config/cris/t-linux index e10d083f565..96e861a4283 100644 --- a/gcc/config/cris/t-linux +++ b/gcc/config/cris/t-linux @@ -1,5 +1,6 @@ TARGET_LIBGCC2_CFLAGS += -fPIC CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS) +SHLIB_MAPFILES += $(srcdir)/config/cris/libgcc.ver # We *know* we have a limits.h in the glibc library, with extra # definitions needed for e.g. libgfortran. diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 420a8e46327..da96fce6d4f 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -7274,6 +7274,8 @@ ia64_set_sched_flags (spec_info_t spec_info) spec_info->flags |= COUNT_SPEC_IN_CRITICAL_PATH; } } + else + spec_info->mask = 0; } /* If INSN is an appropriate load return its mode. diff --git a/gcc/config/m68k/t-rtems b/gcc/config/m68k/t-rtems index 2b0750f0f05..0997afebc94 100644 --- a/gcc/config/m68k/t-rtems +++ b/gcc/config/m68k/t-rtems @@ -4,5 +4,6 @@ M68K_MLIB_CPU += && (match(MLIB, "^68") \ || MLIB == "5206" \ || MLIB == "5208" \ || MLIB == "5307" \ + || MLIB == "5329" \ || MLIB == "5407" \ || MLIB == "5475") diff --git a/gcc/config/rs6000/t-rtems b/gcc/config/rs6000/t-rtems index b3db9498a23..c0fd8bf3b07 100644 --- a/gcc/config/rs6000/t-rtems +++ b/gcc/config/rs6000/t-rtems @@ -10,8 +10,6 @@ m403 m505 m601 m603e m604 m860 m7400 \ mpc8260 \ nof -MULTILIB_EXTRA_OPTS = mrelocatable-lib mno-eabi mstrict-align - # MULTILIB_MATCHES = ${MULTILIB_MATCHES_FLOAT} MULTILIB_MATCHES = MULTILIB_MATCHES += ${MULTILIB_MATCHES_ENDIAN} diff --git a/gcc/configure b/gcc/configure index 47d75004539..04775acf6e9 100755 --- a/gcc/configure +++ b/gcc/configure @@ -21976,6 +21976,17 @@ foo: .long 25 tls_first_minor=13 tls_as_opt=--fatal-warnings ;; + cris-*-*|crisv32-*-*) + conftest_s=' + .section ".tdata","awT",@progbits +x: .long 25 + .text + move.d x:IE,$r10 + nop' + tls_first_major=2 + tls_first_minor=20 + tls_as_opt=--fatal-warnings + ;; frv*-*-*) conftest_s=' .section ".tdata","awT",@progbits @@ -23660,7 +23671,7 @@ esac case "$target" in i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \ | x86_64*-*-* | hppa*-*-* | arm*-*-* \ - | xstormy16*-*-* | cris-*-* | xtensa*-*-* | bfin-*-* | score*-*-* \ + | xstormy16*-*-* | cris-*-* | crisv32-*-* | xtensa*-*-* | bfin-*-* | score*-*-* \ | spu-*-* | fido*-*-* | m32c-*-*) insn="nop" ;; diff --git a/gcc/configure.ac b/gcc/configure.ac index c067770cb59..04ea19d340d 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -2444,6 +2444,17 @@ foo: .long 25 tls_first_minor=13 tls_as_opt=--fatal-warnings ;; + cris-*-*|crisv32-*-*) + conftest_s=' + .section ".tdata","awT",@progbits +x: .long 25 + .text + move.d x:IE,$r10 + nop' + tls_first_major=2 + tls_first_minor=20 + tls_as_opt=--fatal-warnings + ;; frv*-*-*) conftest_s=' .section ".tdata","awT",@progbits @@ -3213,7 +3224,7 @@ esac case "$target" in i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \ | x86_64*-*-* | hppa*-*-* | arm*-*-* \ - | xstormy16*-*-* | cris-*-* | xtensa*-*-* | bfin-*-* | score*-*-* \ + | xstormy16*-*-* | cris-*-* | crisv32-*-* | xtensa*-*-* | bfin-*-* | score*-*-* \ | spu-*-* | fido*-*-* | m32c-*-*) insn="nop" ;; diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e695ede3f2d..2d4c9f3aa21 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,33 @@ +2009-03-24 Jason Merrill <jason@redhat.com> + + PR c++/28274 + * name-lookup.c (pushdecl_maybe_friend): Check default args later. + +2009-03-23 Jakub Jelinek <jakub@redhat.com> + + PR c/39495 + * semantics.c (handle_omp_for_class_iterator): Swap cond operands and + code if iter is the second operand. + * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p + argument. If it is set, don't build the toplevel expression with + build_x_binary_op, but build2. + (cp_parser_assignment_expression, cp_parser_omp_for_incr): Adjust + callers. + (cp_parser_omp_for_cond): Don't assume the first operand of the + comparison must be decl. + +2009-03-23 Jason Merrill <jason@redhat.com> + + PR c++/37729 + * pt.c (make_fnparm_pack): Split out from... + (instantiate_decl): ...here. + (tsubst_pack_expansion): Handle being called in a late-specified + return type. + + PR c++/39526 + * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing + a parm with a parm. + 2009-03-20 Jason Merrill <jason@redhat.com> PR c++/28879 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 308df8c9c17..5a92dc6ed89 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -813,9 +813,6 @@ pushdecl_maybe_friend (tree x, bool is_friend) } } - if (TREE_CODE (x) == FUNCTION_DECL || DECL_FUNCTION_TEMPLATE_P (x)) - check_default_args (x); - check_template_shadow (x); /* If this is a function conjured up by the back end, massage it @@ -826,11 +823,10 @@ pushdecl_maybe_friend (tree x, bool is_friend) SET_DECL_LANGUAGE (x, lang_c); } + t = x; if (DECL_NON_THUNK_FUNCTION_P (x) && ! DECL_FUNCTION_MEMBER_P (x)) { t = push_overloaded_decl (x, PUSH_LOCAL, is_friend); - if (t != x) - POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t); if (!namespace_bindings_p ()) /* We do not need to create a binding for this name; push_overloaded_decl will have already done so if @@ -842,9 +838,14 @@ pushdecl_maybe_friend (tree x, bool is_friend) t = push_overloaded_decl (x, PUSH_GLOBAL, is_friend); if (t == x) add_decl_to_level (x, NAMESPACE_LEVEL (CP_DECL_CONTEXT (t))); - POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t); } + if (TREE_CODE (x) == FUNCTION_DECL || DECL_FUNCTION_TEMPLATE_P (x)) + check_default_args (x); + + if (t != x || DECL_FUNCTION_TEMPLATE_P (t)) + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t); + /* If declaring a type as a typedef, copy the type (unless we're at line 0), and install this TYPE_DECL as the new type's typedef name. See the extensive comment in ../c-decl.c (pushdecl). */ @@ -1031,7 +1032,10 @@ pushdecl_maybe_friend (tree x, bool is_friend) } } - if (warn_shadow && !err) + if (warn_shadow && !err + /* Don't complain about the parms we push and then pop + while tentatively parsing a function declarator. */ + && !(TREE_CODE (x) == PARM_DECL && DECL_CONTEXT (x) == NULL_TREE)) { warning (OPT_Wshadow, "declaration of %q#D shadows a parameter", x); warning (OPT_Wshadow, "%Jshadowed declaration is here", oldlocal); diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index d3343aa6097..02a96ccc4a4 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -1615,7 +1615,7 @@ static tree cp_parser_delete_expression static tree cp_parser_cast_expression (cp_parser *, bool, bool, cp_id_kind *); static tree cp_parser_binary_expression - (cp_parser *, bool, enum cp_parser_prec, cp_id_kind *); + (cp_parser *, bool, bool, enum cp_parser_prec, cp_id_kind *); static tree cp_parser_question_colon_clause (cp_parser *, tree); static tree cp_parser_assignment_expression @@ -6215,6 +6215,7 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p, bool cast_p, static tree cp_parser_binary_expression (cp_parser* parser, bool cast_p, + bool no_toplevel_fold_p, enum cp_parser_prec prec, cp_id_kind * pidk) { @@ -6297,6 +6298,7 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p, goto get_rhs; pop: + lookahead_prec = new_prec; /* If the stack is not empty, we have parsed into LHS the right side (`4' in the example above) of an expression we had suspended. We can use the information on the stack to recover the LHS (`3') @@ -6321,8 +6323,14 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p, pass the correct tree_code unless the unary expression was surrounded by parentheses. */ - lhs = build_x_binary_op (tree_type, lhs, lhs_type, rhs, rhs_type, - &overloaded_p, tf_warning_or_error); + if (no_toplevel_fold_p + && lookahead_prec <= prec + && sp == stack + && TREE_CODE_CLASS (tree_type) == tcc_comparison) + lhs = build2 (tree_type, boolean_type_node, lhs, rhs); + else + lhs = build_x_binary_op (tree_type, lhs, lhs_type, rhs, rhs_type, + &overloaded_p, tf_warning_or_error); lhs_type = tree_type; /* If the binary operator required the use of an overloaded operator, @@ -6408,7 +6416,8 @@ cp_parser_assignment_expression (cp_parser* parser, bool cast_p, else { /* Parse the binary expressions (logical-or-expression). */ - expr = cp_parser_binary_expression (parser, cast_p, PREC_NOT_OPERATOR, pidk); + expr = cp_parser_binary_expression (parser, cast_p, false, + PREC_NOT_OPERATOR, pidk); /* If the next token is a `?' then we're actually looking at a conditional-expression. */ if (cp_lexer_next_token_is (parser->lexer, CPP_QUERY)) @@ -21015,41 +21024,39 @@ cp_parser_omp_flush (cp_parser *parser, cp_token *pragma_tok) static tree cp_parser_omp_for_cond (cp_parser *parser, tree decl) { - tree lhs = cp_parser_cast_expression (parser, false, false, NULL), rhs; - enum tree_code op; - cp_token *token; + tree cond = cp_parser_binary_expression (parser, false, true, + PREC_NOT_OPERATOR, NULL); + bool overloaded_p; - if (decl && lhs != decl) + if (cond == error_mark_node + || cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON)) { cp_parser_skip_to_end_of_statement (parser); return error_mark_node; } - token = cp_lexer_peek_token (parser->lexer); - op = binops_by_token [token->type].tree_type; - switch (op) + switch (TREE_CODE (cond)) { - case LT_EXPR: - case LE_EXPR: case GT_EXPR: case GE_EXPR: + case LT_EXPR: + case LE_EXPR: break; default: - cp_parser_skip_to_end_of_statement (parser); return error_mark_node; } - cp_lexer_consume_token (parser->lexer); - rhs = cp_parser_binary_expression (parser, false, - PREC_RELATIONAL_EXPRESSION, NULL); - if (rhs == error_mark_node - || cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON)) - { - cp_parser_skip_to_end_of_statement (parser); - return error_mark_node; - } + /* If decl is an iterator, preserve LHS and RHS of the relational + expr until finish_omp_for. */ + if (decl + && (type_dependent_expression_p (decl) + || CLASS_TYPE_P (TREE_TYPE (decl)))) + return cond; - return build2 (op, boolean_type_node, lhs, rhs); + return build_x_binary_op (TREE_CODE (cond), + TREE_OPERAND (cond, 0), ERROR_MARK, + TREE_OPERAND (cond, 1), ERROR_MARK, + &overloaded_p, tf_warning_or_error); } /* Helper function, to parse omp for increment expression. */ @@ -21098,7 +21105,7 @@ cp_parser_omp_for_incr (cp_parser *parser, tree decl) return build2 (MODIFY_EXPR, TREE_TYPE (decl), decl, rhs); } - lhs = cp_parser_binary_expression (parser, false, + lhs = cp_parser_binary_expression (parser, false, false, PREC_ADDITIVE_EXPRESSION, NULL); token = cp_lexer_peek_token (parser->lexer); decl_first = lhs == decl; @@ -21112,7 +21119,7 @@ cp_parser_omp_for_incr (cp_parser *parser, tree decl) { op = token->type == CPP_PLUS ? PLUS_EXPR : MINUS_EXPR; cp_lexer_consume_token (parser->lexer); - rhs = cp_parser_binary_expression (parser, false, + rhs = cp_parser_binary_expression (parser, false, false, PREC_ADDITIVE_EXPRESSION, NULL); token = cp_lexer_peek_token (parser->lexer); if (token->type == CPP_PLUS || token->type == CPP_MINUS || decl_first) diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 1c408237c6f..5092c72b177 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -174,6 +174,7 @@ static tree tsubst (tree, tree, tsubst_flags_t, tree); static tree tsubst_expr (tree, tree, tsubst_flags_t, tree, bool); static tree tsubst_copy (tree, tree, tsubst_flags_t, tree); static tree tsubst_pack_expansion (tree, tree, tsubst_flags_t, tree); +static tree tsubst_decl (tree, tree, tsubst_flags_t); /* Make the current scope suitable for access checking when we are processing T. T can be FUNCTION_DECL for instantiated function @@ -7435,6 +7436,37 @@ tsubst_template_arg (tree t, tree args, tsubst_flags_t complain, tree in_decl) return r; } +/* Give a chain SPEC_PARM of PARM_DECLs, pack them into a + NONTYPE_ARGUMENT_PACK. */ + +static tree +make_fnparm_pack (tree spec_parm) +{ + /* Collect all of the extra "packed" parameters into an + argument pack. */ + tree parmvec; + tree parmtypevec; + tree argpack = make_node (NONTYPE_ARGUMENT_PACK); + tree argtypepack = make_node (TYPE_ARGUMENT_PACK); + int i, len = list_length (spec_parm); + + /* Fill in PARMVEC and PARMTYPEVEC with all of the parameters. */ + parmvec = make_tree_vec (len); + parmtypevec = make_tree_vec (len); + for (i = 0; i < len; i++, spec_parm = TREE_CHAIN (spec_parm)) + { + TREE_VEC_ELT (parmvec, i) = spec_parm; + TREE_VEC_ELT (parmtypevec, i) = TREE_TYPE (spec_parm); + } + + /* Build the argument packs. */ + SET_ARGUMENT_PACK_ARGS (argpack, parmvec); + SET_ARGUMENT_PACK_ARGS (argtypepack, parmtypevec); + TREE_TYPE (argpack) = argtypepack; + + return argpack; +} + /* Substitute ARGS into T, which is an pack expansion (i.e. TYPE_PACK_EXPANSION or EXPR_PACK_EXPANSION). Returns a TREE_VEC with the substituted arguments, a PACK_EXPANSION_* node @@ -7449,6 +7481,7 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain, tree first_arg_pack; int i, len = -1; tree result; int incomplete = 0; + bool very_local_specializations = false; gcc_assert (PACK_EXPANSION_P (t)); pattern = PACK_EXPANSION_PATTERN (t); @@ -7465,7 +7498,18 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain, tree orig_arg = NULL_TREE; if (TREE_CODE (parm_pack) == PARM_DECL) - arg_pack = retrieve_local_specialization (parm_pack); + { + arg_pack = retrieve_local_specialization (parm_pack); + if (arg_pack == NULL_TREE) + { + /* This can happen for a parameter name used later in a function + declaration (such as in a late-specified return type). Just + make a dummy decl, since it's only used for its type. */ + gcc_assert (skip_evaluation); + arg_pack = tsubst_decl (parm_pack, args, complain); + arg_pack = make_fnparm_pack (arg_pack); + } + } else { int level, idx, levels; @@ -7559,6 +7603,17 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain, if (len < 0) return error_mark_node; + if (!local_specializations) + { + /* We're in a late-specified return type, so we don't have a local + specializations table. Create one for doing this expansion. */ + very_local_specializations = true; + local_specializations = htab_create (37, + hash_local_specialization, + eq_local_specializations, + NULL); + } + /* For each argument in each argument pack, substitute into the pattern. */ result = make_tree_vec (len + incomplete); @@ -7620,7 +7675,7 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain, break; } } - + /* Update ARGS to restore the substitution from parameter packs to their argument packs. */ for (pack = packs; pack; pack = TREE_CHAIN (pack)) @@ -7643,6 +7698,12 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain, } } + if (very_local_specializations) + { + htab_delete (local_specializations); + local_specializations = NULL; + } + return result; } @@ -15477,37 +15538,12 @@ instantiate_decl (tree d, int defer_ok, } if (tmpl_parm && FUNCTION_PARAMETER_PACK_P (tmpl_parm)) { - /* Collect all of the extra "packed" parameters into an - argument pack. */ - tree parmvec; - tree parmtypevec; - tree argpack = make_node (NONTYPE_ARGUMENT_PACK); - tree argtypepack = make_node (TYPE_ARGUMENT_PACK); - int i, len = 0; - tree t; - - /* Count how many parameters remain. */ - for (t = spec_parm; t; t = TREE_CHAIN (t)) - len++; - - /* Fill in PARMVEC and PARMTYPEVEC with all of the parameters. */ - parmvec = make_tree_vec (len); - parmtypevec = make_tree_vec (len); - for(i = 0; i < len; i++, spec_parm = TREE_CHAIN (spec_parm)) - { - TREE_VEC_ELT (parmvec, i) = spec_parm; - TREE_VEC_ELT (parmtypevec, i) = TREE_TYPE (spec_parm); - } - - /* Build the argument packs. */ - SET_ARGUMENT_PACK_ARGS (argpack, parmvec); - SET_ARGUMENT_PACK_ARGS (argtypepack, parmtypevec); - TREE_TYPE (argpack) = argtypepack; - /* Register the (value) argument pack as a specialization of TMPL_PARM, then move on. */ + tree argpack = make_fnparm_pack (spec_parm); register_local_specialization (argpack, tmpl_parm); tmpl_parm = TREE_CHAIN (tmpl_parm); + spec_parm = NULL_TREE; } gcc_assert (!spec_parm); diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index c7289700728..71fc43e855a 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -3921,6 +3921,9 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv, case GE_EXPR: case LT_EXPR: case LE_EXPR: + if (TREE_OPERAND (cond, 1) == iter) + cond = build2 (swap_tree_comparison (TREE_CODE (cond)), + TREE_TYPE (cond), iter, TREE_OPERAND (cond, 0)); if (TREE_OPERAND (cond, 0) != iter) cond = error_mark_node; else diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index d1c86dc6ea9..efef455d6a8 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -4408,11 +4408,11 @@ This option works only with DWARF 2. @item -fno-merge-debug-strings @opindex fmerge-debug-strings @opindex fno-merge-debug-strings -Direct the linker to merge together strings which are identical in -different object files. This is not supported by all assemblers or -linker. This decreases the size of the debug information in the -output file at the cost of increasing link processing time. This is -on by default. +Direct the linker to not merge together strings in the debugging +information which are identical in different object files. Merging is +not supported by all assemblers or linkers. Merging decreases the size +of the debug information in the output file at the cost of increasing +link processing time. Merging is enabled by default. @item -fdebug-prefix-map=@var{old}=@var{new} @opindex fdebug-prefix-map @@ -10212,11 +10212,21 @@ Schedules as an EV6 and supports the BWX, FIX, and MAX extensions. Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions. @end table +Native Linux/GNU toolchains also support the value @samp{native}, +which selects the best architecture option for the host processor. +@option{-mcpu=native} has no effect if GCC does not recognize +the processor. + @item -mtune=@var{cpu_type} @opindex mtune Set only the instruction scheduling parameters for machine type @var{cpu_type}. The instruction set is not changed. +Native Linux/GNU toolchains also support the value @samp{native}, +which selects the best architecture option for the host processor. +@option{-mtune=native} has no effect if GCC does not recognize +the processor. + @item -mmemory-latency=@var{time} @opindex mmemory-latency Sets the latency the scheduler should assume for typical memory diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 133136b5bc5..9bf0803ce57 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -3499,9 +3499,9 @@ typedef struct dw_loc_descr_struct GTY(()) { dw_loc_descr_ref dw_loc_next; enum dwarf_location_atom dw_loc_opc; + int dw_loc_addr; dw_val_node dw_loc_oprnd1; dw_val_node dw_loc_oprnd2; - int dw_loc_addr; } dw_loc_descr_node; @@ -13978,6 +13978,14 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die) return; } + /* If the compiler emitted a definition for the DECL declaration + and if we already emitted a DIE for it, don't emit a second + DIE for it again. */ + if (old_die + && declaration + && old_die->die_parent == context_die) + return; + var_die = new_die (DW_TAG_variable, context_die, decl); origin_die = NULL; diff --git a/gcc/function.h b/gcc/function.h index f9bdda8594d..31d223a3d39 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -501,9 +501,6 @@ struct function GTY(()) pointer. */ tree nonlocal_goto_save_area; - /* Function sequence number for profiling, debugging, etc. */ - int funcdef_no; - /* List of function local variables, functions, types and constants. */ tree local_decls; @@ -521,6 +518,9 @@ struct function GTY(()) /* Last statement uid. */ int last_stmt_uid; + /* Function sequence number for profiling, debugging, etc. */ + int funcdef_no; + /* Line number of the start of the function for debugging purposes. */ location_t function_start_locus; diff --git a/gcc/lambda-code.c b/gcc/lambda-code.c index 794d4e8b256..07b9469e35e 100644 --- a/gcc/lambda-code.c +++ b/gcc/lambda-code.c @@ -2472,7 +2472,8 @@ perfect_nestify (struct loop *loop, it to one just in case. */ exit_condition = get_loop_exit_condition (newloop); - uboundvar = create_tmp_var (integer_type_node, "uboundvar"); + uboundvar = create_tmp_var (TREE_TYPE (VEC_index (tree, ubounds, 0)), + "uboundvar"); add_referenced_var (uboundvar); stmt = gimple_build_assign (uboundvar, VEC_index (tree, ubounds, 0)); uboundvar = make_ssa_name (uboundvar, stmt); diff --git a/gcc/reload.h b/gcc/reload.h index 17d8a3e04b2..3789680f7ca 100644 --- a/gcc/reload.h +++ b/gcc/reload.h @@ -205,10 +205,22 @@ struct insn_chain all insns that need reloading. */ struct insn_chain *next_need_reload; - /* The basic block this insn is in. */ - int block; /* The rtx of the insn. */ rtx insn; + + /* The basic block this insn is in. */ + int block; + + /* Nonzero if find_reloads said the insn requires reloading. */ + unsigned int need_reload:1; + /* Nonzero if find_reloads needs to be run during reload_as_needed to + perform modifications on any operands. */ + unsigned int need_operand_change:1; + /* Nonzero if eliminate_regs_in_insn said it requires eliminations. */ + unsigned int need_elim:1; + /* Nonzero if this insn was inserted by perform_caller_saves. */ + unsigned int is_caller_save_insn:1; + /* Register life information: record all live hard registers, and all live pseudos that have a hard register. This set also contains pseudos spilled by IRA. */ @@ -221,16 +233,6 @@ struct insn_chain /* Indicates which registers have already been used for spills. */ HARD_REG_SET used_spill_regs; - - /* Nonzero if find_reloads said the insn requires reloading. */ - unsigned int need_reload:1; - /* Nonzero if find_reloads needs to be run during reload_as_needed to - perform modifications on any operands. */ - unsigned int need_operand_change:1; - /* Nonzero if eliminate_regs_in_insn said it requires eliminations. */ - unsigned int need_elim:1; - /* Nonzero if this insn was inserted by perform_caller_saves. */ - unsigned int is_caller_save_insn:1; }; /* A chain of insn_chain structures to describe all non-note insns in diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index abad6bab033..afe6b7eb81d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,53 @@ +2009-03-25 Alexander Monakov <amonakov@ispras.ru> + + * gcc.target/ia64/20090324-1.c: New test. + +2009-03-25 Jakub Jelinek <jakub@redhat.com> + + PR c/27898 + * gcc.dg/pr27898.c: New test. + + PR tree-optimization/32139 + * gcc.c-torture/compile/pr32139.c: New test. + +2009-03-24 Jason Merrill <jason@redhat.com> + + PR c++/28274 + * g++.dg/parse/defarg14.C: New test. + +2009-03-24 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libfortran/39528 + * gfortran.dg/read_repeat.f90: New test. + +2009-03-24 Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/39529 + * gcc.dg/vect/pr39529.c: New test. + +2009-03-24 Dodji Seketeli <dodji@redhat.com> + Jakub Jelinek <jakub@redhat.com> + + PR debug/39524 + * g++.dg/debug/dwarf2/imported-decl-1.C: New test. + +2009-03-23 Jakub Jelinek <jakub@redhat.com> + + PR c/39495 + * gcc.dg/gomp/pr39495-2.c: Remove xfails. + +2009-03-23 Jason Merrill <jason@redhat.com> + + * g++.dg/cpp0x/auto12.C: Add variadic test. + + PR c++/39526 + * g++.dg/warn/Wshadow-4.C: New test. + +2009-03-23 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/39516 + * gfortran.dg/pr39516.f: New test. + 2009-03-22 Hans-Peter Nilsson <hp@axis.com> * lib/target-libpath.exp (set_ld_library_path_env_vars): diff --git a/gcc/testsuite/g++.dg/cpp0x/auto12.C b/gcc/testsuite/g++.dg/cpp0x/auto12.C index 45ceedfdc88..34dc8c90b84 100644 --- a/gcc/testsuite/g++.dg/cpp0x/auto12.C +++ b/gcc/testsuite/g++.dg/cpp0x/auto12.C @@ -35,6 +35,15 @@ auto A<T>::f(U u) -> decltype (u + i) return u + i; } +template <class... Args> +int f (Args... args); + +template <class... Args> +auto g (Args... args) -> decltype (f ((args+1)...)) +{ + return (f ((args+1)...)); +} + int main() { // { dg-final { scan-assembler "_ZN1AIiE1fIiEEDTplfp_L_ZNS0_1iEEET_" } } @@ -49,4 +58,6 @@ int main() A<int>().h(1); // { dg-final { scan-assembler "_ZN1AIiE1jIiEEDTplfp_clL_Z1xvEEET_" } } A<int>().j(1); + // { dg-final { scan-assembler "_Z1gIIidEEDTclL_Z1fEspplfp_Li1EEEDpT_" } } + g(42, 1.0); } diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-1.C new file mode 100644 index 00000000000..bfdb4f8f5a0 --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-1.C @@ -0,0 +1,17 @@ +// PR debug/39524 +// { dg-do compile } +// { dg-options "-gdwarf-2 -dA -O0 -fno-merge-debug-strings" } + +namespace A +{ + static int var2 = 2; +} + +int +func () +{ + using A::var2; + return var2; +} + +// { dg-final { scan-assembler-times "var2\[^\n\r\]*DW_AT_name" 1 } } diff --git a/gcc/testsuite/g++.dg/parse/defarg14.C b/gcc/testsuite/g++.dg/parse/defarg14.C new file mode 100644 index 00000000000..0930b45eea4 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/defarg14.C @@ -0,0 +1,6 @@ +// PR c++/28274 + +extern "C" { +void foo (int i, int j = 6); +void foo (int i = 4, int j); +} diff --git a/gcc/testsuite/g++.dg/warn/Wshadow-4.C b/gcc/testsuite/g++.dg/warn/Wshadow-4.C new file mode 100644 index 00000000000..16399b2fb60 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wshadow-4.C @@ -0,0 +1,20 @@ +// PR c++/39526 +// { dg-options "-Wshadow" } + +class INetURLObject +{ +public: + INetURLObject(int i); + int GetMainURL() const; +}; + +int foo(int infoo) // { dg-warning "shadowed declaration" } +{ + int outfoo( INetURLObject( infoo ).GetMainURL()); // { dg-bogus "shadows" } + extern void f(int infoo); + struct A + { + void f(int infoo) { } // { dg-warning "shadows a parameter" } + }; + return outfoo; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pr32139.c b/gcc/testsuite/gcc.c-torture/compile/pr32139.c new file mode 100644 index 00000000000..7b8522f5174 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr32139.c @@ -0,0 +1,11 @@ +/* PR tree-optimization/32139 */ +int foo (void); +int bar (void) __attribute__ ((const)); + +int +test (int x) +{ + int a = (x == 10000 ? foo : bar) (); + int b = (x == 10000 ? foo : bar) (); + return a + b; +} diff --git a/gcc/testsuite/gcc.dg/gomp/pr39495-2.c b/gcc/testsuite/gcc.dg/gomp/pr39495-2.c index e46369637b7..a276c24ed98 100644 --- a/gcc/testsuite/gcc.dg/gomp/pr39495-2.c +++ b/gcc/testsuite/gcc.dg/gomp/pr39495-2.c @@ -13,25 +13,25 @@ foo (void) unsigned int u; #pragma omp for - for (i = INT_MIN + 6; i != INT_MIN; i--) /* { dg-error "invalid controlling predicate" "" { xfail *-*-* } } */ + for (i = INT_MIN + 6; i != INT_MIN; i--) /* { dg-error "invalid controlling predicate" } */ ; #pragma omp for for (i = INT_MIN + 6; i == INT_MIN; i--) /* { dg-error "invalid controlling predicate" } */ ; #pragma omp for - for (i = INT_MAX - 6; i != INT_MAX; i++) /* { dg-error "invalid controlling predicate" "" { xfail *-*-* } } */ + for (i = INT_MAX - 6; i != INT_MAX; i++) /* { dg-error "invalid controlling predicate" } */ ; #pragma omp for for (i = INT_MAX - 6; i == INT_MAX; i++) /* { dg-error "invalid controlling predicate" } */ ; #pragma omp for - for (u = 6; u != 0; u--) /* { dg-error "invalid controlling predicate" "" { xfail *-*-* } } */ + for (u = 6; u != 0; u--) /* { dg-error "invalid controlling predicate" } */ ; #pragma omp for for (u = 6; u == 0; u--) /* { dg-error "invalid controlling predicate" } */ ; #pragma omp for - for (u = UINT_MAX - 6; u != UINT_MAX; u++) /* { dg-error "invalid controlling predicate" "" { xfail *-*-* } } */ + for (u = UINT_MAX - 6; u != UINT_MAX; u++) /* { dg-error "invalid controlling predicate" } */ ; #pragma omp for for (u = UINT_MAX - 6; u == UINT_MAX; u++) /* { dg-error "invalid controlling predicate" } */ diff --git a/gcc/testsuite/gcc.dg/pr27898.c b/gcc/testsuite/gcc.dg/pr27898.c new file mode 100644 index 00000000000..bb7cce17550 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr27898.c @@ -0,0 +1,8 @@ +/* PR c/27898 */ +/* { dg-do compile } */ +/* { dg-options "--combine" } */ +/* { dg-additional-sources "pr27898.c" } */ + +union u { struct { int i; }; }; + +extern int foo (union u *); diff --git a/gcc/testsuite/gcc.dg/vect/pr39529.c b/gcc/testsuite/gcc.dg/vect/pr39529.c new file mode 100644 index 00000000000..4853c13503f --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr39529.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ + +void +foo (void) +{ + char a[1024]; + char *p = &a[0]; + char *p2; + + p2 = p + 1024; + do + { + p += 2; + *(p-2) = 1; + *(p-1) = 1; + } while (p < p2); +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ + + diff --git a/gcc/testsuite/gcc.target/ia64/20090324-1.c b/gcc/testsuite/gcc.target/ia64/20090324-1.c new file mode 100644 index 00000000000..d9aff6a18b4 --- /dev/null +++ b/gcc/testsuite/gcc.target/ia64/20090324-1.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fmodulo-sched" } */ + +static char *place_region_bounds_x, *place_region_bounds_y; +static void read_place () { + char msg[300]; + update_screen (msg); +} +static void alloc_and_load_placement_structs () { + int i, j; + for (j=0; + j<100; + j++) { + place_region_bounds_x[i] = place_region_bounds_x[i-1]; + place_region_bounds_y[i] = place_region_bounds_y[i-1]; + } +} +void place_and_route () { + read_place (); + alloc_and_load_placement_structs (); +} diff --git a/gcc/testsuite/gfortran.dg/pr39516.f b/gcc/testsuite/gfortran.dg/pr39516.f new file mode 100644 index 00000000000..3d6104a8ebf --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr39516.f @@ -0,0 +1,20 @@ +C PR tree-optimization/39516 +C { dg-do compile } +C { dg-options "-O2 -ftree-loop-linear" } + SUBROUTINE SUB(A, B, M) + IMPLICIT NONE + DOUBLE PRECISION A(20,20), B(20) + INTEGER*8 I, J, K, M + DO I=1,M + DO J=1,M + A(I,J)=A(I,J)+1 + END DO + END DO + DO K=1,20 + DO I=1,M + DO J=1,M + B(I)=B(I)+A(I,J) + END DO + END DO + END DO + END SUBROUTINE diff --git a/gcc/testsuite/gfortran.dg/read_repeat.f90 b/gcc/testsuite/gfortran.dg/read_repeat.f90 new file mode 100644 index 00000000000..192ebe81ffb --- /dev/null +++ b/gcc/testsuite/gfortran.dg/read_repeat.f90 @@ -0,0 +1,24 @@ +! { dg-do run } +! PR39528 repeated entries not read when using list-directed input. +! Test case derived from reporters example. +program rread + implicit none + integer :: iarr(1:7), ia, ib, i + + iarr = 0 + + write(10,*) " 2*1 3*2 /" + write(10,*) " 12" + write(10,*) " 13" + rewind(10) + + read(10,*) (iarr(i), i=1,7) + read(10,*) ia, ib + + if (any(iarr(1:2).ne.1)) call abort + if (any(iarr(3:5).ne.2)) call abort + if (any(iarr(6:7).ne.0)) call abort + if (ia .ne. 12 .or. ib .ne. 13) call abort + + close(10, status="delete") +end program rread diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 732bc6f7938..384fe1867cd 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -1817,9 +1817,9 @@ compute_topo_order (constraint_graph_t graph, typedef struct equiv_class_label { + hashval_t hashcode; unsigned int equivalence_class; bitmap labels; - hashval_t hashcode; } *equiv_class_label_t; typedef const struct equiv_class_label *const_equiv_class_label_t; diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c index 2afd4e03394..a048342d8be 100644 --- a/gcc/tree-vect-transform.c +++ b/gcc/tree-vect-transform.c @@ -1099,7 +1099,10 @@ vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop, if (!MTAG_P (tag)) new_type_alias (vect_ptr, tag, DR_REF (dr)); else - set_symbol_mem_tag (vect_ptr, tag); + { + set_symbol_mem_tag (vect_ptr, tag); + mark_sym_for_renaming (tag); + } /** Note: If the dataref is in an inner-loop nested in LOOP, and we are vectorizing LOOP (i.e. outer-loop vectorization), we need to create two diff --git a/gcc/tree.h b/gcc/tree.h index 1f70e0461ea..e1c52e135b3 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -2286,6 +2286,7 @@ struct tree_type GTY(()) unsigned user_align : 1; unsigned int align; + alias_set_type alias_set; tree pointer_to; tree reference_to; union tree_type_symtab { @@ -2302,7 +2303,6 @@ struct tree_type GTY(()) tree binfo; tree context; tree canonical; - alias_set_type alias_set; /* Points to a structure whose details depend on the language in use. */ struct lang_type *lang_specific; }; diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 4613306ce79..500280604f0 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2009-03-24 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libfortran/39528 + * io/list_read.c (list_formatted_read_scalar): Move check for read + completion to just after the check for a repeated value. + 2009-03-08 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/39402 diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index 1f1023c10d2..6b22d34a0b6 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008 +/* Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Andy Vaught Namelist input contributed by Paul Thomas @@ -1720,9 +1720,6 @@ list_formatted_read_scalar (st_parameter_dt *dtp, volatile bt type, void *p, } else { - if (dtp->u.p.input_complete) - goto cleanup; - if (dtp->u.p.repeat_count > 0) { if (check_type (dtp, type, kind)) @@ -1730,6 +1727,9 @@ list_formatted_read_scalar (st_parameter_dt *dtp, volatile bt type, void *p, goto set_value; } + if (dtp->u.p.input_complete) + goto cleanup; + if (dtp->u.p.at_eol) finish_separator (dtp); else diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 26b6457ff23..a77fdde70e9 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,17 @@ +2009-03-25 Uros Bizjak <ubizjak@gmail.com> + + * testsuite/libgomp.c/atomic-5.c: Cleanup cpuid usage. + * testsuite/libgomp.c/atomic-6.c: Ditto. + +2009-03-23 Jakub Jelinek <jakub@redhat.com> + + PR c/39495 + * testsuite/libgomp.c/loop-12.c: New test. + * testsuite/libgomp.c/loop-11.c: New test. + * testsuite/libgomp.c++/loop-11.C: New test. + * testsuite/libgomp.c++/loop-12.C: New test. + * testsuite/libgomp.c++/for-8.C: New test. + 2009-03-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * configure: Regenerate. @@ -16,7 +30,7 @@ 2009-01-19 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk> - * testsuite/lib/libgomp.exp: Add -B option for targets that + * testsuite/lib/libgomp.exp: Add -B option for targets that use libgfortran.a%s in their specs. 2009-01-07 Jakub Jelinek <jakub@redhat.com> diff --git a/libgomp/testsuite/libgomp.c++/for-8.C b/libgomp/testsuite/libgomp.c++/for-8.C new file mode 100644 index 00000000000..918de7cc851 --- /dev/null +++ b/libgomp/testsuite/libgomp.c++/for-8.C @@ -0,0 +1,291 @@ +// { dg-do run } + +typedef __PTRDIFF_TYPE__ ptrdiff_t; +extern "C" void abort (); + +template <typename T> +class I +{ +public: + typedef ptrdiff_t difference_type; + I (); + ~I (); + I (T *); + I (const I &); + T &operator * (); + T *operator -> (); + T &operator [] (const difference_type &) const; + I &operator = (const I &); + I &operator ++ (); + I operator ++ (int); + I &operator -- (); + I operator -- (int); + I &operator += (const difference_type &); + I &operator -= (const difference_type &); + I operator + (const difference_type &) const; + I operator - (const difference_type &) const; + template <typename S> friend bool operator == (I<S> &, I<S> &); + template <typename S> friend bool operator == (const I<S> &, const I<S> &); + template <typename S> friend bool operator < (I<S> &, I<S> &); + template <typename S> friend bool operator < (const I<S> &, const I<S> &); + template <typename S> friend bool operator <= (I<S> &, I<S> &); + template <typename S> friend bool operator <= (const I<S> &, const I<S> &); + template <typename S> friend bool operator > (I<S> &, I<S> &); + template <typename S> friend bool operator > (const I<S> &, const I<S> &); + template <typename S> friend bool operator >= (I<S> &, I<S> &); + template <typename S> friend bool operator >= (const I<S> &, const I<S> &); + template <typename S> friend typename I<S>::difference_type operator - (I<S> &, I<S> &); + template <typename S> friend typename I<S>::difference_type operator - (const I<S> &, const I<S> &); + template <typename S> friend I<S> operator + (typename I<S>::difference_type , const I<S> &); +private: + T *p; +}; +template <typename T> I<T>::I () : p (0) {} +template <typename T> I<T>::~I () {} +template <typename T> I<T>::I (T *x) : p (x) {} +template <typename T> I<T>::I (const I &x) : p (x.p) {} +template <typename T> T &I<T>::operator * () { return *p; } +template <typename T> T *I<T>::operator -> () { return p; } +template <typename T> T &I<T>::operator [] (const difference_type &x) const { return p[x]; } +template <typename T> I<T> &I<T>::operator = (const I &x) { p = x.p; return *this; } +template <typename T> I<T> &I<T>::operator ++ () { ++p; return *this; } +template <typename T> I<T> I<T>::operator ++ (int) { return I (p++); } +template <typename T> I<T> &I<T>::operator -- () { --p; return *this; } +template <typename T> I<T> I<T>::operator -- (int) { return I (p--); } +template <typename T> I<T> &I<T>::operator += (const difference_type &x) { p += x; return *this; } +template <typename T> I<T> &I<T>::operator -= (const difference_type &x) { p -= x; return *this; } +template <typename T> I<T> I<T>::operator + (const difference_type &x) const { return I (p + x); } +template <typename T> I<T> I<T>::operator - (const difference_type &x) const { return I (p - x); } +template <typename T> bool operator == (I<T> &x, I<T> &y) { return x.p == y.p; } +template <typename T> bool operator == (const I<T> &x, const I<T> &y) { return x.p == y.p; } +template <typename T> bool operator != (I<T> &x, I<T> &y) { return !(x == y); } +template <typename T> bool operator != (const I<T> &x, const I<T> &y) { return !(x == y); } +template <typename T> bool operator < (I<T> &x, I<T> &y) { return x.p < y.p; } +template <typename T> bool operator < (const I<T> &x, const I<T> &y) { return x.p < y.p; } +template <typename T> bool operator <= (I<T> &x, I<T> &y) { return x.p <= y.p; } +template <typename T> bool operator <= (const I<T> &x, const I<T> &y) { return x.p <= y.p; } +template <typename T> bool operator > (I<T> &x, I<T> &y) { return x.p > y.p; } +template <typename T> bool operator > (const I<T> &x, const I<T> &y) { return x.p > y.p; } +template <typename T> bool operator >= (I<T> &x, I<T> &y) { return x.p >= y.p; } +template <typename T> bool operator >= (const I<T> &x, const I<T> &y) { return x.p >= y.p; } +template <typename T> typename I<T>::difference_type operator - (I<T> &x, I<T> &y) { return x.p - y.p; } +template <typename T> typename I<T>::difference_type operator - (const I<T> &x, const I<T> &y) { return x.p - y.p; } +template <typename T> I<T> operator + (typename I<T>::difference_type x, const I<T> &y) { return I<T> (x + y.p); } + +template <typename T> +class J +{ +public: + J(const I<T> &x, const I<T> &y) : b (x), e (y) {} + const I<T> &begin (); + const I<T> &end (); +private: + I<T> b, e; +}; + +template <typename T> const I<T> &J<T>::begin () { return b; } +template <typename T> const I<T> &J<T>::end () { return e; } + +int results[2000]; + +template <typename T> +void +baz (I<T> &i) +{ + if (*i < 0 || *i >= 2000) + abort (); + results[*i]++; +} + +void +f1 (const I<int> &x, const I<int> &y) +{ +#pragma omp parallel for + for (I<int> i = x; y >= i; i += 6) + baz (i); +} + +void +f2 (const I<int> &x, const I<int> &y) +{ + I<int> i; +#pragma omp parallel for private(i) + for (i = x; y - 1 > i; i = 1 - 6 + 7 + i) + baz (i); +} + +template <typename T> +void +f3 (const I<int> &x, const I<int> &y) +{ +#pragma omp parallel for + for (I<int> i = x; y >= i; i = i + 9 - 8) + baz (i); +} + +template <typename T> +void +f4 (const I<int> &x, const I<int> &y) +{ + I<int> i; +#pragma omp parallel for lastprivate(i) + for (i = x + 2000 - 64; y + 10 < i; --i) + baz (i); +} + +void +f5 (const I<int> &x, const I<int> &y) +{ +#pragma omp parallel for + for (I<int> i = x + 2000 - 64; y + 10 < i; i -= 10) + baz (i); +} + +template <int N> +void +f6 (const I<int> &x, const I<int> &y) +{ +#pragma omp parallel for + for (I<int> i = x + 2000 - 64; y + 10 < i; i = i - 12 + 2) + { + I<int> j = i + N; + baz (j); + } +} + +template <int N> +void +f7 (I<int> i, const I<int> &x, const I<int> &y) +{ +#pragma omp parallel for + for (i = x - 10; y + 10 >= i; i += N) + baz (i); +} + +template <int N> +void +f8 (J<int> j) +{ + I<int> i; +#pragma omp parallel for + for (i = j.begin (); j.end () + N >= i; i += 2) + baz (i); +} + +template <typename T, int N> +void +f9 (const I<T> &x, const I<T> &y) +{ +#pragma omp parallel for + for (I<T> i = x; y >= i; i = i + N) + baz (i); +} + +template <typename T, int N> +void +f10 (const I<T> &x, const I<T> &y) +{ + I<T> i; +#pragma omp parallel for + for (i = x; y < i; i = i + N) + baz (i); +} + +template <typename T> +void +f11 (const T &x, const T &y) +{ +#pragma omp parallel + { +#pragma omp for nowait + for (T i = x; y >= i; i += 3) + baz (i); +#pragma omp single + { + T j = y + 3; + baz (j); + } + } +} + +template <typename T> +void +f12 (const T &x, const T &y) +{ + T i; +#pragma omp parallel for + for (i = x; y < i; --i) + baz (i); +} + +template <int N> +struct K +{ + template <typename T> + static void + f13 (const T &x, const T &y) + { +#pragma omp parallel for + for (T i = x; y + N >= i; i += N) + baz (i); + } +}; + +#define check(expr) \ + for (int i = 0; i < 2000; i++) \ + if (expr) \ + { \ + if (results[i] != 1) \ + abort (); \ + results[i] = 0; \ + } \ + else if (results[i]) \ + abort () + +int +main () +{ + int a[2000]; + long b[2000]; + for (int i = 0; i < 2000; i++) + { + a[i] = i; + b[i] = i; + } + f1 (&a[10], &a[1990]); + check (i >= 10 && i <= 1990 && (i - 10) % 6 == 0); + f2 (&a[0], &a[1999]); + check (i < 1998 && (i & 1) == 0); + f3<char> (&a[20], &a[1837]); + check (i >= 20 && i <= 1837); + f4<int> (&a[0], &a[30]); + check (i > 40 && i <= 2000 - 64); + f5 (&a[0], &a[100]); + check (i >= 116 && i <= 2000 - 64 && (i - 116) % 10 == 0); + f6<-10> (&a[10], &a[110]); + check (i >= 116 && i <= 2000 - 64 && (i - 116) % 10 == 0); + f7<6> (I<int> (), &a[12], &a[1800]); + check (i >= 2 && i <= 1808 && (i - 2) % 6 == 0); + f8<121> (J<int> (&a[14], &a[1803])); + check (i >= 14 && i <= 1924 && (i & 1) == 0); + f9<int, 7> (&a[33], &a[1967]); + check (i >= 33 && i <= 1967 && (i - 33) % 7 == 0); + f10<int, -7> (&a[1939], &a[17]); + check (i >= 21 && i <= 1939 && (i - 21) % 7 == 0); + f11<I<int> > (&a[16], &a[1981]); + check (i >= 16 && i <= 1984 && (i - 16) % 3 == 0); + f12<I<int> > (&a[1761], &a[37]); + check (i > 37 && i <= 1761); + K<5>::f13<I<int> > (&a[1], &a[1935]); + check (i >= 1 && i <= 1936 && (i - 1) % 5 == 0); + f9<long, 7> (&b[33], &b[1967]); + check (i >= 33 && i <= 1967 && (i - 33) % 7 == 0); + f10<long, -7> (&b[1939], &b[17]); + check (i >= 21 && i <= 1939 && (i - 21) % 7 == 0); + f11<I<long> > (&b[16], &b[1981]); + check (i >= 16 && i <= 1984 && (i - 16) % 3 == 0); + f12<I<long> > (&b[1761], &b[37]); + check (i > 37 && i <= 1761); + K<5>::f13<I<long> > (&b[1], &b[1935]); + check (i >= 1 && i <= 1936 && (i - 1) % 5 == 0); +} diff --git a/libgomp/testsuite/libgomp.c++/loop-11.C b/libgomp/testsuite/libgomp.c++/loop-11.C new file mode 100644 index 00000000000..7775b86b818 --- /dev/null +++ b/libgomp/testsuite/libgomp.c++/loop-11.C @@ -0,0 +1,276 @@ +#include <omp.h> +#include <stdlib.h> +#include <string.h> + +int +test1 () +{ + short int buf[64], *p; + int i; + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for + for (p = &buf[10]; &buf[54] > p; p++) + *p = 5; + for (i = 0; i < 64; i++) + if (buf[i] != 5 * (i >= 10 && i < 54)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for + for (p = &buf[3]; &buf[63] >= p; p += 2) + p[-2] = 6; + for (i = 0; i < 64; i++) + if (buf[i] != 6 * ((i & 1) && i <= 61)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for + for (p = &buf[16]; &buf[51] > p; p = 4 + p) + p[2] = 7; + for (i = 0; i < 64; i++) + if (buf[i] != 7 * ((i & 3) == 2 && i >= 18 && i < 53)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for + for (p = &buf[16]; &buf[40] >= p; p = p + 4ULL) + p[2] = -7; + for (i = 0; i < 64; i++) + if (buf[i] != -7 * ((i & 3) == 2 && i >= 18 && i <= 42)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for + for (p = &buf[53]; &buf[9] < p; --p) + *p = 5; + for (i = 0; i < 64; i++) + if (buf[i] != 5 * (i >= 10 && i < 54)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for + for (p = &buf[63]; &buf[3] <= p; p -= 2) + p[-2] = 6; + for (i = 0; i < 64; i++) + if (buf[i] != 6 * ((i & 1) && i <= 61)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for + for (p = &buf[48]; &buf[15] < p; p = -4 + p) + p[2] = 7; + for (i = 0; i < 64; i++) + if (buf[i] != 7 * ((i & 3) == 2 && i >= 18 && i < 53)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for + for (p = &buf[40]; &buf[16] <= p; p = p - 4ULL) + p[2] = -7; + for (i = 0; i < 64; i++) + if (buf[i] != -7 * ((i & 3) == 2 && i >= 18 && i <= 42)) + abort (); + return 0; +} + +int +test2 () +{ + int buf[64], *p; + int i; + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (static, 3) + for (p = &buf[10]; &buf[54] > p; p++) + *p = 5; + for (i = 0; i < 64; i++) + if (buf[i] != 5 * (i >= 10 && i < 54)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (static, 3) + for (p = &buf[3]; &buf[63] >= p; p += 2) + p[-2] = 6; + for (i = 0; i < 64; i++) + if (buf[i] != 6 * ((i & 1) && i <= 61)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (static, 3) + for (p = &buf[16]; &buf[51] > p; p = 4 + p) + p[2] = 7; + for (i = 0; i < 64; i++) + if (buf[i] != 7 * ((i & 3) == 2 && i >= 18 && i < 53)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (static, 3) + for (p = &buf[16]; &buf[40] >= p; p = p + 4ULL) + p[2] = -7; + for (i = 0; i < 64; i++) + if (buf[i] != -7 * ((i & 3) == 2 && i >= 18 && i <= 42)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (static, 3) + for (p = &buf[53]; &buf[9] < p; --p) + *p = 5; + for (i = 0; i < 64; i++) + if (buf[i] != 5 * (i >= 10 && i < 54)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (static, 3) + for (p = &buf[63]; &buf[3] <= p; p -= 2) + p[-2] = 6; + for (i = 0; i < 64; i++) + if (buf[i] != 6 * ((i & 1) && i <= 61)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (static, 3) + for (p = &buf[48]; &buf[15] < p; p = -4 + p) + p[2] = 7; + for (i = 0; i < 64; i++) + if (buf[i] != 7 * ((i & 3) == 2 && i >= 18 && i < 53)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (static, 3) + for (p = &buf[40]; &buf[16] <= p; p = p - 4ULL) + p[2] = -7; + for (i = 0; i < 64; i++) + if (buf[i] != -7 * ((i & 3) == 2 && i >= 18 && i <= 42)) + abort (); + return 0; +} + +int +test3 () +{ + int buf[64], *p; + int i; + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (dynamic, 3) + for (p = &buf[10]; &buf[54] > p; p++) + *p = 5; + for (i = 0; i < 64; i++) + if (buf[i] != 5 * (i >= 10 && i < 54)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (dynamic, 3) + for (p = &buf[3]; &buf[63] >= p; p += 2) + p[-2] = 6; + for (i = 0; i < 64; i++) + if (buf[i] != 6 * ((i & 1) && i <= 61)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (dynamic, 3) + for (p = &buf[16]; &buf[51] > p; p = 4 + p) + p[2] = 7; + for (i = 0; i < 64; i++) + if (buf[i] != 7 * ((i & 3) == 2 && i >= 18 && i < 53)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (dynamic, 3) + for (p = &buf[16]; &buf[40] >= p; p = p + 4ULL) + p[2] = -7; + for (i = 0; i < 64; i++) + if (buf[i] != -7 * ((i & 3) == 2 && i >= 18 && i <= 42)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (dynamic, 3) + for (p = &buf[53]; &buf[9] < p; --p) + *p = 5; + for (i = 0; i < 64; i++) + if (buf[i] != 5 * (i >= 10 && i < 54)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (dynamic, 3) + for (p = &buf[63]; &buf[3] <= p; p -= 2) + p[-2] = 6; + for (i = 0; i < 64; i++) + if (buf[i] != 6 * ((i & 1) && i <= 61)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (dynamic, 3) + for (p = &buf[48]; &buf[15] < p; p = -4 + p) + p[2] = 7; + for (i = 0; i < 64; i++) + if (buf[i] != 7 * ((i & 3) == 2 && i >= 18 && i < 53)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (dynamic, 3) + for (p = &buf[40]; &buf[16] <= p; p = p - 4ULL) + p[2] = -7; + for (i = 0; i < 64; i++) + if (buf[i] != -7 * ((i & 3) == 2 && i >= 18 && i <= 42)) + abort (); + return 0; +} + +int +test4 () +{ + int buf[64], *p; + int i; + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (runtime) + for (p = &buf[10]; &buf[54] > p; p++) + *p = 5; + for (i = 0; i < 64; i++) + if (buf[i] != 5 * (i >= 10 && i < 54)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (runtime) + for (p = &buf[3]; &buf[63] >= p; p += 2) + p[-2] = 6; + for (i = 0; i < 64; i++) + if (buf[i] != 6 * ((i & 1) && i <= 61)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (runtime) + for (p = &buf[16]; &buf[51] > p; p = 4 + p) + p[2] = 7; + for (i = 0; i < 64; i++) + if (buf[i] != 7 * ((i & 3) == 2 && i >= 18 && i < 53)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (runtime) + for (p = &buf[16]; &buf[40] >= p; p = p + 4ULL) + p[2] = -7; + for (i = 0; i < 64; i++) + if (buf[i] != -7 * ((i & 3) == 2 && i >= 18 && i <= 42)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (runtime) + for (p = &buf[53]; &buf[9] < p; --p) + *p = 5; + for (i = 0; i < 64; i++) + if (buf[i] != 5 * (i >= 10 && i < 54)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (runtime) + for (p = &buf[63]; &buf[3] <= p; p -= 2) + p[-2] = 6; + for (i = 0; i < 64; i++) + if (buf[i] != 6 * ((i & 1) && i <= 61)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (runtime) + for (p = &buf[48]; &buf[15] < p; p = -4 + p) + p[2] = 7; + for (i = 0; i < 64; i++) + if (buf[i] != 7 * ((i & 3) == 2 && i >= 18 && i < 53)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (runtime) + for (p = &buf[40]; &buf[16] <= p; p = p - 4ULL) + p[2] = -7; + for (i = 0; i < 64; i++) + if (buf[i] != -7 * ((i & 3) == 2 && i >= 18 && i <= 42)) + abort (); + return 0; +} + +int +main () +{ + test1 (); + test2 (); + test3 (); + omp_set_schedule (omp_sched_static, 0); + test4 (); + omp_set_schedule (omp_sched_static, 3); + test4 (); + omp_set_schedule (omp_sched_dynamic, 5); + test4 (); + omp_set_schedule (omp_sched_guided, 2); + test4 (); + return 0; +} diff --git a/libgomp/testsuite/libgomp.c++/loop-12.C b/libgomp/testsuite/libgomp.c++/loop-12.C new file mode 100644 index 00000000000..f8aca92b8ae --- /dev/null +++ b/libgomp/testsuite/libgomp.c++/loop-12.C @@ -0,0 +1,387 @@ +// { dg-do run } + +#include <omp.h> + +extern "C" void abort (); + +#define LLONG_MAX __LONG_LONG_MAX__ +#define ULLONG_MAX (LLONG_MAX * 2ULL + 1) +#define INT_MAX __INT_MAX__ + +int arr[6 * 5]; + +void +set (int loopidx, int idx) +{ +#pragma omp atomic + arr[loopidx * 5 + idx]++; +} + +#define check(var, val, loopidx, idx) \ + if (var == (val)) set (loopidx, idx); else +#define test(loopidx, count) \ + for (idx = 0; idx < 5; idx++) \ + if (arr[loopidx * 5 + idx] != idx < count) \ + abort (); \ + else \ + arr[loopidx * 5 + idx] = 0 + +int +test1 () +{ + int e = 0, idx; + +#pragma omp parallel reduction(+:e) + { + long long i; + unsigned long long j; + #pragma omp for schedule(dynamic,1) nowait + for (i = LLONG_MAX - 30001; LLONG_MAX - 10001 >= i; i += 10000) + { + check (i, LLONG_MAX - 30001, 0, 0) + check (i, LLONG_MAX - 20001, 0, 1) + check (i, LLONG_MAX - 10001, 0, 2) + e = 1; + } + #pragma omp for schedule(dynamic,1) nowait + for (i = -LLONG_MAX + 30000; -LLONG_MAX + 10000 <= i; i -= 10000) + { + check (i, -LLONG_MAX + 30000, 1, 0) + check (i, -LLONG_MAX + 20000, 1, 1) + check (i, -LLONG_MAX + 10000, 1, 2) + e = 1; + } + #pragma omp for schedule(dynamic,1) nowait + for (j = 20; LLONG_MAX - 70 >= j; j += LLONG_MAX + 50ULL) + { + check (j, 20, 2, 0) + e = 1; + } + #pragma omp for schedule(dynamic,1) nowait + for (j = ULLONG_MAX - 3; LLONG_MAX + 70ULL <= j; j -= LLONG_MAX + 50ULL) + { + check (j, ULLONG_MAX - 3, 3, 0) + e = 1; + } + #pragma omp for schedule(dynamic,1) nowait + for (j = LLONG_MAX - 20000ULL; LLONG_MAX + 10000ULL >= j; j += 10000ULL) + { + check (j, LLONG_MAX - 20000ULL, 4, 0) + check (j, LLONG_MAX - 10000ULL, 4, 1) + check (j, LLONG_MAX, 4, 2) + check (j, LLONG_MAX + 10000ULL, 4, 3) + e = 1; + } + #pragma omp for schedule(dynamic,1) nowait + for (i = -3LL * INT_MAX - 20000LL; INT_MAX + 10000LL >= i; i += INT_MAX + 200LL) + { + check (i, -3LL * INT_MAX - 20000LL, 5, 0) + check (i, -2LL * INT_MAX - 20000LL + 200LL, 5, 1) + check (i, -INT_MAX - 20000LL + 400LL, 5, 2) + check (i, -20000LL + 600LL, 5, 3) + check (i, INT_MAX - 20000LL + 800LL, 5, 4) + e = 1; + } + } + if (e) + abort (); + test (0, 3); + test (1, 3); + test (2, 1); + test (3, 1); + test (4, 4); + test (5, 5); + return 0; +} + +int +test2 () +{ + int e = 0, idx; + +#pragma omp parallel reduction(+:e) + { + long long i; + unsigned long long j; + #pragma omp for schedule(guided,1) nowait + for (i = LLONG_MAX - 30001; LLONG_MAX - 10001 >= i; i += 10000) + { + check (i, LLONG_MAX - 30001, 0, 0) + check (i, LLONG_MAX - 20001, 0, 1) + check (i, LLONG_MAX - 10001, 0, 2) + e = 1; + } + #pragma omp for schedule(guided,1) nowait + for (i = -LLONG_MAX + 30000; -LLONG_MAX + 10000 <= i; i -= 10000) + { + check (i, -LLONG_MAX + 30000, 1, 0) + check (i, -LLONG_MAX + 20000, 1, 1) + check (i, -LLONG_MAX + 10000, 1, 2) + e = 1; + } + #pragma omp for schedule(guided,1) nowait + for (j = 20; LLONG_MAX - 70 >= j; j += LLONG_MAX + 50ULL) + { + check (j, 20, 2, 0) + e = 1; + } + #pragma omp for schedule(guided,1) nowait + for (j = ULLONG_MAX - 3; LLONG_MAX + 70ULL <= j; j -= LLONG_MAX + 50ULL) + { + check (j, ULLONG_MAX - 3, 3, 0) + e = 1; + } + #pragma omp for schedule(guided,1) nowait + for (j = LLONG_MAX - 20000ULL; LLONG_MAX + 10000ULL >= j; j += 10000ULL) + { + check (j, LLONG_MAX - 20000ULL, 4, 0) + check (j, LLONG_MAX - 10000ULL, 4, 1) + check (j, LLONG_MAX, 4, 2) + check (j, LLONG_MAX + 10000ULL, 4, 3) + e = 1; + } + #pragma omp for schedule(guided,1) nowait + for (i = -3LL * INT_MAX - 20000LL; INT_MAX + 10000LL >= i; i += INT_MAX + 200LL) + { + check (i, -3LL * INT_MAX - 20000LL, 5, 0) + check (i, -2LL * INT_MAX - 20000LL + 200LL, 5, 1) + check (i, -INT_MAX - 20000LL + 400LL, 5, 2) + check (i, -20000LL + 600LL, 5, 3) + check (i, INT_MAX - 20000LL + 800LL, 5, 4) + e = 1; + } + } + if (e) + abort (); + test (0, 3); + test (1, 3); + test (2, 1); + test (3, 1); + test (4, 4); + test (5, 5); + return 0; +} + +int +test3 () +{ + int e = 0, idx; + +#pragma omp parallel reduction(+:e) + { + long long i; + unsigned long long j; + #pragma omp for schedule(static) nowait + for (i = LLONG_MAX - 30001; LLONG_MAX - 10001 >= i; i += 10000) + { + check (i, LLONG_MAX - 30001, 0, 0) + check (i, LLONG_MAX - 20001, 0, 1) + check (i, LLONG_MAX - 10001, 0, 2) + e = 1; + } + #pragma omp for schedule(static) nowait + for (i = -LLONG_MAX + 30000; -LLONG_MAX + 10000 <= i; i -= 10000) + { + check (i, -LLONG_MAX + 30000, 1, 0) + check (i, -LLONG_MAX + 20000, 1, 1) + check (i, -LLONG_MAX + 10000, 1, 2) + e = 1; + } + #pragma omp for schedule(static) nowait + for (j = 20; LLONG_MAX - 70 >= j; j += LLONG_MAX + 50ULL) + { + check (j, 20, 2, 0) + e = 1; + } + #pragma omp for schedule(static) nowait + for (j = ULLONG_MAX - 3; LLONG_MAX + 70ULL <= j; j -= LLONG_MAX + 50ULL) + { + check (j, ULLONG_MAX - 3, 3, 0) + e = 1; + } + #pragma omp for schedule(static) nowait + for (j = LLONG_MAX - 20000ULL; LLONG_MAX + 10000ULL >= j; j += 10000ULL) + { + check (j, LLONG_MAX - 20000ULL, 4, 0) + check (j, LLONG_MAX - 10000ULL, 4, 1) + check (j, LLONG_MAX, 4, 2) + check (j, LLONG_MAX + 10000ULL, 4, 3) + e = 1; + } + #pragma omp for schedule(static) nowait + for (i = -3LL * INT_MAX - 20000LL; INT_MAX + 10000LL >= i; i += INT_MAX + 200LL) + { + check (i, -3LL * INT_MAX - 20000LL, 5, 0) + check (i, -2LL * INT_MAX - 20000LL + 200LL, 5, 1) + check (i, -INT_MAX - 20000LL + 400LL, 5, 2) + check (i, -20000LL + 600LL, 5, 3) + check (i, INT_MAX - 20000LL + 800LL, 5, 4) + e = 1; + } + } + if (e) + abort (); + test (0, 3); + test (1, 3); + test (2, 1); + test (3, 1); + test (4, 4); + test (5, 5); + return 0; +} + +int +test4 () +{ + int e = 0, idx; + +#pragma omp parallel reduction(+:e) + { + long long i; + unsigned long long j; + #pragma omp for schedule(static,1) nowait + for (i = LLONG_MAX - 30001; LLONG_MAX - 10001 >= i; i += 10000) + { + check (i, LLONG_MAX - 30001, 0, 0) + check (i, LLONG_MAX - 20001, 0, 1) + check (i, LLONG_MAX - 10001, 0, 2) + e = 1; + } + #pragma omp for schedule(static,1) nowait + for (i = -LLONG_MAX + 30000; -LLONG_MAX + 10000 <= i; i -= 10000) + { + check (i, -LLONG_MAX + 30000, 1, 0) + check (i, -LLONG_MAX + 20000, 1, 1) + check (i, -LLONG_MAX + 10000, 1, 2) + e = 1; + } + #pragma omp for schedule(static,1) nowait + for (j = 20; LLONG_MAX - 70 >= j; j += LLONG_MAX + 50ULL) + { + check (j, 20, 2, 0) + e = 1; + } + #pragma omp for schedule(static,1) nowait + for (j = ULLONG_MAX - 3; LLONG_MAX + 70ULL <= j; j -= LLONG_MAX + 50ULL) + { + check (j, ULLONG_MAX - 3, 3, 0) + e = 1; + } + #pragma omp for schedule(static,1) nowait + for (j = LLONG_MAX - 20000ULL; LLONG_MAX + 10000ULL >= j; j += 10000ULL) + { + check (j, LLONG_MAX - 20000ULL, 4, 0) + check (j, LLONG_MAX - 10000ULL, 4, 1) + check (j, LLONG_MAX, 4, 2) + check (j, LLONG_MAX + 10000ULL, 4, 3) + e = 1; + } + #pragma omp for schedule(static,1) nowait + for (i = -3LL * INT_MAX - 20000LL; INT_MAX + 10000LL >= i; i += INT_MAX + 200LL) + { + check (i, -3LL * INT_MAX - 20000LL, 5, 0) + check (i, -2LL * INT_MAX - 20000LL + 200LL, 5, 1) + check (i, -INT_MAX - 20000LL + 400LL, 5, 2) + check (i, -20000LL + 600LL, 5, 3) + check (i, INT_MAX - 20000LL + 800LL, 5, 4) + e = 1; + } + } + if (e) + abort (); + test (0, 3); + test (1, 3); + test (2, 1); + test (3, 1); + test (4, 4); + test (5, 5); + return 0; +} + +int +test5 () +{ + int e = 0, idx; + +#pragma omp parallel reduction(+:e) + { + long long i; + unsigned long long j; + #pragma omp for schedule(runtime) nowait + for (i = LLONG_MAX - 30001; LLONG_MAX - 10001 >= i; i += 10000) + { + check (i, LLONG_MAX - 30001, 0, 0) + check (i, LLONG_MAX - 20001, 0, 1) + check (i, LLONG_MAX - 10001, 0, 2) + e = 1; + } + #pragma omp for schedule(runtime) nowait + for (i = -LLONG_MAX + 30000; -LLONG_MAX + 10000 <= i; i -= 10000) + { + check (i, -LLONG_MAX + 30000, 1, 0) + check (i, -LLONG_MAX + 20000, 1, 1) + check (i, -LLONG_MAX + 10000, 1, 2) + e = 1; + } + #pragma omp for schedule(runtime) nowait + for (j = 20; LLONG_MAX - 70 >= j; j += LLONG_MAX + 50ULL) + { + check (j, 20, 2, 0) + e = 1; + } + #pragma omp for schedule(runtime) nowait + for (j = ULLONG_MAX - 3; LLONG_MAX + 70ULL <= j; j -= LLONG_MAX + 50ULL) + { + check (j, ULLONG_MAX - 3, 3, 0) + e = 1; + } + #pragma omp for schedule(runtime) nowait + for (j = LLONG_MAX - 20000ULL; LLONG_MAX + 10000ULL >= j; j += 10000ULL) + { + check (j, LLONG_MAX - 20000ULL, 4, 0) + check (j, LLONG_MAX - 10000ULL, 4, 1) + check (j, LLONG_MAX, 4, 2) + check (j, LLONG_MAX + 10000ULL, 4, 3) + e = 1; + } + #pragma omp for schedule(runtime) nowait + for (i = -3LL * INT_MAX - 20000LL; INT_MAX + 10000LL >= i; i += INT_MAX + 200LL) + { + check (i, -3LL * INT_MAX - 20000LL, 5, 0) + check (i, -2LL * INT_MAX - 20000LL + 200LL, 5, 1) + check (i, -INT_MAX - 20000LL + 400LL, 5, 2) + check (i, -20000LL + 600LL, 5, 3) + check (i, INT_MAX - 20000LL + 800LL, 5, 4) + e = 1; + } + } + if (e) + abort (); + test (0, 3); + test (1, 3); + test (2, 1); + test (3, 1); + test (4, 4); + test (5, 5); + return 0; +} + +int +main () +{ + if (2 * sizeof (int) != sizeof (long long)) + return 0; + test1 (); + test2 (); + test3 (); + test4 (); + omp_set_schedule (omp_sched_static, 0); + test5 (); + omp_set_schedule (omp_sched_static, 3); + test5 (); + omp_set_schedule (omp_sched_dynamic, 5); + test5 (); + omp_set_schedule (omp_sched_guided, 2); + test5 (); + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/atomic-5.c b/libgomp/testsuite/libgomp.c/atomic-5.c index 3b4b0f11d64..168f68dd6a7 100644 --- a/libgomp/testsuite/libgomp.c/atomic-5.c +++ b/libgomp/testsuite/libgomp.c/atomic-5.c @@ -3,7 +3,7 @@ /* { dg-options "-O2 -mcx16" { target { { i?86-*-* x86_64-*-* } && lp64 } } } */ #ifdef __x86_64__ -# include "../../../gcc/config/i386/cpuid.h" +# include "cpuid.h" #endif extern void abort (void); @@ -31,10 +31,11 @@ main (void) if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) return 0; - if (ecx & bit_CMPXCHG16B) - do_test (); -#else - do_test (); + if (!(ecx & bit_CMPXCHG16B)) + return 0; #endif + + do_test (); + return 0; } diff --git a/libgomp/testsuite/libgomp.c/atomic-6.c b/libgomp/testsuite/libgomp.c/atomic-6.c index 8e7fca59600..59baf7dd3e2 100644 --- a/libgomp/testsuite/libgomp.c/atomic-6.c +++ b/libgomp/testsuite/libgomp.c/atomic-6.c @@ -4,7 +4,7 @@ /* { dg-options "-O2 -march=i586" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ #ifdef __i386__ -# include "../../../gcc/config/i386/cpuid.h" +# include "cpuid.h" #endif extern void abort (void); @@ -28,10 +28,11 @@ main (void) if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) return 0; - if (edx & bit_CMPXCHG8B) - do_test (); -#else - do_test (); + if (!(edx & bit_CMPXCHG8B)) + return 0; #endif + + do_test (); + return 0; } diff --git a/libgomp/testsuite/libgomp.c/loop-11.c b/libgomp/testsuite/libgomp.c/loop-11.c new file mode 100644 index 00000000000..c5ac3c4348a --- /dev/null +++ b/libgomp/testsuite/libgomp.c/loop-11.c @@ -0,0 +1,276 @@ +#include <omp.h> +#include <stdlib.h> +#include <string.h> + +int +test1 (void) +{ + short int buf[64], *p; + int i; + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for + for (p = &buf[10]; &buf[54] > p; p++) + *p = 5; + for (i = 0; i < 64; i++) + if (buf[i] != 5 * (i >= 10 && i < 54)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for + for (p = &buf[3]; &buf[63] >= p; p += 2) + p[-2] = 6; + for (i = 0; i < 64; i++) + if (buf[i] != 6 * ((i & 1) && i <= 61)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for + for (p = &buf[16]; &buf[51] > p; p = 4 + p) + p[2] = 7; + for (i = 0; i < 64; i++) + if (buf[i] != 7 * ((i & 3) == 2 && i >= 18 && i < 53)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for + for (p = &buf[16]; &buf[40] >= p; p = p + 4ULL) + p[2] = -7; + for (i = 0; i < 64; i++) + if (buf[i] != -7 * ((i & 3) == 2 && i >= 18 && i <= 42)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for + for (p = &buf[53]; &buf[9] < p; --p) + *p = 5; + for (i = 0; i < 64; i++) + if (buf[i] != 5 * (i >= 10 && i < 54)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for + for (p = &buf[63]; &buf[3] <= p; p -= 2) + p[-2] = 6; + for (i = 0; i < 64; i++) + if (buf[i] != 6 * ((i & 1) && i <= 61)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for + for (p = &buf[48]; &buf[15] < p; p = -4 + p) + p[2] = 7; + for (i = 0; i < 64; i++) + if (buf[i] != 7 * ((i & 3) == 2 && i >= 18 && i < 53)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for + for (p = &buf[40]; &buf[16] <= p; p = p - 4ULL) + p[2] = -7; + for (i = 0; i < 64; i++) + if (buf[i] != -7 * ((i & 3) == 2 && i >= 18 && i <= 42)) + abort (); + return 0; +} + +int +test2 (void) +{ + int buf[64], *p; + int i; + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (static, 3) + for (p = &buf[10]; &buf[54] > p; p++) + *p = 5; + for (i = 0; i < 64; i++) + if (buf[i] != 5 * (i >= 10 && i < 54)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (static, 3) + for (p = &buf[3]; &buf[63] >= p; p += 2) + p[-2] = 6; + for (i = 0; i < 64; i++) + if (buf[i] != 6 * ((i & 1) && i <= 61)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (static, 3) + for (p = &buf[16]; &buf[51] > p; p = 4 + p) + p[2] = 7; + for (i = 0; i < 64; i++) + if (buf[i] != 7 * ((i & 3) == 2 && i >= 18 && i < 53)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (static, 3) + for (p = &buf[16]; &buf[40] >= p; p = p + 4ULL) + p[2] = -7; + for (i = 0; i < 64; i++) + if (buf[i] != -7 * ((i & 3) == 2 && i >= 18 && i <= 42)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (static, 3) + for (p = &buf[53]; &buf[9] < p; --p) + *p = 5; + for (i = 0; i < 64; i++) + if (buf[i] != 5 * (i >= 10 && i < 54)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (static, 3) + for (p = &buf[63]; &buf[3] <= p; p -= 2) + p[-2] = 6; + for (i = 0; i < 64; i++) + if (buf[i] != 6 * ((i & 1) && i <= 61)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (static, 3) + for (p = &buf[48]; &buf[15] < p; p = -4 + p) + p[2] = 7; + for (i = 0; i < 64; i++) + if (buf[i] != 7 * ((i & 3) == 2 && i >= 18 && i < 53)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (static, 3) + for (p = &buf[40]; &buf[16] <= p; p = p - 4ULL) + p[2] = -7; + for (i = 0; i < 64; i++) + if (buf[i] != -7 * ((i & 3) == 2 && i >= 18 && i <= 42)) + abort (); + return 0; +} + +int +test3 (void) +{ + int buf[64], *p; + int i; + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (dynamic, 3) + for (p = &buf[10]; &buf[54] > p; p++) + *p = 5; + for (i = 0; i < 64; i++) + if (buf[i] != 5 * (i >= 10 && i < 54)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (dynamic, 3) + for (p = &buf[3]; &buf[63] >= p; p += 2) + p[-2] = 6; + for (i = 0; i < 64; i++) + if (buf[i] != 6 * ((i & 1) && i <= 61)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (dynamic, 3) + for (p = &buf[16]; &buf[51] > p; p = 4 + p) + p[2] = 7; + for (i = 0; i < 64; i++) + if (buf[i] != 7 * ((i & 3) == 2 && i >= 18 && i < 53)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (dynamic, 3) + for (p = &buf[16]; &buf[40] >= p; p = p + 4ULL) + p[2] = -7; + for (i = 0; i < 64; i++) + if (buf[i] != -7 * ((i & 3) == 2 && i >= 18 && i <= 42)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (dynamic, 3) + for (p = &buf[53]; &buf[9] < p; --p) + *p = 5; + for (i = 0; i < 64; i++) + if (buf[i] != 5 * (i >= 10 && i < 54)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (dynamic, 3) + for (p = &buf[63]; &buf[3] <= p; p -= 2) + p[-2] = 6; + for (i = 0; i < 64; i++) + if (buf[i] != 6 * ((i & 1) && i <= 61)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (dynamic, 3) + for (p = &buf[48]; &buf[15] < p; p = -4 + p) + p[2] = 7; + for (i = 0; i < 64; i++) + if (buf[i] != 7 * ((i & 3) == 2 && i >= 18 && i < 53)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (dynamic, 3) + for (p = &buf[40]; &buf[16] <= p; p = p - 4ULL) + p[2] = -7; + for (i = 0; i < 64; i++) + if (buf[i] != -7 * ((i & 3) == 2 && i >= 18 && i <= 42)) + abort (); + return 0; +} + +int +test4 (void) +{ + int buf[64], *p; + int i; + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (runtime) + for (p = &buf[10]; &buf[54] > p; p++) + *p = 5; + for (i = 0; i < 64; i++) + if (buf[i] != 5 * (i >= 10 && i < 54)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (runtime) + for (p = &buf[3]; &buf[63] >= p; p += 2) + p[-2] = 6; + for (i = 0; i < 64; i++) + if (buf[i] != 6 * ((i & 1) && i <= 61)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (runtime) + for (p = &buf[16]; &buf[51] > p; p = 4 + p) + p[2] = 7; + for (i = 0; i < 64; i++) + if (buf[i] != 7 * ((i & 3) == 2 && i >= 18 && i < 53)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (runtime) + for (p = &buf[16]; &buf[40] >= p; p = p + 4ULL) + p[2] = -7; + for (i = 0; i < 64; i++) + if (buf[i] != -7 * ((i & 3) == 2 && i >= 18 && i <= 42)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (runtime) + for (p = &buf[53]; &buf[9] < p; --p) + *p = 5; + for (i = 0; i < 64; i++) + if (buf[i] != 5 * (i >= 10 && i < 54)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (runtime) + for (p = &buf[63]; &buf[3] <= p; p -= 2) + p[-2] = 6; + for (i = 0; i < 64; i++) + if (buf[i] != 6 * ((i & 1) && i <= 61)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (runtime) + for (p = &buf[48]; &buf[15] < p; p = -4 + p) + p[2] = 7; + for (i = 0; i < 64; i++) + if (buf[i] != 7 * ((i & 3) == 2 && i >= 18 && i < 53)) + abort (); + memset (buf, '\0', sizeof (buf)); +#pragma omp parallel for schedule (runtime) + for (p = &buf[40]; &buf[16] <= p; p = p - 4ULL) + p[2] = -7; + for (i = 0; i < 64; i++) + if (buf[i] != -7 * ((i & 3) == 2 && i >= 18 && i <= 42)) + abort (); + return 0; +} + +int +main (void) +{ + test1 (); + test2 (); + test3 (); + omp_set_schedule (omp_sched_static, 0); + test4 (); + omp_set_schedule (omp_sched_static, 3); + test4 (); + omp_set_schedule (omp_sched_dynamic, 5); + test4 (); + omp_set_schedule (omp_sched_guided, 2); + test4 (); + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/loop-12.c b/libgomp/testsuite/libgomp.c/loop-12.c new file mode 100644 index 00000000000..395da363e48 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/loop-12.c @@ -0,0 +1,387 @@ +/* { dg-do run } */ + +#include <omp.h> + +extern void abort (void); + +#define LLONG_MAX __LONG_LONG_MAX__ +#define ULLONG_MAX (LLONG_MAX * 2ULL + 1) +#define INT_MAX __INT_MAX__ + +int arr[6 * 5]; + +void +set (int loopidx, int idx) +{ +#pragma omp atomic + arr[loopidx * 5 + idx]++; +} + +#define check(var, val, loopidx, idx) \ + if (var == (val)) set (loopidx, idx); else +#define test(loopidx, count) \ + for (idx = 0; idx < 5; idx++) \ + if (arr[loopidx * 5 + idx] != idx < count) \ + abort (); \ + else \ + arr[loopidx * 5 + idx] = 0 + +int +test1 (void) +{ + int e = 0, idx; + +#pragma omp parallel reduction(+:e) + { + long long i; + unsigned long long j; + #pragma omp for schedule(dynamic,1) nowait + for (i = LLONG_MAX - 30001; LLONG_MAX - 10001 >= i; i += 10000) + { + check (i, LLONG_MAX - 30001, 0, 0) + check (i, LLONG_MAX - 20001, 0, 1) + check (i, LLONG_MAX - 10001, 0, 2) + e = 1; + } + #pragma omp for schedule(dynamic,1) nowait + for (i = -LLONG_MAX + 30000; -LLONG_MAX + 10000 <= i; i -= 10000) + { + check (i, -LLONG_MAX + 30000, 1, 0) + check (i, -LLONG_MAX + 20000, 1, 1) + check (i, -LLONG_MAX + 10000, 1, 2) + e = 1; + } + #pragma omp for schedule(dynamic,1) nowait + for (j = 20; LLONG_MAX - 70 >= j; j += LLONG_MAX + 50ULL) + { + check (j, 20, 2, 0) + e = 1; + } + #pragma omp for schedule(dynamic,1) nowait + for (j = ULLONG_MAX - 3; LLONG_MAX + 70ULL <= j; j -= LLONG_MAX + 50ULL) + { + check (j, ULLONG_MAX - 3, 3, 0) + e = 1; + } + #pragma omp for schedule(dynamic,1) nowait + for (j = LLONG_MAX - 20000ULL; LLONG_MAX + 10000ULL >= j; j += 10000ULL) + { + check (j, LLONG_MAX - 20000ULL, 4, 0) + check (j, LLONG_MAX - 10000ULL, 4, 1) + check (j, LLONG_MAX, 4, 2) + check (j, LLONG_MAX + 10000ULL, 4, 3) + e = 1; + } + #pragma omp for schedule(dynamic,1) nowait + for (i = -3LL * INT_MAX - 20000LL; INT_MAX + 10000LL >= i; i += INT_MAX + 200LL) + { + check (i, -3LL * INT_MAX - 20000LL, 5, 0) + check (i, -2LL * INT_MAX - 20000LL + 200LL, 5, 1) + check (i, -INT_MAX - 20000LL + 400LL, 5, 2) + check (i, -20000LL + 600LL, 5, 3) + check (i, INT_MAX - 20000LL + 800LL, 5, 4) + e = 1; + } + } + if (e) + abort (); + test (0, 3); + test (1, 3); + test (2, 1); + test (3, 1); + test (4, 4); + test (5, 5); + return 0; +} + +int +test2 (void) +{ + int e = 0, idx; + +#pragma omp parallel reduction(+:e) + { + long long i; + unsigned long long j; + #pragma omp for schedule(guided,1) nowait + for (i = LLONG_MAX - 30001; LLONG_MAX - 10001 >= i; i += 10000) + { + check (i, LLONG_MAX - 30001, 0, 0) + check (i, LLONG_MAX - 20001, 0, 1) + check (i, LLONG_MAX - 10001, 0, 2) + e = 1; + } + #pragma omp for schedule(guided,1) nowait + for (i = -LLONG_MAX + 30000; -LLONG_MAX + 10000 <= i; i -= 10000) + { + check (i, -LLONG_MAX + 30000, 1, 0) + check (i, -LLONG_MAX + 20000, 1, 1) + check (i, -LLONG_MAX + 10000, 1, 2) + e = 1; + } + #pragma omp for schedule(guided,1) nowait + for (j = 20; LLONG_MAX - 70 >= j; j += LLONG_MAX + 50ULL) + { + check (j, 20, 2, 0) + e = 1; + } + #pragma omp for schedule(guided,1) nowait + for (j = ULLONG_MAX - 3; LLONG_MAX + 70ULL <= j; j -= LLONG_MAX + 50ULL) + { + check (j, ULLONG_MAX - 3, 3, 0) + e = 1; + } + #pragma omp for schedule(guided,1) nowait + for (j = LLONG_MAX - 20000ULL; LLONG_MAX + 10000ULL >= j; j += 10000ULL) + { + check (j, LLONG_MAX - 20000ULL, 4, 0) + check (j, LLONG_MAX - 10000ULL, 4, 1) + check (j, LLONG_MAX, 4, 2) + check (j, LLONG_MAX + 10000ULL, 4, 3) + e = 1; + } + #pragma omp for schedule(guided,1) nowait + for (i = -3LL * INT_MAX - 20000LL; INT_MAX + 10000LL >= i; i += INT_MAX + 200LL) + { + check (i, -3LL * INT_MAX - 20000LL, 5, 0) + check (i, -2LL * INT_MAX - 20000LL + 200LL, 5, 1) + check (i, -INT_MAX - 20000LL + 400LL, 5, 2) + check (i, -20000LL + 600LL, 5, 3) + check (i, INT_MAX - 20000LL + 800LL, 5, 4) + e = 1; + } + } + if (e) + abort (); + test (0, 3); + test (1, 3); + test (2, 1); + test (3, 1); + test (4, 4); + test (5, 5); + return 0; +} + +int +test3 (void) +{ + int e = 0, idx; + +#pragma omp parallel reduction(+:e) + { + long long i; + unsigned long long j; + #pragma omp for schedule(static) nowait + for (i = LLONG_MAX - 30001; LLONG_MAX - 10001 >= i; i += 10000) + { + check (i, LLONG_MAX - 30001, 0, 0) + check (i, LLONG_MAX - 20001, 0, 1) + check (i, LLONG_MAX - 10001, 0, 2) + e = 1; + } + #pragma omp for schedule(static) nowait + for (i = -LLONG_MAX + 30000; -LLONG_MAX + 10000 <= i; i -= 10000) + { + check (i, -LLONG_MAX + 30000, 1, 0) + check (i, -LLONG_MAX + 20000, 1, 1) + check (i, -LLONG_MAX + 10000, 1, 2) + e = 1; + } + #pragma omp for schedule(static) nowait + for (j = 20; LLONG_MAX - 70 >= j; j += LLONG_MAX + 50ULL) + { + check (j, 20, 2, 0) + e = 1; + } + #pragma omp for schedule(static) nowait + for (j = ULLONG_MAX - 3; LLONG_MAX + 70ULL <= j; j -= LLONG_MAX + 50ULL) + { + check (j, ULLONG_MAX - 3, 3, 0) + e = 1; + } + #pragma omp for schedule(static) nowait + for (j = LLONG_MAX - 20000ULL; LLONG_MAX + 10000ULL >= j; j += 10000ULL) + { + check (j, LLONG_MAX - 20000ULL, 4, 0) + check (j, LLONG_MAX - 10000ULL, 4, 1) + check (j, LLONG_MAX, 4, 2) + check (j, LLONG_MAX + 10000ULL, 4, 3) + e = 1; + } + #pragma omp for schedule(static) nowait + for (i = -3LL * INT_MAX - 20000LL; INT_MAX + 10000LL >= i; i += INT_MAX + 200LL) + { + check (i, -3LL * INT_MAX - 20000LL, 5, 0) + check (i, -2LL * INT_MAX - 20000LL + 200LL, 5, 1) + check (i, -INT_MAX - 20000LL + 400LL, 5, 2) + check (i, -20000LL + 600LL, 5, 3) + check (i, INT_MAX - 20000LL + 800LL, 5, 4) + e = 1; + } + } + if (e) + abort (); + test (0, 3); + test (1, 3); + test (2, 1); + test (3, 1); + test (4, 4); + test (5, 5); + return 0; +} + +int +test4 (void) +{ + int e = 0, idx; + +#pragma omp parallel reduction(+:e) + { + long long i; + unsigned long long j; + #pragma omp for schedule(static,1) nowait + for (i = LLONG_MAX - 30001; LLONG_MAX - 10001 >= i; i += 10000) + { + check (i, LLONG_MAX - 30001, 0, 0) + check (i, LLONG_MAX - 20001, 0, 1) + check (i, LLONG_MAX - 10001, 0, 2) + e = 1; + } + #pragma omp for schedule(static,1) nowait + for (i = -LLONG_MAX + 30000; -LLONG_MAX + 10000 <= i; i -= 10000) + { + check (i, -LLONG_MAX + 30000, 1, 0) + check (i, -LLONG_MAX + 20000, 1, 1) + check (i, -LLONG_MAX + 10000, 1, 2) + e = 1; + } + #pragma omp for schedule(static,1) nowait + for (j = 20; LLONG_MAX - 70 >= j; j += LLONG_MAX + 50ULL) + { + check (j, 20, 2, 0) + e = 1; + } + #pragma omp for schedule(static,1) nowait + for (j = ULLONG_MAX - 3; LLONG_MAX + 70ULL <= j; j -= LLONG_MAX + 50ULL) + { + check (j, ULLONG_MAX - 3, 3, 0) + e = 1; + } + #pragma omp for schedule(static,1) nowait + for (j = LLONG_MAX - 20000ULL; LLONG_MAX + 10000ULL >= j; j += 10000ULL) + { + check (j, LLONG_MAX - 20000ULL, 4, 0) + check (j, LLONG_MAX - 10000ULL, 4, 1) + check (j, LLONG_MAX, 4, 2) + check (j, LLONG_MAX + 10000ULL, 4, 3) + e = 1; + } + #pragma omp for schedule(static,1) nowait + for (i = -3LL * INT_MAX - 20000LL; INT_MAX + 10000LL >= i; i += INT_MAX + 200LL) + { + check (i, -3LL * INT_MAX - 20000LL, 5, 0) + check (i, -2LL * INT_MAX - 20000LL + 200LL, 5, 1) + check (i, -INT_MAX - 20000LL + 400LL, 5, 2) + check (i, -20000LL + 600LL, 5, 3) + check (i, INT_MAX - 20000LL + 800LL, 5, 4) + e = 1; + } + } + if (e) + abort (); + test (0, 3); + test (1, 3); + test (2, 1); + test (3, 1); + test (4, 4); + test (5, 5); + return 0; +} + +int +test5 (void) +{ + int e = 0, idx; + +#pragma omp parallel reduction(+:e) + { + long long i; + unsigned long long j; + #pragma omp for schedule(runtime) nowait + for (i = LLONG_MAX - 30001; LLONG_MAX - 10001 >= i; i += 10000) + { + check (i, LLONG_MAX - 30001, 0, 0) + check (i, LLONG_MAX - 20001, 0, 1) + check (i, LLONG_MAX - 10001, 0, 2) + e = 1; + } + #pragma omp for schedule(runtime) nowait + for (i = -LLONG_MAX + 30000; -LLONG_MAX + 10000 <= i; i -= 10000) + { + check (i, -LLONG_MAX + 30000, 1, 0) + check (i, -LLONG_MAX + 20000, 1, 1) + check (i, -LLONG_MAX + 10000, 1, 2) + e = 1; + } + #pragma omp for schedule(runtime) nowait + for (j = 20; LLONG_MAX - 70 >= j; j += LLONG_MAX + 50ULL) + { + check (j, 20, 2, 0) + e = 1; + } + #pragma omp for schedule(runtime) nowait + for (j = ULLONG_MAX - 3; LLONG_MAX + 70ULL <= j; j -= LLONG_MAX + 50ULL) + { + check (j, ULLONG_MAX - 3, 3, 0) + e = 1; + } + #pragma omp for schedule(runtime) nowait + for (j = LLONG_MAX - 20000ULL; LLONG_MAX + 10000ULL >= j; j += 10000ULL) + { + check (j, LLONG_MAX - 20000ULL, 4, 0) + check (j, LLONG_MAX - 10000ULL, 4, 1) + check (j, LLONG_MAX, 4, 2) + check (j, LLONG_MAX + 10000ULL, 4, 3) + e = 1; + } + #pragma omp for schedule(runtime) nowait + for (i = -3LL * INT_MAX - 20000LL; INT_MAX + 10000LL >= i; i += INT_MAX + 200LL) + { + check (i, -3LL * INT_MAX - 20000LL, 5, 0) + check (i, -2LL * INT_MAX - 20000LL + 200LL, 5, 1) + check (i, -INT_MAX - 20000LL + 400LL, 5, 2) + check (i, -20000LL + 600LL, 5, 3) + check (i, INT_MAX - 20000LL + 800LL, 5, 4) + e = 1; + } + } + if (e) + abort (); + test (0, 3); + test (1, 3); + test (2, 1); + test (3, 1); + test (4, 4); + test (5, 5); + return 0; +} + +int +main (void) +{ + if (2 * sizeof (int) != sizeof (long long)) + return 0; + test1 (); + test2 (); + test3 (); + test4 (); + omp_set_schedule (omp_sched_static, 0); + test5 (); + omp_set_schedule (omp_sched_static, 3); + test5 (); + omp_set_schedule (omp_sched_dynamic, 5); + test5 (); + omp_set_schedule (omp_sched_guided, 2); + test5 (); + return 0; +} diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 00aa57a84e4..a15a86005ff 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,11 @@ +2009-03-23 Jason Merrill <jason@redhat.com> + + * cp-demangle.c (d_expression): Handle pack expansion. + (d_find_pack): Handle DEMANGLE_COMPONENT_FUNCTION_PARAM. + (d_print_subexpr): Don't wrap function parms in (). + (d_print_comp) [DEMANGLE_COMPONENT_PACK_EXPANSION]: Handle + not finding a pack. + 2009-03-17 Jason Merrill <jason@redhat.com> * cp-demangle.c (d_make_function_param): new fn. diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index e6d3d5ea902..b02f9bbf97e 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -2586,6 +2586,12 @@ d_expression (struct d_info *di) d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE, name, d_template_args (di))); } + else if (peek == 's' && d_peek_next_char (di) == 'p') + { + d_advance (di, 2); + return d_make_comp (di, DEMANGLE_COMPONENT_PACK_EXPANSION, + d_expression (di), NULL); + } else if (peek == 'f' && d_peek_next_char (di) == 'p') { /* Function parameter used in a late-specified return type. */ @@ -3244,6 +3250,7 @@ d_find_pack (struct d_print_info *dpi, case DEMANGLE_COMPONENT_BUILTIN_TYPE: case DEMANGLE_COMPONENT_SUB_STD: case DEMANGLE_COMPONENT_CHARACTER: + case DEMANGLE_COMPONENT_FUNCTION_PARAM: return NULL; case DEMANGLE_COMPONENT_EXTENDED_OPERATOR: @@ -3284,7 +3291,8 @@ d_print_subexpr (struct d_print_info *dpi, const struct demangle_component *dc) { int simple = 0; - if (dc->type == DEMANGLE_COMPONENT_NAME) + if (dc->type == DEMANGLE_COMPONENT_NAME + || dc->type == DEMANGLE_COMPONENT_FUNCTION_PARAM) simple = 1; if (!simple) d_append_char (dpi, '('); @@ -4012,10 +4020,20 @@ d_print_comp (struct d_print_info *dpi, case DEMANGLE_COMPONENT_PACK_EXPANSION: { - struct demangle_component *a = d_find_pack (dpi, d_left (dc)); - int len = d_pack_length (a); + int len; int i; + struct demangle_component *a = d_find_pack (dpi, d_left (dc)); + if (a == NULL) + { + /* d_find_pack won't find anything if the only packs involved + in this expansion are function parameter packs; in that + case, just print the pattern and "...". */ + d_print_subexpr (dpi, d_left (dc)); + d_append_string (dpi, "..."); + return; + } + len = d_pack_length (a); dc = d_left (dc); for (i = 0; i < len; ++i) { diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index cded6b5d71a..0c451184fc4 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -3885,7 +3885,7 @@ java resource java/util/iso4217.properties # decltype/param placeholder test --format=gnu-v3 _Z3addIidEDTplfp_fp0_ET_T0_ -decltype ((parm#1)+(parm#2)) add<int, double>(int, double) +decltype (parm#1+parm#2) add<int, double>(int, double) # decltype/fn call test --format=gnu-v3 _Z4add3IidEDTclL_Z1gEfp_fp0_EET_T0_ @@ -3901,8 +3901,12 @@ void f<int*, float*, double*>(int*, float*, double*) # '.' test --format=gnu-v3 _Z1hI1AIiEdEDTcldtfp_1gIT0_EEET_S2_ -decltype (((parm#1).(g<double>))()) h<A<int>, double>(A<int>, double) +decltype ((parm#1.(g<double>))()) h<A<int>, double>(A<int>, double) # test for typed function in decltype --format=gnu-v3 _ZN1AIiE1jIiEEDTplfp_clL_Z1xvEEET_ -decltype ((parm#1)+((x())())) A<int>::j<int>(int) +decltype (parm#1+((x())())) A<int>::j<int>(int) +# test for expansion of function parameter pack +--format=gnu-v3 +_Z1gIIidEEDTclL_Z1fEspplfp_Li1EEEDpT_ +decltype (f((parm#1+(1))...)) g<int, double>(int, double) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 5166ceb8229..eebffbded2b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,29 @@ 2009-03-22 Mark Mitchell <mark@codesourcery.com> + * testsuite/21_strings/basic_string/inserters_extractors/wchar_t/28277.cc: + Likewise. + * testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-3.cc: + Likewise. + * testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-4.cc: + Likewise. + * testsuite/ext/vstring/inserters_extractors/wchar_t/28277.cc: + Likewise. + +2009-03-22 Mark Mitchell <mark@codesourcery.com> + + * testsuite/25_algorithms/search_n/iterator.cc: Update copyright + year(s). + * testsuite/25_algorithms/heap/moveable.cc: Likewise. + * testsuite/21_strings/basic_string/inserters_extractors/char/28277.cc + Likewise. + * testsuite/27_io/basic_ostream/inserters_character/char/28277-3.cc: + Likewise. + * testsuite/27_io/basic_ostream/inserters_character/char/28277-4.cc: + Likewise. + * testsuite/ext/vstring/inserters_extractors/char/28277.cc: Likewise. + +2009-03-22 Mark Mitchell <mark@codesourcery.com> + * testsuite/25_algorithms/search_n/iterator.cc: Condition iterations for simulators. * testsuite/25_algorithms/heap/moveable.cc: Likewise. diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/28277.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/28277.cc index b584fd2af62..c6def9b42d7 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/28277.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/28277.cc @@ -1,6 +1,6 @@ // 2006-10-12 Paolo Carlini <pcarlini@suse.de> -// Copyright (C) 2006, 2007 Free Software Foundation +// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/28277.cc b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/28277.cc index 653f4de36db..35cae2e27d2 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/28277.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/28277.cc @@ -1,6 +1,6 @@ // 2006-10-12 Paolo Carlini <pcarlini@suse.de> -// Copyright (C) 2006, 2007 Free Software Foundation +// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -18,12 +18,18 @@ // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. +// { dg-options "-DWIDTH=500000" { target simulator } } + // 21.3.7.9 inserters and extractors #include <ostream> #include <sstream> #include <testsuite_hooks.h> +#ifndef WIDTH +#define WIDTH 50000000 +#endif + // libstdc++/28277 void test01() { @@ -33,7 +39,7 @@ void test01() wostringstream oss_01; const wstring str_01(50, L'a'); - oss_01.width(5000000); + oss_01.width(WIDTH); const streamsize width = oss_01.width(); oss_01 << str_01; diff --git a/libstdc++-v3/testsuite/25_algorithms/heap/moveable.cc b/libstdc++-v3/testsuite/25_algorithms/heap/moveable.cc index 55bb1b55ba4..b2c3cb566b6 100644 --- a/libstdc++-v3/testsuite/25_algorithms/heap/moveable.cc +++ b/libstdc++-v3/testsuite/25_algorithms/heap/moveable.cc @@ -1,6 +1,6 @@ // { dg-options "-std=gnu++0x" } -// Copyright (C) 2005, 2007 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the diff --git a/libstdc++-v3/testsuite/25_algorithms/search_n/iterator.cc b/libstdc++-v3/testsuite/25_algorithms/search_n/iterator.cc index 1cc8e875a04..f03daacd494 100644 --- a/libstdc++-v3/testsuite/25_algorithms/search_n/iterator.cc +++ b/libstdc++-v3/testsuite/25_algorithms/search_n/iterator.cc @@ -1,4 +1,5 @@ -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-3.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-3.cc index 19ec9286309..caa851cf9d2 100644 --- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-3.cc +++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-3.cc @@ -1,6 +1,6 @@ // 2006-10-12 Paolo Carlini <pcarlini@suse.de> -// Copyright (C) 2006, 2006 Free Software Foundation +// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-4.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-4.cc index 1b15d83ae2b..381ac6930bd 100644 --- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-4.cc +++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-4.cc @@ -1,6 +1,6 @@ // 2006-10-12 Paolo Carlini <pcarlini@suse.de> -// Copyright (C) 2006, 2007 Free Software Foundation +// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-3.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-3.cc index dc5ffe5dff2..54cdf33f96a 100644 --- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-3.cc +++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-3.cc @@ -18,12 +18,18 @@ // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. +// { dg-options "-DWIDTH=500000" { target simulator } } + // 27.6.2.5.4 basic_ostream character inserters #include <ostream> #include <sstream> #include <testsuite_hooks.h> +#ifndef WIDTH +#define WIDTH 50000000 +#endif + // libstdc++/28277 void test01() { @@ -32,7 +38,7 @@ void test01() wostringstream oss_01; - oss_01.width(5000000); + oss_01.width(WIDTH); const streamsize width = oss_01.width(); oss_01 << L'a'; diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-4.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-4.cc index e80242cf0a7..aff7d9c0b97 100644 --- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-4.cc +++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/28277-4.cc @@ -1,6 +1,6 @@ // 2006-10-12 Paolo Carlini <pcarlini@suse.de> -// Copyright (C) 2006, 2007 Free Software Foundation +// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -18,12 +18,18 @@ // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. +// { dg-options "-DWIDTH=500000" { target simulator } } + // 27.6.2.5.4 basic_ostream character inserters #include <ostream> #include <sstream> #include <testsuite_hooks.h> +#ifndef WIDTH +#define WIDTH 50000000 +#endif + // libstdc++/28277 void test01() { @@ -33,7 +39,7 @@ void test01() wostringstream oss_01; const wstring str_01(50, L'a'); - oss_01.width(5000000); + oss_01.width(WIDTH); const streamsize width = oss_01.width(); oss_01 << str_01.c_str(); diff --git a/libstdc++-v3/testsuite/ext/vstring/inserters_extractors/char/28277.cc b/libstdc++-v3/testsuite/ext/vstring/inserters_extractors/char/28277.cc index e666699567b..5b096b753c4 100644 --- a/libstdc++-v3/testsuite/ext/vstring/inserters_extractors/char/28277.cc +++ b/libstdc++-v3/testsuite/ext/vstring/inserters_extractors/char/28277.cc @@ -1,6 +1,6 @@ // 2007-04-09 Paolo Carlini <pcarlini@suse.de> -// Copyright (C) 2007 Free Software Foundation +// Copyright (C) 2007, 2008, 2009 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the diff --git a/libstdc++-v3/testsuite/ext/vstring/inserters_extractors/wchar_t/28277.cc b/libstdc++-v3/testsuite/ext/vstring/inserters_extractors/wchar_t/28277.cc index 205a99525f6..6358de586b6 100644 --- a/libstdc++-v3/testsuite/ext/vstring/inserters_extractors/wchar_t/28277.cc +++ b/libstdc++-v3/testsuite/ext/vstring/inserters_extractors/wchar_t/28277.cc @@ -1,6 +1,6 @@ // 2007-04-09 Paolo Carlini <pcarlini@suse.de> -// Copyright (C) 2007 Free Software Foundation +// Copyright (C) 2007, 2008, 2009 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -18,11 +18,17 @@ // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. +// { dg-options "-DWIDTH=500000" { target simulator } } + #include <ostream> #include <sstream> #include <ext/vstring.h> #include <testsuite_hooks.h> +#ifndef WIDTH +#define WIDTH 50000000 +#endif + // libstdc++/28277 void test01() { @@ -32,7 +38,7 @@ void test01() wostringstream oss_01; const __gnu_cxx::__wvstring str_01(50, L'a'); - oss_01.width(5000000); + oss_01.width(WIDTH); const streamsize width = oss_01.width(); oss_01 << str_01; |