From 4692a783656f005ff9737dfb296b25ed6d5ff114 Mon Sep 17 00:00:00 2001 From: Vladimir Makarov Date: Fri, 8 Dec 2017 23:47:44 +0000 Subject: [PATCH] [multiple changes] 2017-12-08 Vladimir Makarov PR rtl-optimization/83317 * lra-constraints.c (process_address_1): Add insn code check. 2017-12-08 Jakub Jelinek PR rtl-optimization/83317 * gcc.target/i386/pr83317.c: New test. From-SVN: r255517 --- gcc/ChangeLog | 5 +++++ gcc/lra-constraints.c | 3 ++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr83317.c | 21 +++++++++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr83317.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 35c27be..973fb15 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-12-08 Vladimir Makarov + + PR rtl-optimization/83317 + * lra-constraints.c (process_address_1): Add insn code check. + 2017-12-08 Michael Matz Fix PR tree-optimization/83323 diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 3758409..a6600ef 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -3222,7 +3222,8 @@ process_address_1 (int nop, bool check_only_p, /* Do not attempt to decompose arbitrary addresses generated by combine for asm operands with loose constraints, e.g 'X'. */ else if (MEM_P (op) - && !(get_constraint_type (cn) == CT_FIXED_FORM + && !(INSN_CODE (curr_insn) < 0 + && get_constraint_type (cn) == CT_FIXED_FORM && constraint_satisfied_p (op, cn))) decompose_mem_address (&ad, op); else if (GET_CODE (op) == SUBREG diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 79f6d24..cd6c927 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2017-12-08 Jakub Jelinek + PR rtl-optimization/83317 + * gcc.target/i386/pr83317.c: New test. + +2017-12-08 Jakub Jelinek + PR rtl-optimization/81595 * gcc.c-torture/compile/pr81595.c: New test. diff --git a/gcc/testsuite/gcc.target/i386/pr83317.c b/gcc/testsuite/gcc.target/i386/pr83317.c new file mode 100644 index 0000000..5ae0b8d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr83317.c @@ -0,0 +1,21 @@ +/* PR rtl-optimization/83317 */ +/* { dg-do compile } */ +/* { dg-options "-O1" } */ +/* { dg-additional-options "-fPIC" { target fpic } } */ +/* { dg-additional-options "-msse2 -mfpmath=sse" { target ia32 } } */ + +struct S { double a; }; +struct S c; +int d, e; +void *buf[64]; +extern int setjmp (void **); + +void +foo () +{ + setjmp (buf); + struct S g; + if (d) + g.a = __builtin_copysign (e, d); + c = g; +} -- 2.7.4