Re: [PATCH, i386]: Declare constant_call_address_operand as special predicate

2012-03-14 Thread Uros Bizjak
On Wed, Mar 14, 2012 at 12:13 AM, H.J. Lu hjl.to...@gmail.com wrote:

 Similar to tls_symbolic_operand and tls_modbase_operand, we are not
 interested in the mode of the operand in the predicate.

 2012-03-13  Uros Bizjak  ubiz...@gmail.com

        * config/i386/predicates.md (constant_call_address_operand): Declare
        as special predicate.  Update all uses.
        * config/i386/i386.md: Remove mode from constant_call_address_operand
        predicates.
        * config/i386/i386.c (ix86_output_call_insn): Call
        constant_call_address_operand with VOIDmode.

 Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN.


 gcc.c-torture/compile/20020129-1.c fails to compile with -mx32 -O:

 [hjl@gnu-6 gcc]$ ./xgcc -B./ -mx32
 /export/gnu/import/git/gcc/gcc/testsuite/gcc.c-torture/compile/20020129-1.c
 -S -O
 /export/gnu/import/git/gcc/gcc/testsuite/gcc.c-torture/compile/20020129-1.c:
 In function \u2018foo\u2019:
 /export/gnu/import/git/gcc/gcc/testsuite/gcc.c-torture/compile/20020129-1.c:17:1:
 error: unrecognizable insn:
 (call_insn 10 9 11 3 (set (reg:SI 0 ax)
        (call (mem:QI (symbol_ref:SI (a.1707) [flags 0x2] var_decl
 0x715a01e0 a) [0 *a.0_1 S1 A8])
            (const_int 0 [0])))
 /export/gnu/import/git/gcc/gcc/testsuite/gcc.c-torture/compile/20020129-1.c:16
 -1
     (nil)
    (expr_list:REG_BR_PRED (use (reg:SI 5 di))
        (nil)))
 /export/gnu/import/git/gcc/gcc/testsuite/gcc.c-torture/compile/20020129-1.c:17:1:
 internal compiler error: in extract_insn, at recog.c:2123
 Please submit a full bug report,
 with preprocessed source if appropriate.
 See http://gcc.gnu.org/bugs.html for instructions.
 [hjl@gnu-6 gcc]$

I have reverted part of the patch.

2012-03-14  Uros Bizjak  ubiz...@gmail.com

Revert:
2012-03-14  Uros Bizjak  ubiz...@gmail.com

* config/i386/predicates.md (constant_call_address_operand): Declare
as special predicate.  Update all uses.

Uros.


[PATCH, i386]: Declare constant_call_address_operand as special predicate

2012-03-13 Thread Uros Bizjak
Hello!

Similar to tls_symbolic_operand and tls_modbase_operand, we are not
interested in the mode of the operand in the predicate.

2012-03-13  Uros Bizjak  ubiz...@gmail.com

* config/i386/predicates.md (constant_call_address_operand): Declare
as special predicate.  Update all uses.
* config/i386/i386.md: Remove mode from constant_call_address_operand
predicates.
* config/i386/i386.c (ix86_output_call_insn): Call
constant_call_address_operand with VOIDmode.

Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN.

Uros.
Index: i386.md
===
--- i386.md (revision 185341)
+++ i386.md (working copy)
@@ -12592,7 +12592,7 @@
(unspec:SI
 [(match_operand:SI 1 register_operand b)
  (match_operand 2 tls_symbolic_operand )
- (match_operand:SI 3 constant_call_address_operand z)]
+ (match_operand 3 constant_call_address_operand z)]
 UNSPEC_TLS_GD))
(clobber (match_scratch:SI 4 =d))
(clobber (match_scratch:SI 5 =c))
@@ -12617,7 +12617,7 @@
 [(set (match_operand:SI 0 register_operand )
  (unspec:SI [(match_operand:SI 2 register_operand )
  (match_operand 1 tls_symbolic_operand )
- (match_operand:SI 3 constant_call_address_operand )]
+ (match_operand 3 constant_call_address_operand )]
 UNSPEC_TLS_GD))
  (clobber (match_scratch:SI 4 ))
  (clobber (match_scratch:SI 5 ))
@@ -12626,8 +12626,8 @@
 (define_insn *tls_global_dynamic_64_mode
   [(set (match_operand:P 0 register_operand =a)
(call:P
-(mem:QI (match_operand:P 2 constant_call_address_operand z))
-(match_operand:P 3  )))
+(mem:QI (match_operand 2 constant_call_address_operand z))
+(match_operand 3  )))
(unspec:P [(match_operand 1 tls_symbolic_operand )]
 UNSPEC_TLS_GD)]
   TARGET_64BIT
@@ -12650,7 +12650,7 @@
   [(parallel
 [(set (match_operand:P 0 register_operand )
  (call:P
-  (mem:QI (match_operand:P 2 constant_call_address_operand ))
+  (mem:QI (match_operand 2 constant_call_address_operand ))
   (const_int 0)))
  (unspec:P [(match_operand 1 tls_symbolic_operand )]
   UNSPEC_TLS_GD)])]
