[Bug target/90193] [8/9 Regression] asm goto with TLS "m" input operand generates incorrect assembler in O1 and O2

2019-04-24 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90193

--- Comment #12 from Jakub Jelinek  ---
Author: jakub
Date: Wed Apr 24 15:49:36 2019
New Revision: 270550

URL: https://gcc.gnu.org/viewcvs?rev=270550&root=gcc&view=rev
Log:
PR target/90193
* rtl.c (classify_insn): Return JUMP_INSN for asm goto.
* emit-rtl.c (try_split): Copy over REG_LABEL_TARGET.

* gcc.target/i386/pr90193.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/i386/pr90193.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/emit-rtl.c
trunk/gcc/rtl.c
trunk/gcc/testsuite/ChangeLog

[Bug target/90193] [8/9 Regression] asm goto with TLS "m" input operand generates incorrect assembler in O1 and O2

2019-04-22 Thread mathieu.desnoyers at efficios dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90193

--- Comment #11 from Mathieu Desnoyers  
---
The proposed fix "gcc9-pr90193.patch" applied on top of gcc-8.3.0 fixes the
issue for both x86-64 and for x86-32 (-m32) from a 64-bit x86 gcc.

[Bug target/90193] [8/9 Regression] asm goto with TLS "m" input operand generates incorrect assembler in O1 and O2

2019-04-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90193

--- Comment #10 from Jakub Jelinek  ---
Created attachment 46222
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46222&action=edit
gcc9-pr90193.patch

Untested fix.

[Bug target/90193] [8/9 Regression] asm goto with TLS "m" input operand generates incorrect assembler in O1 and O2

2019-04-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90193

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #9 from Jakub Jelinek  ---
Looks like missing asm goto support in classify_insn to me.

[Bug target/90193] [8/9 Regression] asm goto with TLS "m" input operand generates incorrect assembler in O1 and O2

2019-04-20 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90193

--- Comment #8 from Segher Boessenkool  ---
(As Alexander said in comment 1...  I need to learn how to read some day).

[Bug target/90193] [8/9 Regression] asm goto with TLS "m" input operand generates incorrect assembler in O1 and O2

2019-04-20 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90193

--- Comment #7 from Segher Boessenkool  ---
The same splitter is what causes the bb of the asm to be marked as
always falling through, which is why that non-fallthrough label is
eventually deleted.

[Bug target/90193] [8/9 Regression] asm goto with TLS "m" input operand generates incorrect assembler in O1 and O2

2019-04-20 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90193

--- Comment #6 from Segher Boessenkool  ---
It emits an insn instead if a jump_insn in the asm, during split1, in

(define_split
  [(match_operand 0 "tls_address_pattern")]
  "TARGET_TLS_DIRECT_SEG_REFS"
  [(match_dup 0)]
  "operands[0] = ix86_rewrite_tls_address (operands[0]);")

[Bug target/90193] [8/9 Regression] asm goto with TLS "m" input operand generates incorrect assembler in O1 and O2

2019-04-20 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90193

--- Comment #5 from Andrew Pinski  ---
(In reply to Segher Boessenkool from comment #4)
> It actually ICEs if you have checking enabled.

Didn't for me with:
GNU C17 (GCC) version 9.0.1 20190401 (experimental) [master revision
449a19898aa:0239598e3c8:8fe074cf790f632b22e59c24f102e528407bb04e]
(x86_64-pc-linux-gnu)
compiled by GNU C version 9.0.1 20190401 (experimental) [master
revision 449a19898aa:0239598e3c8:8fe074cf790f632b22e59c24f102e528407bb04e], GMP
version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version none

[Bug target/90193] [8/9 Regression] asm goto with TLS "m" input operand generates incorrect assembler in O1 and O2

2019-04-20 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90193

Segher Boessenkool  changed:

   What|Removed |Added

 CC||segher at gcc dot gnu.org

--- Comment #4 from Segher Boessenkool  ---
It actually ICEs if you have checking enabled.

[Bug target/90193] [8/9 Regression] asm goto with TLS "m" input operand generates incorrect assembler in O1 and O2

2019-04-20 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90193

Andrew Pinski  changed:

   What|Removed |Added

 CC||ubizjak at gmail dot com
  Component|inline-asm  |target
   Target Milestone|--- |8.4

--- Comment #3 from Andrew Pinski  ---
This is a target issue ...

I think is the insn and split which causes the problem:
(define_insn_and_split "*add_tp_"
  [(set (match_operand:PTR 0 "register_operand" "=r")
(plus:PTR
  (unspec:PTR [(const_int 0)] UNSPEC_TP)
  (match_operand:PTR 1 "register_operand" "0")))
   (clobber (reg:CC FLAGS_REG))]
  ""
  "#"
  ""
  [(parallel
 [(set (match_dup 0)
   (plus:PTR (match_dup 1) (match_dup 2)))
  (clobber (reg:CC FLAGS_REG))])]
{
  addr_space_t as = DEFAULT_TLS_SEG_REG;

  operands[2] = gen_const_mem (mode, const0_rtx);
  set_mem_addr_space (operands[2], as);
})

Which was introduced/changed in r251075.