diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/lra-constraints.c | 13 | ||||
-rw-r--r-- | 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 feff766..05cb493 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 0000000..a59ba7d --- /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; +} |