Fix ICE while updating inliner summary

2020-01-01 Thread Jan Hubicka
Hi,
this patch fix ICE seen when LTO optimizing clang.

Bootstrapped/regtested x86_64-linux.

* ipa.c (walk_polymorphic_call_targets): Fix updating of overall
summary.
Index: ipa.c
===
--- ipa.c   (revision 279724)
+++ ipa.c   (working copy)
@@ -244,7 +244,8 @@ walk_polymorphic_call_targets (hash_set<
}
  edge = edge->make_direct (target);
  if (ipa_fn_summaries)
-   ipa_update_overall_fn_summary (node);
+   ipa_update_overall_fn_summary (node->inlined_to
+  ? node->inlined_to : node);
  else if (edge->call_stmt)
edge->redirect_call_stmt_to_callee ();
}


[committed] Update copyright years

2020-01-01 Thread Jakub Jelinek
Hi!

Happy New Year to everyone!

2020-01-01  Jakub Jelinek  

* gcc.c (process_command): Update copyright notice dates.
* gcov-dump.c (print_version): Ditto.
* gcov.c (print_version): Ditto.
* gcov-tool.c (print_version): Ditto.
* gengtype.c (create_file): Ditto.
* doc/cpp.texi: Bump @copying's copyright year.
* doc/cppinternals.texi: Ditto.
* doc/gcc.texi: Ditto.
* doc/gccint.texi: Ditto.
* doc/gcov.texi: Ditto.
* doc/install.texi: Ditto.
* doc/invoke.texi: Ditto.
gcc/fortran/ 
* gfortranspec.c (lang_specific_driver): Update copyright notice
dates.
* gfc-internals.texi: Bump @copying's copyright year.
* gfortran.texi: Ditto.
* intrinsic.texi: Ditto.
* invoke.texi: Ditto.
gcc/d/
* gdc.texi: Bump @copyrights-d year.
gcc/go/
* gccgo.texi: Bump @copyrights-go year.
gcc/ada/
* gnat_ugn.texi: Bump @copying's copyright year.
* gnat_rm.texi: Likewise.
libitm/
* libitm.texi: Bump @copying's copyright year.
libgomp/
* libgomp.texi: Bump @copying's copyright year.
libquadmath/
* libquadmath.texi: Bump @copying's copyright year.

--- libitm/libitm.texi  (revision 267491)
+++ libitm/libitm.texi  (revision 267492)
@@ -7,7 +7,7 @@
 
 
 @copying
-Copyright @copyright{} 2011-2019 Free Software Foundation, Inc.
+Copyright @copyright{} 2011-2020 Free Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.2 or
--- libgomp/libgomp.texi(revision 267491)
+++ libgomp/libgomp.texi(revision 267492)
@@ -7,7 +7,7 @@
 
 
 @copying
-Copyright @copyright{} 2006-2019 Free Software Foundation, Inc.
+Copyright @copyright{} 2006-2020 Free Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
--- libquadmath/libquadmath.texi(revision 267491)
+++ libquadmath/libquadmath.texi(revision 267492)
@@ -6,7 +6,7 @@
 @c %**end of header
 
 @copying
-Copyright @copyright{} 2010-2019 Free Software Foundation, Inc.
+Copyright @copyright{} 2010-2020 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
--- gcc/doc/cpp.texi(revision 267491)
+++ gcc/doc/cpp.texi(revision 267492)
@@ -10,7 +10,7 @@
 
 @copying
 @c man begin COPYRIGHT
-Copyright @copyright{} 1987-2019 Free Software Foundation, Inc.
+Copyright @copyright{} 1987-2020 Free Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
--- gcc/doc/gcc.texi(revision 267491)
+++ gcc/doc/gcc.texi(revision 267492)
@@ -40,7 +40,7 @@
 @c %**end of header
 
 @copying
