[Bug target/85430] [7/8 Regression] ICE: SIGSEGV in memory_operand at recog.c:1358 with -O2 -fno-tree-ccp -fno-tree-fre

2018-04-17 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85430

--- Comment #4 from Zdenek Sojka  ---
Observation about generated code:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-tree-ccp -fno-tree-fre testcase.c -S -o-
...
foo:
movl%edi, %eax
addb%al, %al
ret
...

which looks superior to code generated by -O1/-O2/-O3/-Os/-Og :
...
foo:
movsbl  %dil, %edx
addl%edx, %edx
movl%edi, %eax
movb%dl, %al
ret
...

[Bug target/85430] [7/8 Regression] ICE: SIGSEGV in memory_operand at recog.c:1358 with -O2 -fno-tree-ccp -fno-tree-fre

2018-04-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85430

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Tue Apr 17 17:01:31 2018
New Revision: 259436

URL: https://gcc.gnu.org/viewcvs?rev=259436=gcc=rev
Log:
PR target/85430
* config/i386/i386.md (*ashlqi3_1_slp): Use alu1 type instead of alu.

* gcc.dg/pr85430.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/pr85430.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.md
trunk/gcc/testsuite/ChangeLog

[Bug target/85430] [7/8 Regression] ICE: SIGSEGV in memory_operand at recog.c:1358 with -O2 -fno-tree-ccp -fno-tree-fre

2018-04-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85430

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||uros at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
This fixes it.  Let me look for other similar issues.

--- gcc/config/i386/i386.md.jj  2018-04-05 20:34:31.989020754 +0200
+++ gcc/config/i386/i386.md 2018-04-17 12:14:19.550691464 +0200
@@ -10713,7 +10713,7 @@ (define_insn "*ashlqi3_1_slp"
 {
   switch (get_attr_type (insn))
 {
-case TYPE_ALU:
+case TYPE_ALU1:
   gcc_assert (operands[1] == const1_rtx);
   return "add{b}\t%0, %0";

@@ -10729,12 +10729,12 @@ (define_insn "*ashlqi3_1_slp"
  (cond [(and (and (match_test "TARGET_DOUBLE_WITH_ADD")
  (match_operand 0 "register_operand"))
 (match_operand 1 "const1_operand"))
- (const_string "alu")
+ (const_string "alu1")
   ]
   (const_string "ishift1")))
(set (attr "length_immediate")
  (if_then_else
-   (ior (eq_attr "type" "alu")
+   (ior (eq_attr "type" "alu1")
(and (eq_attr "type" "ishift1")
 (and (match_operand 1 "const1_operand")
  (ior (match_test "TARGET_SHIFT1")

[Bug target/85430] [7/8 Regression] ICE: SIGSEGV in memory_operand at recog.c:1358 with -O2 -fno-tree-ccp -fno-tree-fre

2018-04-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85430

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P2
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-04-17
 CC||jakub at gcc dot gnu.org
   Target Milestone|--- |7.4
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Started with r240006.