* [patch i386]: Fix sibcall failures caused by allowing constant memories
@ 2014-05-31 12:27 Kai Tietz
2014-05-31 20:17 ` Jeff Law
2014-06-01 7:28 ` Uros Bizjak
0 siblings, 2 replies; 5+ messages in thread
From: Kai Tietz @ 2014-05-31 12:27 UTC (permalink / raw)
To: GCC Patches; +Cc: Richard Henderson, Uros Bizjak
Hello,
I resend patch within new thread.
Recent fallout about sibcall was caused by using 'm' constraint for
sibcalls. By this wrongly combines happened on reload-pass. That
patch introduces new constraint 'B' for sibcall_memory_operand.
ChangeLog
2014-05-31 Kai Tietz <ktietz@redhat.com>
* constrains.md (define_constrain): New 'B' constraint.
* i386.md (sibcall_insn_operand): Use B instead of m constraint.
ChangeLog testsuite
2014-05-31 Kai Tietz <ktietz@redhat.com>
* gcc.target/i386/sibcall-6.c: New test.
Bootstrapped i386-unknown-linux-gnu, x86_64-unknown-linux-gnu. Ok for apply?
Regards,
Kai
Index: constraints.md
===================================================================
--- constraints.md (Revision 211089)
+++ constraints.md (Arbeitskopie)
@@ -18,7 +18,7 @@
;; <http://www.gnu.org/licenses/>.
;;; Unused letters:
-;;; B H
+;;; H
;;; h j
;; Integer register constraints.
@@ -151,6 +151,11 @@
"@internal Constant call address operand."
(match_operand 0 "constant_call_address_operand"))
+(define_constraint "B"
+ "@internal Sibcall memory operand."
+ (and (not (match_test "TARGET_X32"))
+ (match_operand 0 "sibcall_memory_operand")))
+
(define_constraint "w"
"@internal Call memory operand."
(and (not (match_test "TARGET_X32"))
Index: i386.md
===================================================================
--- i386.md (Revision 211089)
+++ i386.md (Arbeitskopie)
@@ -11376,12 +11376,41 @@
[(set_attr "type" "call")])
(define_insn "*sibcall"
- [(call (mem:QI (match_operand:W 0 "sibcall_insn_operand" "Uzm"))
+ [(call (mem:QI (match_operand:W 0 "sibcall_insn_operand" "UzB"))
(match_operand 1))]
"SIBLING_CALL_P (insn)"
"* return ix86_output_call_insn (insn, operands[0]);"
@@ -11406,7 +11435,7 @@
[(set_attr "type" "call")])
(define_insn "*sibcall_pop"
- [(call (mem:QI (match_operand:SI 0 "sibcall_insn_operand" "Uzm"))
+ [(call (mem:QI (match_operand:SI 0 "sibcall_insn_operand" "UzB"))
(match_operand 1))
(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG)
@@ -11451,7 +11480,7 @@
(define_insn "*sibcall_value"
[(set (match_operand 0)
- (call (mem:QI (match_operand:W 1 "sibcall_insn_operand" "Uzm"))
+ (call (mem:QI (match_operand:W 1 "sibcall_insn_operand" "UzB"))
(match_operand 2)))]
"SIBLING_CALL_P (insn)"
"* return ix86_output_call_insn (insn, operands[1]);"
@@ -11494,7 +11523,7 @@
(define_insn "*sibcall_value_pop"
[(set (match_operand 0)
- (call (mem:QI (match_operand:SI 1 "sibcall_insn_operand" "Uzm"))
+ (call (mem:QI (match_operand:SI 1 "sibcall_insn_operand" "UzB"))
(match_operand 2)))
(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG)
Index: gcc.target/i386/sibcall-6.c
===================================================================
--- gcc.target/i386/sibcall-6.c (Revision 0)
+++ gcc.target/i386/sibcall-6.c (Arbeitskopie)
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target ia32 } */
+/* { dg-options "-O2" } */
+
+typedef void *ira_loop_tree_node_t;
+
+extern int end (int);
+extern int doo (int);
+
+void
+ira_traverse_loop_tree (int bb_p, ira_loop_tree_node_t loop_node,
+ void (*preorder_func) (ira_loop_tree_node_t),
+ void (*postorder_func) (ira_loop_tree_node_t))
+{
+ int l, r = 0x1, h = 0, j = 0;
+
+ if (preorder_func)
+ (*preorder_func) (loop_node);
+
+ if (bb_p)
+ {
+ for (l = 0; l < end (l); l++)
+ {
+ r += doo (l);
+ h += (l + 1) * 3;
+ h %= (l + 1);
+ r -= doo (h);
+ j += (l + 1) * 7;
+ j %= (l + 1);
+ r += doo (j);
+ }
+ }
+
+ if (postorder_func)
+ (*postorder_func) (loop_node);
+}
+/* { dg-final { scan-assembler "jmp[ \t]*.%eax" } } */
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch i386]: Fix sibcall failures caused by allowing constant memories
2014-05-31 12:27 [patch i386]: Fix sibcall failures caused by allowing constant memories Kai Tietz
@ 2014-05-31 20:17 ` Jeff Law
2014-06-01 7:28 ` Uros Bizjak
1 sibling, 0 replies; 5+ messages in thread
From: Jeff Law @ 2014-05-31 20:17 UTC (permalink / raw)
To: Kai Tietz, GCC Patches; +Cc: Richard Henderson, Uros Bizjak
On 05/31/14 06:27, Kai Tietz wrote:
> Hello,
>
> I resend patch within new thread.
> Recent fallout about sibcall was caused by using 'm' constraint for
> sibcalls. By this wrongly combines happened on reload-pass. That
> patch introduces new constraint 'B' for sibcall_memory_operand.
>
> ChangeLog
>
> 2014-05-31 Kai Tietz <ktietz@redhat.com>
>
> * constrains.md (define_constrain): New 'B' constraint.
> * i386.md (sibcall_insn_operand): Use B instead of m constraint.
>
> ChangeLog testsuite
>
> 2014-05-31 Kai Tietz <ktietz@redhat.com>
>
> * gcc.target/i386/sibcall-6.c: New test.
>
> Bootstrapped i386-unknown-linux-gnu, x86_64-unknown-linux-gnu. Ok for apply?
OK.
Jeff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch i386]: Fix sibcall failures caused by allowing constant memories
2014-05-31 12:27 [patch i386]: Fix sibcall failures caused by allowing constant memories Kai Tietz
2014-05-31 20:17 ` Jeff Law
@ 2014-06-01 7:28 ` Uros Bizjak
2014-06-01 10:38 ` Kai Tietz
1 sibling, 1 reply; 5+ messages in thread
From: Uros Bizjak @ 2014-06-01 7:28 UTC (permalink / raw)
To: Kai Tietz; +Cc: GCC Patches, Richard Henderson, Jeff Law
On Sat, May 31, 2014 at 2:27 PM, Kai Tietz <ktietz70@googlemail.com> wrote:
> I resend patch within new thread.
> Recent fallout about sibcall was caused by using 'm' constraint for
> sibcalls. By this wrongly combines happened on reload-pass. That
> patch introduces new constraint 'B' for sibcall_memory_operand.
>
> ChangeLog
>
> 2014-05-31 Kai Tietz <ktietz@redhat.com>
>
> * constrains.md (define_constrain): New 'B' constraint.
Please make this a two-letter constraint (perhaps "Bs"). We are
already short in single-letter constraints.
I plan to change "z" and "w" @internal constraints to "Bz" and "Bw" to
return these two letters.
Uros.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch i386]: Fix sibcall failures caused by allowing constant memories
2014-06-01 7:28 ` Uros Bizjak
@ 2014-06-01 10:38 ` Kai Tietz
0 siblings, 0 replies; 5+ messages in thread
From: Kai Tietz @ 2014-06-01 10:38 UTC (permalink / raw)
To: Uros Bizjak; +Cc: GCC Patches, Richard Henderson, Jeff Law
2014-06-01 9:28 GMT+02:00 Uros Bizjak <ubizjak@gmail.com>:
>
> Please make this a two-letter constraint (perhaps "Bs"). We are
> already short in single-letter constraints.
Sure, I did. I committed patch at revision 211112.
Kai
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch i386]: Fix sibcall failures caused by allowing constant memories
@ 2014-05-31 17:28 Dominique Dhumieres
0 siblings, 0 replies; 5+ messages in thread
From: Dominique Dhumieres @ 2014-05-31 17:28 UTC (permalink / raw)
To: gcc-patches; +Cc: ubizjak, rth, ktietz70
> I resend patch within new thread. ...
This patch fixes pr61377. Could it be committed ASAP?
TIA,
Dominique
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-06-01 10:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-31 12:27 [patch i386]: Fix sibcall failures caused by allowing constant memories Kai Tietz
2014-05-31 20:17 ` Jeff Law
2014-06-01 7:28 ` Uros Bizjak
2014-06-01 10:38 ` Kai Tietz
2014-05-31 17:28 Dominique Dhumieres
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).