[Bug target/80382] ICE with error: unrecognizable insn

2017-06-27 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

--- Comment #13 from Segher Boessenkool  ---
Author: segher
Date: Tue Jun 27 17:11:01 2017
New Revision: 249700

URL: https://gcc.gnu.org/viewcvs?rev=249700&root=gcc&view=rev
Log:
Backports from trunk:

2016-08-15  Segher Boessenkool  
PR rtl-optimization/73650
* lra-constraints.c (simple_move_p): If the insn is multiple_sets
it is not a simple move.

2017-01-20  Segher Boessenkool  
PR target/61729
PR target/77850
* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Adjust address to
read from, for big endian.

2017-04-04  Segher Boessenkool  
PR rtl-optimization/60818
* simplify-rtx.c (simplify_binary_operation_1): Do not replace
a compare of comparisons with the thing compared if this results
in a different machine mode.

2017-04-12  Segher Boessenkool  
PR target/80382
* config/rs6000/sync.md (atomic_load, atomic_store
PR rtl-optimization/80429
* ira.c (split_live_ranges_for_shrink_wrap): Don't split regs that
are only used in debug insns.

2017-05-17  Segher Boessenkool  
PR middle-end/80692
* real.c (do_compare): Give decimal_do_compare preference over
comparing just the signs.

2017-05-31  Segher Boessenkool  
PR target/80618
* config/rs6000/vector.md (*vector_uneq): Write the nor in the
splitter result in the canonical way.

2017-06-09  Segher Boessenkool  
PR target/80966
* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Assert that
gen_add3_insn did not fail.
* config/rs6000/rs6000.md (add3): If asked to add a constant to
r0, construct that number in a temporary reg and add that reg to r0.
If asked to put the result in r0 as well, fail.

2017-06-23  Segher Boessenkool  
PR middle-end/80902
* builtins.c (expand_builtin_atomic_fetch_op): If emitting code after
a call, force the call to not be a tail call.

gcc/testsuite/
Backports from trunk:

2017-04-04  Segher Boessenkool  
PR rtl-optimization/60818
* gcc.c-torture/compile/pr60818.c: New testcase.

2017-05-17  Segher Boessenkool  
PR middle-end/80692
* gcc.c-torture/execute/pr80692.c: New testcase.

2017-06-09  Segher Boessenkool  
PR target/80966
* gcc.target/powerpc/stack-limit.c: New testcase.

Added:
branches/gcc-6-branch/gcc/testsuite/gcc.c-torture/compile/pr60818.c
branches/gcc-6-branch/gcc/testsuite/gcc.c-torture/execute/pr80692.c
branches/gcc-6-branch/gcc/testsuite/gcc.target/powerpc/stack-limit.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/builtins.c
branches/gcc-6-branch/gcc/config/rs6000/rs6000.c
branches/gcc-6-branch/gcc/config/rs6000/rs6000.md
branches/gcc-6-branch/gcc/config/rs6000/sync.md
branches/gcc-6-branch/gcc/config/rs6000/vector.md
branches/gcc-6-branch/gcc/ira.c
branches/gcc-6-branch/gcc/lra-constraints.c
branches/gcc-6-branch/gcc/real.c
branches/gcc-6-branch/gcc/simplify-rtx.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug target/80382] ICE with error: unrecognizable insn

2017-06-27 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

--- Comment #14 from Segher Boessenkool  ---
Author: segher
Date: Tue Jun 27 18:24:51 2017
New Revision: 249707

URL: https://gcc.gnu.org/viewcvs?rev=249707&root=gcc&view=rev
Log:
Backports from trunk:

2016-08-15  Segher Boessenkool  
PR rtl-optimization/73650
* lra-constraints.c (simple_move_p): If the insn is multiple_sets
it is not a simple move.

2017-01-20  Segher Boessenkool  
PR target/61729
PR target/77850
* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Adjust address to
read from, for big endian.

