1. 27 Aug, 2012 9 commits
    • PR preprocessor/53469 - argument tokens of _Pragma miss virtual location · f3d25c65
      Consider this short test snippet:
      
      -------------------------8-------------------
          #define STRINGIFY(x) #x
          #define TEST(x) \
            _Pragma(STRINGIFY(GCC diagnostic ignored "-Wunused-local-typedefs")) \
            typedef int myint;
      
          void bar ()
          {
            TEST(myint)
          }
      -------------------------8-------------------
      
      The _Pragma is effectively ignored, and compiling with
      -Wunused-local-typedefs warns on the local typedef, even though the
      pragma should have prevented the warning to be emitted.
      
      This is because when the preprocessor sees the _Pragma operator and
      then goes to handle the first token ('GCC' here) that makes up its
      operands, it retains the spelling location of that token, not its
      virtual location.
      
      Later when diagnostic_report_diagnostic is called to emit the warning
      (or ignore it because of the pragma), it compares the location of the
      first operand of the pragma with the location of the unused location,
      (by calling linemap_location_before_p) and that comparison fails
      because in this case, both locations should be virtual.
      
      This patch fixes the issue by teaching the pragma handling to use
      virtual locations.
      
      Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk.
      
      libcpp/
      
      	PR preprocessor/53469
      	* directives.c (do_pragma): Use the virtual location for the
      	pragma token, instead of its spelling location.
      
      gcc/testsuite/
      
      	PR preprocessor/53469
      	* gcc.dg/cpp/_Pragma7.c: New test case.
      
      From-SVN: r190714
      Dodji Seketeli committed
    • re PR fortran/54384 (gfortran memory leaks) · c0782a40
      2012-08-27  Tobias Burnus  <burnus@net-b.de>
      
              PR fortran/54384
              * trans-expr.c (gfc_trans_arrayfunc_assign): Free se.ss
              and loop.
      
      From-SVN: r190713
      Tobias Burnus committed
    • Add interfaces to retrieve random numbers in bulk. · 7b93bdde
      	* include/bits/random.h (uniform_int_distribution<>): Add __generate
      	and __generate_impl functions.
      	(uniform_real_distribution<>): Likewise.
      	(bernoulli_distribution): Likewise.
      	(geometric_distribution<>): Likewise.
      	(negative_binomial_distribution<>): Likewise.
      	(poisson_distribution<>): Likewise.
      	(exponential_distribution<>): Likewise.
      	(normal_distribution<>): Likewise.
      	(lognormal_distribution<>): Likewise.
      	(chi_squared_distribution<>): Likewise.
      	(cauchy_distribution<>): Likewise.
      	(fisher_f_distribution<>): Likewise.
      	(student_t_distribution<>): Likewise.
      	(gamma_distribution<>): Likewise.
      	(weibull_distribution<>): Likewise.
      	(extreme_value_distribution<>): Likewise.
      	(discrete_distribution<>): Likewise.
      	(piecewise_constant_distribution<>): Likewise.
      	(piecewise_linear_distribution<>): Likewise.
      	* include/bits/random.tcc (__detail::_Power_of_2): New function.
      	(uniform_int_distribution<>::__generate_impl): New function.
      	(uniform_real_distribution<>::__generate_impl): New function.
      	(bernoulli_distribution::__generate_impl): New function.
      	(geometric_distribution<>::__generate_impl): New function.
      	(negative_binomial_distribution<>::__generate_impl): New function.
      	(poisson_distribution<>::__generate_impl): New function.
      	(exponential_distribution<>::__generate_impl): New function.
      	(normal_distribution<>::__generate_impl): New function.
      	(lognormal_distribution<>::__generate_impl): New function.
      	(chi_squared_distribution<>::__generate_impl): New function.
      	(cauchy_distribution<>::__generate_impl): New function.
      	(fisher_f_distribution<>::__generate_impl): New function.
      	(student_t_distribution<>::__generate_impl): New function.
      	(gamma_distribution<>::__generate_impl): New function.
      	(weibull_distribution<>::__generate_impl): New function.
      	(extreme_value_distribution<>::__generate_impl): New function.
      	(discrete_distribution<>::__generate_impl): New function.
      	(piecewise_constant_distribution<>::__generate_impl): New function.
      	(piecewise_linear_distribution<>::__generate_impl): New function.
      
      From-SVN: r190712
      Ulrich Drepper committed
    • random.h (mersenne_twister_engine): Don't inline discard here. · b668e41a
      
      	* include/bits/random.h (mersenne_twister_engine): Don't inline
      	discard here.  New member function _M_gen_rand.
      	* include/bits/random.tcc (mersenne_twister_engine<>::_M_gen_rand):
      	New function.  Extracted from operator().
      	(mersenne_twister_engine<>::discard): New implementation which
      	skips in large steps.
      	(mersenne_twister_engine<>::operator()): Use _M_gen_rand.
      
      From-SVN: r190711
      Ulrich Drepper committed
    • re PR fortran/41093 (memory leaks with gfc_namespace) · 6f79f4d1
      2012-08-27  Tobias Burnus  <burnus@net-b.de>
      
              PR fortran/41093
              * gfortran.h (gfc_common_head): Add "int refs".
              * match.c (gfc_match_common): Increment refs.
              * resolve.c (resolve_symbol): Only increment formal_ns->refs
              if formal_ns is not sym->ns.
              * symbol.c (gfc_free_symbol): Only free formal_ns if
              if formal_ns is not sym->ns. Free common_block if refs is one.
              (gfc_release_symbol): Release formal_ns only if the
              symbol is not ENTRY of a module.
              * decl.c (get_proc_name): Don't increment gfc_current_ns->refs.
              * parse.c (parse_interface): Incement proc_unit->refs++ for
              proc-pointer result variables.
              * module.c (mio_symbol): Don't increase sym->refs for its
              use in sym->formal_ns->proc_name.
      
      From-SVN: r190710
      Tobias Burnus committed
    • re PR fortran/54370 (error: non-trivial conversion in unary operation) · 1d636855
      2012-08-27  Tobias Burnus  <burnus@net-b.de>
      
              PR fortran/54370
              * trans-stmt.c (gfc_trans_do_while): Don't change the logical
              kind for negation of the condition.
      
      2012-08-27  Tobias Burnus  <burnus@net-b.de>
      
              PR fortran/54370
              * gfortran.dg/do_5.f90: New.
      
      From-SVN: r190709
      Tobias Burnus committed
    • MAINTAINERS: Fix my email address. · 6c513d43
      
              * MAINTAINERS: Fix my email address.
      
      From-SVN: r190708
      Ulrich Drepper committed
    • options.c (set_Wall): Don't set for -Wcompare-reals. · e9b49000
      2012-08-27  Tobias Burnus  <burnus@net-b.de>
      
              * options.c (set_Wall): Don't set for -Wcompare-reals.
              * invoke.texi (-Wall, -Wcompare-reals): -Wall no longer
              implies -Wcompare-reals.
      
      2012-08-27  Tobias Burnus  <burnus@net-b.de>
      
              * gfortran.dg/bessel_5.f90: Remove -Wno-compare-reals
              from dg-options as -Wall no longer implies it.
      
      From-SVN: r190707
      Tobias Burnus committed
    • Daily bump. · 12a3e30e
      From-SVN: r190706
      GCC Administrator committed
  2. 26 Aug, 2012 23 commits
  3. 25 Aug, 2012 8 commits