-Copyright @copyright{} 1988-2019 Free Software Foundation, Inc.
+Copyright @copyright{} 1988-2020 Free Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
--- gcc/doc/cppinternals.texi   (revision 267491)
+++ gcc/doc/cppinternals.texi   (revision 267492)
@@ -18,7 +18,7 @@
 @ifinfo
 This file documents the internals of the GNU C Preprocessor.
 
-Copyright (C) 2000-2019 Free Software Foundation, Inc.
+Copyright (C) 2000-2020 Free Software Foundation, Inc.
 
 Permission is granted to make and distribute verbatim copies of
 this manual provided the copyright notice and this permission notice
@@ -47,7 +47,7 @@ into another language, under the above c
 @page
 @vskip 0pt plus 1filll
 @c man begin COPYRIGHT
-Copyright @copyright{} 2000-2019 Free Software Foundation, Inc.
+Copyright @copyright{} 2000-2020 Free Software Foundation, Inc.
 
 Permission is granted to make and distribute verbatim copies of
 this manual provided the copyright notice and this permission notice
--- gcc/doc/gccint.texi (revision 267491)
+++ gcc/doc/gccint.texi (revision 267492)
@@ -26,7 +26,7 @@
 @c %**end of header
 
 @copying
-Copyright @copyright{} 1988-2019 Free Software Foundation, Inc.
+Copyright @copyright{} 1988-2020 Free Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
--- gcc/doc/invoke.texi (revision 267491)
+++ gcc/doc/invoke.texi (revision 267492)
@@ -8,7 +8,7 @@
 @c man end
 
 @c man begin COPYRIGHT
-Copyright @copyright{} 1988-2019 Free Software Foundation, Inc.
+Copyright @copyright{} 1988-2020 Free Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
--- gcc/doc/gcov.texi   (revision 267491)
+++ gcc/doc/gcov.texi   (revision 267492)
@@ -4,7 +4,7 @@
 
 @ignore
 @c man begin COP

[committed] Tweak update-copyright.py

2020-01-01 Thread Jakub Jelinek
Hi!

I needed the following to successfully run update-copyright.py --this-year.
Committed as obvious to trunk.

2020-01-01  Jakub Jelinek  

* update-copyright.py: Add Mentor Graphics Corporation and Yoshinori
Sato as external authors.  Skip LICENSE.txt files.

--- contrib/update-copyright.py (revision 279810)
+++ contrib/update-copyright.py (working copy)
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 #
-# Copyright (C) 2013-2018 Free Software Foundation, Inc.
+# Copyright (C) 2013-2020 Free Software Foundation, Inc.
 #
 # This script is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -75,6 +75,7 @@ class GenericFilter:
 'COPYING3',
 'COPYING3.LIB',
 'LICENSE',
+'LICENSE.txt',
 'fdl.texi',
 'gpl_v3.texi',
 'fdl-1.3.xml',
@@ -693,6 +694,7 @@ class GCCCopyright (Copyright):
 self.add_external_author ('Information Technology Industry Council.')
 self.add_external_author ('James Theiler, Brian Gough')
 self.add_external_author ('Makoto Matsumoto and Takuji Nishimura,')
+self.add_external_author ('Mentor Graphics Corporation')
 self.add_external_author ('National Research Council of Canada.')
 self.add_external_author ('NVIDIA Corporation')
 self.add_external_author ('Peter Dimov and Multi Media Ltd.')