@@ -12660,7 +12660,7 @@
   [(set (match_operand:SI 0 register_operand =a)
(unspec:SI
 [(match_operand:SI 1 register_operand b)
- (match_operand:SI 2 constant_call_address_operand z)]
+ (match_operand 2 constant_call_address_operand z)]
 UNSPEC_TLS_LD_BASE))
(clobber (match_scratch:SI 3 =d))
(clobber (match_scratch:SI 4 =c))
@@ -12685,7 +12685,7 @@
  [(set (match_operand:SI 0 register_operand )
   (unspec:SI
[(match_operand:SI 1 register_operand )
-(match_operand:SI 2 constant_call_address_operand )]
+(match_operand 2 constant_call_address_operand )]
UNSPEC_TLS_LD_BASE))
   (clobber (match_scratch:SI 3 ))
   (clobber (match_scratch:SI 4 ))
@@ -12694,8 +12694,8 @@
 (define_insn *tls_local_dynamic_base_64_mode
   [(set (match_operand:P 0 register_operand =a)
(call:P
-(mem:QI (match_operand:P 1 constant_call_address_operand z))
-(match_operand:P 2  )))
+(mem:QI (match_operand 1 constant_call_address_operand z))
+(match_operand 2  )))
(unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)]
   TARGET_64BIT
 {
@@ -12712,7 +12712,7 @@
   [(parallel
  [(set (match_operand:P 0 register_operand )
   (call:P
-   (mem:QI (match_operand:P 1 constant_call_address_operand ))
+   (mem:QI (match_operand 1 constant_call_address_operand ))
(const_int 0)))
   (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)])]
   TARGET_64BIT)
@@ -12724,7 +12724,7 @@
   [(set (match_operand:SI 0 register_operand =a)
(plus:SI
 (unspec:SI [(match_operand:SI 1 register_operand b)
-(match_operand:SI 2 constant_call_address_operand z)]
+(match_operand 2 constant_call_address_operand z)]
UNSPEC_TLS_LD_BASE)
 (const:SI (unspec:SI
[(match_operand 3 tls_symbolic_operand )]
Index: i386.c
===
--- i386.c  (revision 185343)
+++ i386.c  (working copy)
@@ -23121,7 +23121,7 @@
 const char *
 ix86_output_call_insn (rtx insn, rtx call_op)
 {
-  bool direct_p = constant_call_address_operand (call_op, Pmode);
+  bool direct_p = constant_call_address_operand (call_op, VOIDmode);
   bool seh_nop_p = false;
   const char *xasm;
 
Index: predicates.md
===
--- predicates.md   (revision 185341)
+++ predicates.md   (working copy)
@@ -500,7 +500,7 @@
(match_test op == ix86_tls_module_base (
 
 ;; Test for a 

Re: [PATCH, i386]: Declare constant_call_address_operand as special predicate

2012-03-13 Thread H.J. Lu
On Tue, Mar 13, 2012 at 11:42 AM, Uros Bizjak ubiz...@gmail.com wrote:
 Hello!

 Similar to tls_symbolic_operand and tls_modbase_operand, we are not
 interested in the mode of the operand in the predicate.

 2012-03-13  Uros Bizjak  ubiz...@gmail.com

        * config/i386/predicates.md (constant_call_address_operand): Declare
        as special predicate.  Update all uses.
        * config/i386/i386.md: Remove mode from constant_call_address_operand
        predicates.
        * config/i386/i386.c (ix86_output_call_insn): Call
        constant_call_address_operand with VOIDmode.

 Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN.


gcc.c-torture/compile/20020129-1.c fails to compile with -mx32 -O:

[hjl@gnu-6 gcc]$ ./xgcc -B./ -mx32
/export/gnu/import/git/gcc/gcc/testsuite/gcc.c-torture/compile/20020129-1.c
-S -O
/export/gnu/import/git/gcc/gcc/testsuite/gcc.c-torture/compile/20020129-1.c:
In function \u2018foo\u2019:
/export/gnu/import/git/gcc/gcc/testsuite/gcc.c-torture/compile/20020129-1.c:17:1:
error: unrecognizable insn:
(call_insn 10 9 11 3 (set (reg:SI 0 ax)
(call (mem:QI (symbol_ref:SI (a.1707) [flags 0x2] var_decl
0x715a01e0 a) [0 *a.0_1 S1 A8])
(const_int 0 [0])))
/export/gnu/import/git/gcc/gcc/testsuite/gcc.c-torture/compile/20020129-1.c:16
-1
 (nil)
(expr_list:REG_BR_PRED (use (reg:SI 5 di))
(nil)))
/export/gnu/import/git/gcc/gcc/testsuite/gcc.c-torture/compile/20020129-1.c:17:1:
internal compiler error: in extract_insn, at recog.c:2123
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.
[hjl@gnu-6 gcc]$


-- 
H.J.