[Bug fortran/97162] [11 Regression] ICE when building SPECCPU 2006 Gamess benchmark

2020-09-23 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97162

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #10 from Richard Biener  ---
Fixed.

[Bug fortran/97162] [11 Regression] ICE when building SPECCPU 2006 Gamess benchmark

2020-09-23 Thread tnfchris at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97162

--- Comment #9 from Tamar Christina  ---
Thanks Richi!

I can confirm the testcase builds with that patch :)

[Bug fortran/97162] [11 Regression] ICE when building SPECCPU 2006 Gamess benchmark

2020-09-23 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97162

--- Comment #8 from CVS Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:371f0b990f2bbf638b44da27cf6fc5f86e0d6d4e

commit r11-3385-g371f0b990f2bbf638b44da27cf6fc5f86e0d6d4e
Author: Richard Biener 
Date:   Wed Sep 23 10:07:37 2020 +0200

middle-end/97162 - fix ICE when building gamess

This appropriately guards the check for a hard register in
compare_base_decls which otherwise ICEs when passed a CONST_DECL.

2020-09-23  Richard Biener  

PR middle-end/97162
* alias.c (compare_base_decls): Use DECL_HARD_REGISTER
and guard with VAR_P.

[Bug fortran/97162] [11 Regression] ICE when building SPECCPU 2006 Gamess benchmark

2020-09-23 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97162

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org

[Bug fortran/97162] [11 Regression] ICE when building SPECCPU 2006 Gamess benchmark

2020-09-23 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97162

Richard Biener  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #7 from Richard Biener  ---
So we're getting a CONST_DECL into compare_base_decls which doesn't have RTL
but DECL_REGISTER requires DECL_WITH_RTL.  One fix would be

diff --git a/gcc/alias.c b/gcc/alias.c
index 1cb702be2ce..3f01c7072d2 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -2142,7 +2142,9 @@ compare_base_decls (tree base1, tree base2)

   /* If we have two register decls with register specification we
  cannot decide unless their assembler names are the same.  */
-  if (DECL_REGISTER (base1)
+  if (HAS_RTL_P (base1)
+  && HAS_RTL_P (base2)
+  && DECL_REGISTER (base1)
   && DECL_REGISTER (base2)
   && HAS_DECL_ASSEMBLER_NAME_P (base1)
   && HAS_DECL_ASSEMBLER_NAME_P (base2)

but I wonder if we instead want

   VAR_P (base1) && DECL_HARD_REGISTER (base1)

?  So I'm testing the following which also fixes the testcase

diff --git a/gcc/alias.c b/gcc/alias.c
index 1cb702be2ce..f6d7a1791c4 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -2142,10 +2142,10 @@ compare_base_decls (tree base1, tree base2)

   /* If we have two register decls with register specification we
  cannot decide unless their assembler names are the same.  */
-  if (DECL_REGISTER (base1)
-  && DECL_REGISTER (base2)
-  && HAS_DECL_ASSEMBLER_NAME_P (base1)
-  && HAS_DECL_ASSEMBLER_NAME_P (base2)
+  if (VAR_P (base1)
+  && VAR_P (base2)
+  && DECL_HARD_REGISTER (base1)
+  && DECL_HARD_REGISTER (base2)
   && DECL_ASSEMBLER_NAME_SET_P (base1)
   && DECL_ASSEMBLER_NAME_SET_P (base2))
 {

[Bug fortran/97162] [11 Regression] ICE when building SPECCPU 2006 Gamess benchmark

2020-09-22 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97162

--- Comment #6 from Martin Liška  ---
(In reply to Richard Biener from comment #5)
> So just in case the following fixes it we've nailed it (somewhere I have a
> verifier written...)
> 
> diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
> index b1d6e63559c..2f41ad222a0 100644
> --- a/gcc/tree-predcom.c
> +++ b/gcc/tree-predcom.c
> @@ -3326,6 +3326,7 @@ tree_predictive_commoning (void)
>class loop *loop;
>unsigned ret = 0, changed = 0;
>  
> +  scev_reset ();
>initialize_original_copy_tables ();
>FOR_EACH_LOOP (loop, LI_ONLY_INNERMOST)
>  if (optimize_loop_for_speed_p (loop))

Unfortunately, it doesn't help.

[Bug fortran/97162] [11 Regression] ICE when building SPECCPU 2006 Gamess benchmark

2020-09-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97162

--- Comment #5 from Richard Biener  ---
So just in case the following fixes it we've nailed it (somewhere I have a
verifier written...)

diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index b1d6e63559c..2f41ad222a0 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -3326,6 +3326,7 @@ tree_predictive_commoning (void)
   class loop *loop;
   unsigned ret = 0, changed = 0;

+  scev_reset ();
   initialize_original_copy_tables ();
   FOR_EACH_LOOP (loop, LI_ONLY_INNERMOST)
 if (optimize_loop_for_speed_p (loop))

[Bug fortran/97162] [11 Regression] ICE when building SPECCPU 2006 Gamess benchmark

2020-09-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97162

Richard Biener  changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu.org
   Target Milestone|--- |11.0

--- Comment #4 from Richard Biener  ---
So what are base1/base2 when the assert triggers?  Also try a checking build
which should ICE a bit earlier in the assert:

   gcc_checking_assert (DECL_P (base1) && DECL_P (base2));

but the call chain looks sufficiently protected - so maybe it's a GC issue
of SCEV data...

[Bug fortran/97162] [11 Regression] ICE when building SPECCPU 2006 Gamess benchmark

2020-09-22 Thread tnfchris at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97162

--- Comment #3 from Tamar Christina  ---
Hmm it compiles for me with GCC 10.2 built from
e939674db6fda62a98675d20b95175ec4ba81140

[Bug fortran/97162] [11 Regression] ICE when building SPECCPU 2006 Gamess benchmark

2020-09-22 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97162

--- Comment #2 from Martin Liška  ---
Hm, is it really a GCC 11 regression? I see another ICE with the oldest
revision I have:
9d55066c88b4c276(09 Oct 2014 07:40)(fxcoud...@gcc.gnu.org)


scflib.fppized.f: In function 'symh.constprop':
scflib.fppized.f:3780:0: internal compiler error: in expand_assignment, at
expr.c:4857
   460 H(KL) = T(K,L)
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
make[1]: *** [/tmp/cceDDRMT.mk:8: /tmp/ccGK5ftT.ltrans2.ltrans.o] Error 1

[Bug fortran/97162] [11 Regression] ICE when building SPECCPU 2006 Gamess benchmark

2020-09-22 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97162

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org
   Last reconfirmed||2020-09-22
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #1 from Martin Liška  ---
I can reproduce that and I'm working on a reduction of the issue..