@@ -710,6 +712,7 @@ class GCCCopyright (Copyright):
 self.add_external_author ('The Regents of the University of 
California.')
 self.add_external_author ('Unicode, Inc.')
 self.add_external_author ('University of Toronto.')
+self.add_external_author ('Yoshinori Sato')
 
 class GCCCmdLine (CmdLine):
 def __init__ (self):

Jakub



[committed] contrib/update-copyright.py --this-year

2020-01-01 Thread Jakub Jelinek
Hi! 
   

   
See r279813 for details, the patch is way too large.  I've also rotated a
bunch of ChangeLog files.

Jakub



[PATCH] Fix up -Wsuggest-attribute=cold (PR ipa/93087)

2020-01-01 Thread Jakub Jelinek
Hi!

While for other -Wsuggest-attribute= cases we only warn if the corresponding
attribute is not present on the current_function_decl, enforced in the
callers of warn_function_*, for the cold attribute warn_function_cold is
called in two places in compute_function_frequency, and in the first one
it is only called when the cold attribute is present on the function.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?

The only thing I'm unsure about is whether the other warn_function_cold call
in the same function could be reached if current_function_decl has "cold"
attribute; I haven't managed to construct a testcase where it would, so
perhaps further changes aren't needed, but if that spot could be reachable
even with functions declared with cold attribute, perhaps we'd need
if (lookup_attribute ("cold", DECL_ATTRIBTES (current_function_decl)) == 
NULL_TREE)
guarding condition for the other warn_function_cold call.

2020-01-01  Jakub Jelinek  

PR ipa/93087
* predict.c (compute_function_frequency): Don't call
warn_function_cold on functions that already have cold attribute.

* c-c++-common/cold-1.c: New test.

--- gcc/predict.c.jj2019-12-10 21:34:48.377594665 +0100
+++ gcc/predict.c   2019-12-31 17:01:09.807440029 +0100
@@ -3937,10 +3937,7 @@ compute_function_frequency (void)
   int flags = flags_from_decl_or_type (current_function_decl);
   if (lookup_attribute ("cold", DECL_ATTRIBUTES (current_function_decl))
  != NULL)
-   {
-  node->frequency = NODE_FREQUENCY_UNLIKELY_EXECUTED;
- warn_function_cold (current_function_decl);
-   }
+   node->frequency = NODE_FREQUENCY_UNLIKELY_EXECUTED;
   else if (lookup_attribute ("hot", DECL_ATTRIBUTES 
(current_function_decl))
   != NULL)
 node->frequency = NODE_FREQUENCY_HOT;
--- gcc/testsuite/c-c++-common/cold-1.c.jj  2019-12-31 17:04:35.154357929 
+0100
+++ gcc/testsuite/c-c++-common/cold-1.c 2019-12-31 17:03:57.992915598 +0100
@@ -0,0 +1,22 @@
+/* PR ipa/93087 */
+/* { dg-do compile { target nonpic } } */
+/* { dg-options "-O1 -Wsuggest-attribute=cold" } */
+
+extern void *getdata (void);
+extern int set_error (char const *message) __attribute__((cold));
+
+__attribute__((cold)) int
+set_nomem (void)   /* { dg-bogus "function might be candidate for 
attribute 'cold'" } */
+{
+  return set_error ("Allocation failed");
+}
+
+void *
+getdata_or_set_error (void)
+{
+  void *result;
+  result = getdata ();
+  if (!result)
+set_nomem ();
+  return result;
+}

Jakub



Re: [PATCH] Fix up -Wsuggest-attribute=cold (PR ipa/93087)

2020-01-01 Thread Jan Hubicka
> Hi!
> 
> While for other -Wsuggest-attribute= cases we only warn if the corresponding
> attribute is not present on the current_function_decl, enforced in the
> callers of warn_function_*, for the cold attribute warn_function_cold is
> called in two places in compute_function_frequency, and in the first one
> it is only called when the cold attribute is present on the function.
> 
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk?

OK.
> 
> The only thing I'm unsure about is whether the other warn_function_cold call
> in the same function could be reached if current_function_decl has "cold"
> attribute; I haven't managed to construct a testcase where it would, so
> perhaps further changes aren't needed, but if that spot could be reachable
> even with functions declared with cold attribute, perhaps we'd need
> if (lookup_attribute ("cold", DECL_ATTRIBTES (current_function_decl)) == 
> NULL_TREE)
> guarding condition for the other warn_function_cold call.

I think the code below is also wrong. It first sets frequency to COLD
and then updates it to other frequencies.
I think warn call needs to be moved after the loop and also predicated
by existence of cold attribute.  Also the function frequency is
computed multiple times, so we need to bookkeep if warning was already
emitted.

Honza
> 
> 2020-01-01  Jakub Jelinek  
> 
>   PR ipa/93087
>   * predict.c (compute_function_frequency): Don't call
>   warn_function_cold on functions that already have cold attribute.
> 
>   * c-c++-common/cold-1.c: New test.
> 
> --- gcc/predict.c.jj  2019-12-10 21:34:48.377594665 +0100
> +++ gcc/predict.c 2019-12-31 17:01:09.807440029 +0100
> @@ -3937,10 +3937,7 @@ compute_function_frequency (void)
>int flags = flags_from_decl_or_type (current_function_decl);
>if (lookup_attribute ("cold", DECL_ATTRIBUTES (current_function_decl))
> != NULL)
> - {
> -  node->frequency = NODE_FREQUENCY_UNLIKELY_EXECUTED;
> -   warn_function_cold (current_function_decl);
> - }
> + node->frequency = NODE_FREQUENCY_UNLIKELY_EXECUTED;
>else if (lookup_attribute ("hot", DECL_ATTRIBUTES 
> (current_function_decl))
>  != NULL)
>  node->frequency = NODE_FREQUENCY_HOT;
> --- gcc/testsuite/c-c++-common/cold-1.c.jj2019-12-31 17:04:35.154357929 
> +0100
> +++ gcc/testsuite/c-c++-common/cold-1.c   2019-12-31 17:03:57.992915598 
> +0100
> @@ -0,0 +1,22 @@
> +/* PR ipa/93087 */
> +/* { dg-do compile { target nonpic } } */
> +/* { dg-options "-O1 -Wsuggest-attribute=cold" } */
> +
> +extern void *getdata (void);
> +extern int set_error (char const *message) __attribute__((cold));
> +
> +__attribute__((cold)) int
> +set_nomem (void) /* { dg-bogus "function might be candidate for 
> attribute 'cold'" } */
> +{
> +  return set_error ("Allocation failed");
> +}
> +
> +void *
> +getdata_or_set_error (void)
> +{
> +  void *result;
> +  result = getdata ();
> +  if (!result)
> +set_nomem ();
> +  return result;
> +}
> 
>   Jakub
> 


Re: [PATCH] Fix PR libgcc/92988

2020-01-01 Thread John David Anglin
This bug was introduced by the following change:
https://gcc.gnu.org/ml/gcc-patches/2019-12/msg00766.html

On 2019-12-30 2:23 p.m., John David Anglin wrote:
> Tested on hppa64-hp-hpux11.11.
>
> Okay?
>
> Dave
>
> 2019-12-30  John David Anglin  
>
>   PR libgcc/92988
>   * crtstuff.c (__do_global_dtors_aux): Only call __cxa_finalize if
>   DEFAULT_USE_CXA_ATEXIT is true.
>
> Index: crtstuff.c
> ===
> --- crtstuff.c(revision 279736)
> +++ crtstuff.c(working copy)
> @@ -382,10 +382,12 @@
>if (__builtin_expect (completed, 0))
>  return;
>
> +#if DEFAULT_USE_CXA_ATEXIT
>  #ifdef CRTSTUFFS_O
>if (__cxa_finalize)
>  __cxa_finalize (__dso_handle);
>  #endif
> +#endif
>
>  #ifdef FINI_ARRAY_SECTION_ASM_OP
>/* If we are using .fini_array then destructors will be run via that
>


-- 
John David Anglin  dave.ang...@bell.net



[committed] Update libstdc++ baseline symbols for hppa-linux

2020-01-01 Thread John David Anglin
Tested on hppa-unkown-linux-gnu.  Committed to trunk.

Dave

2020-01-01  John David Anglin  

* config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Update.

Index: config/abi/post/hppa-linux-gnu/baseline_symbols.txt
===
--- config/abi/post/hppa-linux-gnu/baseline_symbols.txt (revision 279815)
+++ config/abi/post/hppa-linux-gnu/baseline_symbols.txt (working copy)
@@ -4617,16 +4617,10 @@
 OBJECT:15:_ZTSSt8numpunctIwE@@GLIBCXX_3.4
 
OBJECT:16:_ZNSbIwSt11char_traitsIwESaIwEE4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4
 OBJECT:16:_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4
-OBJECT:16:_ZTIPDd@@CXXABI_1.3.4
-OBJECT:16:_ZTIPDe@@CXXABI_1.3.4
-OBJECT:16:_ZTIPDf@@CXXABI_1.3.4
 OBJECT:16:_ZTIPDi@@CXXABI_1.3.3
 OBJECT:16:_ZTIPDn@@CXXABI_1.3.5
 OBJECT:16:_ZTIPDs@@CXXABI_1.3.3
 OBJECT:16:_ZTIPDu@@CXXABI_1.3.12
-OBJECT:16:_ZTIPKDd@@CXXABI_1.3.4
-OBJECT:16:_ZTIPKDe@@CXXABI_1.3.4
-OBJECT:16:_ZTIPKDf@@CXXABI_1.3.4
 OBJECT:16:_ZTIPKDi@@CXXABI_1.3.3
 OBJECT:16:_ZTIPKDn@@CXXABI_1.3.5
 OBJECT:16:_ZTIPKDs@@CXXABI_1.3.3
@@ -5763,9 +5757,6 @@
 
OBJECT:8:_ZGVNSt9money_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE2idE@@GLIBCXX_3.4
 
OBJECT:8:_ZGVNSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE2idE@@GLIBCXX_3.4
 
OBJECT:8:_ZGVNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE2idE@@GLIBCXX_3.4
-OBJECT:8:_ZTIDd@@CXXABI_1.3.4
-OBJECT:8:_ZTIDe@@CXXABI_1.3.4
-OBJECT:8:_ZTIDf@@CXXABI_1.3.4
 OBJECT:8:_ZTIDi@@CXXABI_1.3.3
 OBJECT:8:_ZTIDn@@CXXABI_1.3.5
 OBJECT:8:_ZTIDs@@CXXABI_1.3.3


[committed] Fix comparison operator used for B and S integer comparisons on hppa

2020-01-01 Thread John David Anglin
This fixes PR target/93111.  The ICE

The comparison_operator predicate is too broad and includes a couple of 
comparisons
that aren't valid for integer comparisons on hppa.  We need to use the 
ordered_comparison_operator
predicate.

Similarly, the cmpib_comparison_operator predicate misses a couple of 
comparisons that are valid
for the cmpib patterns.  Again we can use the ordered_comparison_operator 
predicate.

Tested on hppa-unknown-linux-gnu.  Committed to active branches.

Dave

2020-01-01  John David Anglin  

PR target/93111
* config/pa/pa.md (scc): Use ordered_comparison_operator instead of
comparison_operator in B and S integer comparisons.  Likewise, use
ordered_comparison_operator instead of cmpib_comparison_operator in
cmpib patterns.
* config/pa/predicates.md (cmpib_comparison_operator): Remove.

Index: config/pa/pa.md
===
--- config/pa/pa.md (revision 279798)
+++ config/pa/pa.md (working copy)
@@ -765,7 +765,7 @@

 (define_insn "scc"
   [(set (match_operand:SI 0 "register_operand" "=r")
-   (match_operator:SI 3 "comparison_operator"
+   (match_operator:SI 3 "ordered_comparison_operator"
   [(match_operand:SI 1 "reg_or_0_operand" "rM")
(match_operand:SI 2 "arith11_operand" "rI")]))]
   ""
@@ -775,7 +775,7 @@

 (define_insn ""
   [(set (match_operand:DI 0 "register_operand" "=r")
-   (match_operator:DI 3 "comparison_operator"
+   (match_operator:DI 3 "ordered_comparison_operator"
   [(match_operand:DI 1 "reg_or_0_operand" "rM")
(match_operand:DI 2 "arith11_operand" "rI")]))]
   "TARGET_64BIT"
@@ -785,10 +785,10 @@

 (define_insn "iorscc"
   [(set (match_operand:SI 0 "register_operand" "=r")
-   (ior:SI (match_operator:SI 3 "comparison_operator"
+   (ior:SI (match_operator:SI 3 "ordered_comparison_operator"
   [(match_operand:SI 1 "reg_or_0_operand" "rM")
(match_operand:SI 2 "arith11_operand" 
"rI")])
-   (match_operator:SI 6 "comparison_operator"
+   (match_operator:SI 6 "ordered_comparison_operator"
   [(match_operand:SI 4 "reg_or_0_operand" "rM")
(match_operand:SI 5 "arith11_operand" 
"rI")])))]
   ""
@@ -798,10 +798,10 @@

 (define_insn ""
   [(set (match_operand:DI 0 "register_operand" "=r")
-   (ior:DI (match_operator:DI 3 "comparison_operator"
+   (ior:DI (match_operator:DI 3 "ordered_comparison_operator"
   [(match_operand:DI 1 "reg_or_0_operand" "rM")
(match_operand:DI 2 "arith11_operand" 
"rI")])
-   (match_operator:DI 6 "comparison_operator"
+   (match_operator:DI 6 "ordered_comparison_operator"
   [(match_operand:DI 4 "reg_or_0_operand" "rM")
(match_operand:DI 5 "arith11_operand" 
"rI")])))]
   "TARGET_64BIT"
@@ -813,7 +813,7 @@
 ;; from an scc insn (negscc and incscc).
 (define_insn "negscc"
   [(set (match_operand:SI 0 "register_operand" "=r")
-   (neg:SI (match_operator:SI 3 "comparison_operator"
+   (neg:SI (match_operator:SI 3 "ordered_comparison_operator"
   [(match_operand:SI 1 "reg_or_0_operand" "rM")
(match_operand:SI 2 "arith11_operand" "rI")])))]
   ""
@@ -823,7 +823,7 @@

 (define_insn ""
   [(set (match_operand:DI 0 "register_operand" "=r")
-   (neg:DI (match_operator:DI 3 "comparison_operator"
+   (neg:DI (match_operator:DI 3 "ordered_comparison_operator"
   [(match_operand:DI 1 "reg_or_0_operand" "rM")
(match_operand:DI 2 "arith11_operand" "rI")])))]
   "TARGET_64BIT"
@@ -904,7 +904,7 @@

 (define_insn "incscc"
   [(set (match_operand:SI 0 "register_operand" "=r,r")
-   (plus:SI (match_operator:SI 4 "comparison_operator"
+   (plus:SI (match_operator:SI 4 "ordered_comparison_operator"
[(match_operand:SI 2 "register_operand" "r,r")
 (match_operand:SI 3 "arith11_operand" "rI,rI")])
 (match_operand:SI 1 "register_operand" "0,?r")))]
@@ -917,7 +917,7 @@

 (define_insn ""
   [(set (match_operand:DI 0 "register_operand" "=r,r")
-   (plus:DI (match_operator:DI 4 "comparison_operator"
+   (plus:DI (match_operator:DI 4 "ordered_comparison_operator"
[(match_operand:DI 2 "register_operand" "r,r")
 (match_operand:DI 3 "arith11_operand" "rI,rI")])
 (match_operand:DI 1 "register_operand" "0,?r")))]
@@ -1062,7 +1062,7 @@
 (define_insn "decscc"
   [(set (match_operand:SI 0 "register_operand" "=r,r")
(minus:SI (match_operand:SI 1 "register_operand" "0,?r")
- (match_operator:SI 4 "comparison_operator

[patch, fortran, committed] Fix dependency for %re and %im

2020-01-01 Thread Thomas Koenig

Hello world,

New year, new bug, new patch :-)

I have just committed as obvious and simple the attached patch
as r279821, where we failed to account for %re and %im in dependency
checking. This is a 10 regression, gcc 9 works.

Regards

Thomas

Handle REF_INQUIRY for dependency checking.

2020-01-01  Thomas Koenig  

PR fortran/93113
* dependency.c (gfc_dep_resolver): Handle REF_INQUIRY in switch
for ref types.

2020-01-01  Thomas Koenig  

PR fortran/93113
* gfortran.dg/dependency_58.f90: New test.
Index: dependency.c
===
--- dependency.c	(Revision 279765)
+++ dependency.c	(Arbeitskopie)
@@ -2286,6 +2286,12 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gf
 	 subsequent references also overlap.  */
 	  break;
 
+	case REF_INQUIRY:
+	  if (lref->u.i != rref->u.i)
+	return 0;
+
+	  break;
+
 	default:
 	  gcc_unreachable ();
 	}
