public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-7584] [PR99454] LRA: Process separately 'g' and digital constraints > 9 in process_address_1
@ 2021-03-09 16:10 Vladimir Makarov
  0 siblings, 0 replies; only message in thread
From: Vladimir Makarov @ 2021-03-09 16:10 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:fb5d9e8361892a627f5ef9dda7f356f34000ed5b

commit r11-7584-gfb5d9e8361892a627f5ef9dda7f356f34000ed5b
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Tue Mar 9 10:57:21 2021 -0500

    [PR99454] LRA: Process separately 'g' and digital constraints > 9 in process_address_1
    
    gcc/ChangeLog:
    
            PR target/99454
            * lra-constraints.c (process_address_1): Process constraint 'g'
            separately and digital constraints containing more one digit.
    
    gcc/testsuite/ChangeLog:
    
            PR target/99454
            * gcc.target/i386/pr99454.c: New.

Diff:
---
 gcc/lra-constraints.c                   | 13 ++++++----
 gcc/testsuite/gcc.target/i386/pr99454.c | 43 +++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 5 deletions(-)

diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index feff766c590..05cb493852f 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -3452,10 +3452,13 @@ process_address_1 (int nop, bool check_only_p,
 
   constraint
     = skip_contraint_modifiers (curr_static_id->operand[nop].constraint);
-  if ('0' <= constraint[0] && constraint[0] <= '9')
-    constraint
-      = skip_contraint_modifiers (curr_static_id->operand
-				  [constraint[0] - '0'].constraint);
+  if (IN_RANGE (constraint[0], '0', '9'))
+    {
+      char *end;
+      unsigned long dup = strtoul (constraint, &end, 10);
+      constraint
+	= skip_contraint_modifiers (curr_static_id->operand[dup].constraint);
+    }
   cn = lookup_constraint (constraint);
   if (insn_extra_address_constraint (cn)
       /* When we find an asm operand with an address constraint that
@@ -3472,7 +3475,7 @@ process_address_1 (int nop, bool check_only_p,
      i.e. bcst_mem_operand in i386 backend.  */
   else if (MEM_P (mem)
 	   && !(INSN_CODE (curr_insn) < 0
-		&& (cn == CONSTRAINT__UNKNOWN
+		&& ((cn == CONSTRAINT__UNKNOWN && *constraint != 'g')
 		    || (get_constraint_type (cn) == CT_FIXED_FORM
 			&& constraint_satisfied_p (op, cn)))))
     decompose_mem_address (&ad, mem);
diff --git a/gcc/testsuite/gcc.target/i386/pr99454.c b/gcc/testsuite/gcc.target/i386/pr99454.c
new file mode 100644
index 00000000000..a59ba7dcbe0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr99454.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O -w" } */
+
+struct skb_shared_info {
+  short gso_size;
+};
+
+enum { NETDEV_TX_OK };
+
+struct iphdr {
+  short tot_len;
+  int daddr;
+};
+
+int tg3_tso_bug();
+int netdev_priv();
+int skb_cow_head();
+int tcp_hdrlen__builtin_expect();
+struct iphdr *ip_hdr();
+int _tg3_flag();
+int tg3_tso_bug_gso_check();
+
+int
+tg3_start_xmit() {
+  int *tp = netdev_priv();
+  int mss, tnapi;
+  struct iphdr *iph;
+  tnapi = mss = ((struct skb_shared_info *)0)->gso_size;
+  if (mss) {
+    int hdr_len;
+    if (skb_cow_head())
+      iph = ip_hdr();
+    hdr_len = tcp_hdrlen__builtin_expect() && _tg3_flag();
+    if (tg3_tso_bug_gso_check())
+      return tg3_tso_bug(tp, tnapi);
+    iph->tot_len = mss + hdr_len;
+    if (_tg3_flag(tp) || tp)
+      ;
+    else
+      asm("" : : "g"(iph->daddr));
+  }
+  return 0;
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-09 16:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09 16:10 [gcc r11-7584] [PR99454] LRA: Process separately 'g' and digital constraints > 9 in process_address_1 Vladimir Makarov

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).