2017-04-12  Segher Boessenkool  
PR target/80382
* config/rs6000/sync.md (atomic_load, atomic_store
PR middle-end/80692
* real.c (do_compare): Give decimal_do_compare preference over
comparing just the signs.

2017-05-31  Segher Boessenkool  
PR target/80618
* config/rs6000/vector.md (*vector_uneq): Write the nor in the
splitter result in the canonical way.

2017-06-09  Segher Boessenkool  
PR target/80966
* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Assert that
gen_add3_insn did not fail.
* config/rs6000/rs6000.md (add3): If asked to add a constant to
r0, construct that number in a temporary reg and add that reg to r0.
If asked to put the result in r0 as well, fail.

2017-06-23  Segher Boessenkool  
PR middle-end/80902
* builtins.c (expand_builtin_atomic_fetch_op): If emitting code after
a call, force the call to not be a tail call.

gcc/testsuite/
Backports from trunk:

2017-05-17  Segher Boessenkool  
PR middle-end/80692
* gcc.c-torture/execute/pr80692.c: New testcase.

2017-06-09  Segher Boessenkool  
PR target/80966
* gcc.target/powerpc/stack-limit.c: New testcase.

Added:
branches/gcc-5-branch/gcc/testsuite/gcc.c-torture/execute/pr80692.c
branches/gcc-5-branch/gcc/testsuite/gcc.target/powerpc/stack-limit.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/builtins.c
branches/gcc-5-branch/gcc/config/rs6000/rs6000.c
branches/gcc-5-branch/gcc/config/rs6000/rs6000.md
branches/gcc-5-branch/gcc/config/rs6000/sync.md
branches/gcc-5-branch/gcc/config/rs6000/vector.md
branches/gcc-5-branch/gcc/lra-constraints.c
branches/gcc-5-branch/gcc/real.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog

[Bug target/80382] ICE with error: unrecognizable insn

2017-06-27 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

--- Comment #15 from Segher Boessenkool  ---
Author: segher
Date: Tue Jun 27 21:45:45 2017
New Revision: 249711

URL: https://gcc.gnu.org/viewcvs?rev=249711&root=gcc&view=rev
Log:
Those two changes aren't actually applicable to 5.  Sorry for the noise.


Revert:
Backports from trunk:

2017-04-12  Segher Boessenkool  
PR target/80382
* config/rs6000/sync.md (atomic_load, atomic_store
PR target/80966
* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Assert that
gen_add3_insn did not fail.
* config/rs6000/rs6000.md (add3): If asked to add a constant to
r0, construct that number in a temporary reg and add that reg to r0.
If asked to put the result in r0 as well, fail.


Revert:
Backport from trunk:

2017-06-09  Segher Boessenkool  
PR target/80966
* gcc.target/powerpc/stack-limit.c: New testcase.

Removed:
branches/gcc-5-branch/gcc/testsuite/gcc.target/powerpc/stack-limit.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/config/rs6000/rs6000.c
branches/gcc-5-branch/gcc/config/rs6000/rs6000.md
branches/gcc-5-branch/gcc/config/rs6000/sync.md
branches/gcc-5-branch/gcc/testsuite/ChangeLog

[Bug target/80382] ICE with error: unrecognizable insn

2017-06-29 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

Segher Boessenkool  changed:

   What|Removed |Added

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

--- Comment #16 from Segher Boessenkool  ---
Fixed on 6 and later.

[Bug target/80382] ICE with error: unrecognizable insn

2017-04-10 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

--- Comment #1 from Bill Schmidt  ---
You didn't fill in the target.  32/64-bit, little-/big-endian?

[Bug target/80382] ICE with error: unrecognizable insn

2017-04-10 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

--- Comment #2 from Marek Polacek  ---
(In reply to Bill Schmidt from comment #1)
> You didn't fill in the target.  32/64-bit, little-/big-endian?

64-bit, and I think it ICEs on both BE and LE.

[Bug target/80382] ICE with error: unrecognizable insn

2017-04-10 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

--- Comment #3 from Peter Bergner  ---
I'll have a look.

[Bug target/80382] ICE with error: unrecognizable insn

2017-04-10 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

--- Comment #4 from Peter Bergner  ---
(In reply to Marek Polacek from comment #0)
> This testcase (which took ~5 days of reducing) ICEs with -O3 -std=c++11
> -mtune=power8 -mcpu=power8 -mno-lra:

Did you use creduce or delta or ??? to reduce the test case?

[Bug target/80382] ICE with error: unrecognizable insn

2017-04-10 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

--- Comment #5 from Marek Polacek  ---
(In reply to Peter Bergner from comment #4)
> (In reply to Marek Polacek from comment #0)
> > This testcase (which took ~5 days of reducing) ICEs with -O3 -std=c++11
> > -mtune=power8 -mcpu=power8 -mno-lra:
> 
> Did you use creduce or delta or ??? to reduce the test case?

Just creduce.  I think it'd be possible to reduce it a bit more, first manually
and then run creduce again, but it needs a bit of knowledge of C++.

[Bug target/80382] ICE with error: unrecognizable insn

2017-04-10 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

--- Comment #6 from Peter Bergner  ---
(In reply to Marek Polacek from comment #5)
> Just creduce.  I think it'd be possible to reduce it a bit more, first
> manually and then run creduce again, but it needs a bit of knowledge of C++.

Ok, in that case, I'll leave it as is.  Was just making sure you hadn't used
delta.

[Bug target/80382] ICE with error: unrecognizable insn

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek  ---
Note it might be nicer to replace typedef int size_t; with something not that
wrong, say typedef __SIZE_TYPE__ size_t; if it still reproduces with that (or
replace size_t with int everywhere).

[Bug target/80382] ICE with error: unrecognizable insn

2017-04-10 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

Peter Bergner  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-04-10
 Ever confirmed|0   |1

--- Comment #8 from Peter Bergner  ---
Confirmed.  The (const_int 8) offset needs to be a multiple of 16, so I'll
track down why rs6000_legitimize_reload_address() doesn't catch this.

[Bug target/80382] ICE with error: unrecognizable insn

2017-04-11 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

--- Comment #9 from Peter Bergner  ---
It seems you can call creduce multiple times and see some reduction.  Here's a
reduced test case:

bergner@pike:~/gcc/BUGS/PR80382$ cat bug.ii
namespace a {
typedef enum {} b;
template  struct g {
  c d;
  g(c) {}
  b f;
  void i() {
c a;
__atomic_load(&d, &a, f);
  }
};
}
namespace ad {
using a::g;
}
using ad::g;
class k {
  int *ak;
  int h;
};
class l {
public:
  template  l(j);
};
class m {
public:
  m() : as(k()), au(1) { as.i(); }
  g as;
  l au;
};
enum av : int;
class n {
public:
  n(int, av);
};
class G {
  G();
  bool ay;
  m e;
  n bf;
};
enum av : int { bg };
int bh();
G::G() : bf(bh(), bg) {}
bergner@pike:~/gcc/BUGS/PR80382$
/home/bergner/gcc/build/gcc-fsf-mainline-pr80382-debug/gcc/xg++
-B/home/bergner/gcc/build/gcc-fsf-mainline-pr80382-debug/gcc -O3 -std=c++11
-mtune=power8 -mcpu=power8 -mno-lra -S bug.ii
bug.ii: In constructor ‘G::G()’:
bug.ii:44:24: error: unrecognizable insn:
 G::G() : bf(bh(), bg) {}
^
(insn 12 11 13 2 (set (reg:PTI 165)
(unspec:PTI [
(mem/v:TI (plus:DI (reg/f:DI 161 [ this ])
(const_int 8 [0x8])) [-1  S16 A128])
] UNSPEC_LSQ)) "bug.ii":9 -1
 (nil))
bug.ii:44:24: internal compiler error: in extract_insn, at recog.c:2311
0x110c3cf7 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/home/bergner/gcc/gcc-fsf-mainline-pr80382/gcc/rtl-error.c:108
0x110c3d6b _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/home/bergner/gcc/gcc-fsf-mainline-pr80382/gcc/rtl-error.c:116
0x1104ac5b extract_insn(rtx_insn*)
/home/bergner/gcc/gcc-fsf-mainline-pr80382/gcc/recog.c:2311
0x10c0063f instantiate_virtual_regs_in_insn
/home/bergner/gcc/gcc-fsf-mainline-pr80382/gcc/function.c:1589
0x10c0260f instantiate_virtual_regs
/home/bergner/gcc/gcc-fsf-mainline-pr80382/gcc/function.c:1957
0x10c027af execute
/home/bergner/gcc/gcc-fsf-mainline-pr80382/gcc/function.c:2006
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/80382] ICE with error: unrecognizable insn

2017-04-11 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

Segher Boessenkool  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |segher at gcc dot 
gnu.org

--- Comment #10 from Segher Boessenkool  ---
I have a patch.

[Bug target/80382] ICE with error: unrecognizable insn

2017-04-12 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

--- Comment #11 from Segher Boessenkool  ---
Fixed on trunk (I forgot the marker in the checkin comment, oops):

rs6000: Enforce quad_address_p in TImode atomic_load/store (PR80382)

Whatever expand expands to should be valid instructions.  The defined
instructions here have a quad_memory_operand predicate, which boils
down to quad_address_p on the address, so let's test for that instead
of only disallowing indexed addresses.


PR target/80382
* config/rs6000/sync.md (atomic_load, atomic_store

[Bug target/80382] ICE with error: unrecognizable insn

2017-05-12 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

Peter Bergner  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
  Known to fail||5.3.1, 6.1.0

--- Comment #12 from Peter Bergner  ---
With a GCC 6 and GCC 5 builds I had laying around, the reduce test case ICEs
with those versions.  I assume it ICEs on GCC 7 as well. Therefore, we should
back port this fix to the release branches as well.