! { dg-do run }
! { dg-additional-options "-ffrontend-optimize -Warray-temporaries" }
! PR 93113 - this used to ICE, and should not generate a temporary.
program main
  integer, parameter :: n = 10
  complex, dimension(n,n) :: a, b, c
  real, dimension(n,n) :: r
  call random_number (r)
  c%re = r
  call random_number (r)
  c%im = r

  a = c
  b = c
  b%re = a%re - 0.5
  b%im = a%im - 0.5
  a%re = a%re - 0.5
  a%im = a%im - 0.5
  if (any (a /= b)) stop 1
  b%im = a%re
  a%im = a%re
  if (any (a /= b)) stop 2
  a = c
  b = c
  b(2:n,:)%re = a(1:n-1,:)%re
  a(2:n,:)%re = a(1:n-1,:)%re
  if (any (a /= b)) stop 3
  a = c
  b = c
  b(1:n-1,:)%im = a(2:,:)%im
  a(1:n-1,:)%im = a(2:,:)%im
  if (any (a /= b)) stop 3
end program main


[Committed] Fix libobjc on Windows (PR93099)

2020-01-01 Thread Andrew Pinski
Hi,
  On Windows if DLLL_EXPORT was declared objc_EXPORT was defined to an
empty string.  This is wrong as that would produce common symbols in
the headers; except now -fno-common is the default.
So setting the define to extern is the correct fix and removes the
dependency on having common symbols being in use.

