[Bug c/99127] ICE in expand_expr_addr_expr_1, at expr.c:8026 (during RTL pass: expand) at -O1 or higher on hppa

2021-02-17 Thread kurt at intricatesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99127

--- Comment #6 from Kurt Miller  ---
For clarity, I see now there are two reduced test cases. My test patch fixed
the initial reduced test case but not the second one.

apoc$ cat pr99127.i 
int c_pow_r_1, c_pow_r_0, c_pow_phase;

void
c_pow() {
  c_pow_r_0 = __builtin_cos(c_pow_phase);
  c_pow_r_1 = __builtin_sin(c_pow_phase);
}
apoc$ egcc -c -O1 -o pr99127.o pr99127.i  
apoc$
apoc$ cat pr99127a.i
int c_pow_r_1, c_pow_r_0, c_pow_phase;

void
c_pow() {
  _Complex double r = __builtin_cexpi(c_pow_phase);
  c_pow_r_0 = __real__ r;
  c_pow_r_1 = __imag__ r;
}
apoc$ egcc -c -O1 -o pr99127a.o pr99127a.i 
during RTL pass: expand
pr99127a.i: In function 'c_pow':
pr99127a.i:5:23: internal compiler error: in expand_expr_addr_expr_1, at
expr.c:8026
   _Complex double r = __builtin_cexpi(c_pow_phase);
   ^~~~
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
apoc$

[Bug c/99127] ICE in expand_expr_addr_expr_1, at expr.c:8026 (during RTL pass: expand) at -O1 or higher on hppa

2021-02-17 Thread kurt at intricatesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99127

--- Comment #5 from Kurt Miller  ---
(In reply to Jakub Jelinek from comment #4)
> So, do you get the ICE with
> int c_pow_r_1, c_pow_r_0, c_pow_phase;
> 
> void
> c_pow() {
>   _Complex double r = __builtin_cexpi(c_pow_phase);
>   c_pow_r_0 = __real__ r;
>   c_pow_r_1 = __imag__ r;
> }
> too?

I made the following change to the 8.4.0 port:

Index: gcc/tree-ssa-math-opts.c
--- gcc/tree-ssa-math-opts.c.orig
+++ gcc/tree-ssa-math-opts.c
@@ -1922,7 +1922,11 @@ class pass_cse_sincos : public gimple_opt_pass (public
 {
   /* We no longer require either sincos or cexp, since powi expansion
 piggybacks on this pass.  */
+#if defined(__hppa__)
+  return false;
+#else
   return optimize;
+#endif
 }

   virtual unsigned int execute (function *);

I know this is not correct for cross compiling but I'm building native on hppa.
That change fixed the python builds but does not fix the reduced test case
above.

apoc$ egcc -c -O1 -o hppatest.o hppatest.c 
apoc$ 
apoc$ egcc -c -O1 -o pr99127.o pr99127.i   
during RTL pass: expand
pr99127.i: In function 'c_pow':
pr99127.i:5:23: internal compiler error: in expand_expr_addr_expr_1, at
expr.c:8026
   _Complex double r = __builtin_cexpi(c_pow_phase);
   ^~~~
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

[Bug c/99127] ICE in expand_expr_addr_expr_1, at expr.c:8026 (during RTL pass: expand) at -O1 or higher on hppa

2021-02-17 Thread kurt at intricatesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99127

--- Comment #3 from Kurt Miller  ---
Changing the gate function to return false does work-around the python ICEs.

[Bug c/99127] ICE in expand_expr_addr_expr_1, at expr.c:8026 (during RTL pass: expand) at -O1 or higher on hppa

2021-02-16 Thread kurt at intricatesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99127

Kurt Miller  changed:

   What|Removed |Added

 CC||kurt at intricatesoftware dot 
com

--- Comment #1 from Kurt Miller  ---
Created attachment 50208
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50208=edit
testcase preprocessed

[Bug c/99127] New: ICE in expand_expr_addr_expr_1, at expr.c:8026 (during RTL pass: expand) at -O1 or higher on hppa

2021-02-16 Thread kurt at intricatesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99127

Bug ID: 99127
   Summary: ICE in expand_expr_addr_expr_1, at expr.c:8026 (during
RTL pass: expand) at -O1 or higher on hppa
   Product: gcc
   Version: 8.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: kurt at intricatesoftware dot com
  Target Milestone: ---

Created attachment 50207
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50207=edit
testcase

gcc-8.4.0-hppa-unknown-openbsd6.8 ICEs when compiling Python 2.7, 3.8 & 3.9 on
hppa. I've partially reduced one example in the attachments. Reducing
optimization level to -O0 does not hit the ICE.

egcc -c -O1 -o hppatest.o hppatest.c 
during RTL pass: expand
hppatest.c: In function 'c_pow':
hppatest.c:12:1: internal compiler error: in expand_expr_addr_expr_1, at
expr.c:8026
 c_pow(Py_complex a, Py_complex b)
 ^
libbacktrace could not find executable to open

[Bug c++/99115] ICE in extract_insn, at recog.c:2309 on alpha (error: unrecognizable insn) with -O2

2021-02-15 Thread kurt at intricatesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99115

Kurt Miller  changed:

   What|Removed |Added

 Target||alpha-unknown-openbsd6.8
 CC||kurt at intricatesoftware dot 
com

--- Comment #2 from Kurt Miller  ---
This ICE is on alpha (not hppa).

[Bug c++/99115] ICE in extract_insn, at recog.c:2309 on hppa (error: unrecognizable insn) with -O2

2021-02-15 Thread kurt at intricatesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99115

--- Comment #1 from Kurt Miller  ---
Created attachment 50192
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50192=edit
testcase preprocessed

[Bug c++/99115] New: ICE in extract_insn, at recog.c:2309 on hppa (error: unrecognizable insn) with -O2

2021-02-15 Thread kurt at intricatesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99115

Bug ID: 99115
   Summary: ICE in extract_insn, at recog.c:2309 on hppa (error:
unrecognizable insn) with -O2
   Product: gcc
   Version: 8.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: kurt at intricatesoftware dot com
  Target Milestone: ---

Created attachment 50191
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50191=edit
testcase

Noticed while compiling src/deps_log.cc ninja 1.10.2 on hppa. I trimmed down
the file to test.cc.

g++ -O2 -c ./test.cc -o test.o
./test.cc: In member function 'LoadStatus DepsLog::Load(const string&, State*,
std::__cxx11::string*)':
./test.cc:176:1: error: unrecognizable insn:
 }
 ^
(insn 218 217 219 25 (set (reg:DI 217)
(plus:DI (reg/f:DI 65 virtual-stack-vars)
(const_int -524292 [0xfff7fffc]))) "./test.cc":122 -1
 (nil))
during RTL pass: vregs
./test.cc:176:1: internal compiler error: in extract_insn, at recog.c:2309