Committed after the bug reported tested the patch for me.

Thanks,
Andrew Pinski

ChangeLog:
* objc/objc-decls.h (objc_EXPORT): Define it to extern for DLL_EXPORT
define case.


Re: [Committed] Fix libobjc on Windows (PR93099)

2020-01-01 Thread Andrew Pinski
On Wed, Jan 1, 2020 at 2:14 PM Andrew Pinski  wrote:
>
> Hi,
>   On Windows if DLLL_EXPORT was declared objc_EXPORT was defined to an
> empty string.  This is wrong as that would produce common symbols in
> the headers; except now -fno-common is the default.
> So setting the define to extern is the correct fix and removes the
> dependency on having common symbols being in use.
>
> Committed after the bug reported tested the patch for me.

This time with the patch attached :).

>
> Thanks,
> Andrew Pinski
>
> ChangeLog:
> * objc/objc-decls.h (objc_EXPORT): Define it to extern for DLL_EXPORT
> define case.
Index: objc/objc-decls.h
===
--- objc/objc-decls.h   (revision 279821)
+++ objc/objc-decls.h   (working copy)
@@ -29,7 +29,7 @@ see the files COPYING3 and COPYING.RUNTI
 #if defined (_WIN32) || defined (__WIN32__) || defined (WIN32)
 
 #  ifdef DLL_EXPORT /* defined by libtool (if required) */
-#define objc_EXPORT 
+#define objc_EXPORT extern
 #define objc_DECLARE
 #  else
 #define objc_EXPORT  extern __declspec(dllimport)


[committed] Fix placement of references to functions in COMDAT groups on hppa-linux

2020-01-01 Thread John David Anglin
When I changed pa_reloc_rw_mask() to allow references to function labels to be 
placed in .rodata*,
I broke the handling of references to function labels in COMDAT groups.  The 
linker only allows
references in .data.rel.ro.local to be ignored.

This change puts function label references back in .data.rel.ro.local when they 
refer to a function
in a COMDAT group.

Tested on hppa-unknown-linux-gnu.  The change fixes the build of the Debian 
voronota package.

Committed to trunk and gcc-9 branch.

Dave

2020-01-01  John David Anglin  

PR target/67834
* config/pa/pa.c (pa_elf_select_rtx_section): New.  Put references to
COMDAT group function labels in .data.rel.ro.local section.
* config/pa/pa32-linux.h (TARGET_ASM_SELECT_RTX_SECTION): Define.

Index: config/pa/pa.c
===
--- config/pa/pa.c  (revision 279798)
+++ config/pa/pa.c  (working copy)
@@ -203,6 +203,7 @@
 static bool pa_modes_tieable_p (machine_mode, machine_mode);
 static bool pa_can_change_mode_class (machine_mode, machine_mode, reg_class_t);
 static HOST_WIDE_INT pa_starting_frame_offset (void);
+static section* pa_elf_select_rtx_section(machine_mode, rtx, unsigned 
HOST_WIDE_INT) ATTRIBUTE_UNUSED;

 /* The following extra sections are only used for SOM.  */
 static GTY(()) section *som_readonly_data_section;
@@ -9838,6 +9839,26 @@
 return data_section;
 }

+/* Implement pa_elf_select_rtx_section.  If X is a function label operand
+   and the function is in a COMDAT group, place the plabel reference in the
+   .data.rel.ro.local section.  The linker ignores references to symbols in
+   discarded sections from this section.  */
+
+static section *
+pa_elf_select_rtx_section (machine_mode mode, rtx x,
+  unsigned HOST_WIDE_INT align)
+{
+  if (function_label_operand (x, VOIDmode))
+{
+  tree decl = SYMBOL_REF_DECL (x);
+
+  if (DECL_P (decl) && DECL_COMDAT_GROUP (decl))
+   return get_named_section (NULL, ".data.rel.ro.local", 1);
+}
+
+  return default_elf_select_rtx_section (mode, x, align);
+}
+
 /* Implement pa_reloc_rw_mask.  */

 static int
Index: config/pa/pa32-linux.h
===
--- config/pa/pa32-linux.h  (revision 279798)
+++ config/pa/pa32-linux.h  (working copy)
@@ -76,3 +76,8 @@
rodata when generating non-PIC code.  */
 #undef JUMP_TABLES_IN_TEXT_SECTION
 #define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
+
+/* We need to override default selection to put references to functions
+   in COMDAT groups in .data.rel.ro.local.  */
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define TARGET_ASM_SELECT_RTX_SECTION pa_elf_select_rtx_section


Re: [patch, libfortran] Fortran 2018: Support d0.d, e0.d, es0.d, en0.d, g0.d and ew.d e0 edit descriptors

2020-01-01 Thread Jerry

On 12/31/19 2:17 AM, Thomas Koenig wrote:

Hi Jerry,


OK for trunk?


Looks good. I also think that your approach that DEC stuff should
be checked later is good.  If it passes the testsuite, that's good
enough for a commit.

Thanks for the patch!

Regards

 Thomas



Committed r279828

After looking at the pre-patch DEC code, the only thing I could see was 
to add a check that it only applies when the mode is WRITING, so I added 
that and did full regression testing again before commiting.


Thanks,

Jerry